ReasoningBlock
Defined in: src/types/messages.ts:749
Reasoning content block within a message.
Implements
Section titled “Implements”ReasoningBlockDataJSONSerializable<{reasoning:Serialized<ReasoningBlockData>; }>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ReasoningBlock(data): ReasoningBlock;Defined in: src/types/messages.ts:777
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
data | ReasoningBlockData |
Returns
Section titled “Returns”ReasoningBlock
Properties
Section titled “Properties”readonly type: "reasoningBlock";Defined in: src/types/messages.ts:755
Discriminator for reasoning content.
readonly text?: string;Defined in: src/types/messages.ts:760
The text content of the reasoning process.
Implementation of
Section titled “Implementation of”signature?
Section titled “signature?”readonly signature?: string;Defined in: src/types/messages.ts:765
A cryptographic signature for verification purposes.
Implementation of
Section titled “Implementation of”redactedContent?
Section titled “redactedContent?”readonly redactedContent?: Uint8Array;Defined in: src/types/messages.ts:770
The redacted content of the reasoning process.
Implementation of
Section titled “Implementation of”ReasoningBlockData.redactedContent
providerData?
Section titled “providerData?”readonly providerData?: ReasoningProviderData;Defined in: src/types/messages.ts:775
Provider-native reasoning, sent only to models that take it back.
Implementation of
Section titled “Implementation of”ReasoningBlockData.providerData
Methods
Section titled “Methods”toJSON()
Section titled “toJSON()”toJSON(): { reasoning: { text?: string; signature?: string; redactedContent?: string; providerData?: { provider: string; modelId: string; data: { [key: string]: | string | number | boolean | { [key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 3 more ... | (string | ... 3 more ... | (string | ... 3 more ... | (string | ... 3 more ... | (string | ... 3 more ... | ...; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 3 more ... | (string | ... 3 more ... | (string | ... 3 more ... | (string | ... 3 more ... | (string | ... 3 more ... | ...[]; }; }; };};Defined in: src/types/messages.ts:797
Serializes the ReasoningBlock to a JSON-compatible ContentBlockData object. Called automatically by JSON.stringify(). Uint8Array redactedContent is encoded as base64 string.
Returns
Section titled “Returns”{ reasoning: { text?: string; signature?: string; redactedContent?: string; providerData?: { provider: string; modelId: string; data: { [key: string]: | string | number | boolean | { [key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 3 more ... | (string | ... 3 more ... | (string | ... 3 more ... | (string | ... 3 more ... | (string | ... 3 more ... | ...; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 3 more ... | (string | ... 3 more ... | (string | ... 3 more ... | (string | ... 3 more ... | (string | ... 3 more ... | ...[]; }; }; };}| Name | Type | Description | Defined in |
|---|---|---|---|
reasoning | { text?: string; signature?: string; redactedContent?: string; providerData?: { provider: string; modelId: string; data: { [key: string]: | string | number | boolean | { [key: string]: string | number | boolean | { [x: string]: string | number | boolean | … | (string | number | boolean | … | (string | number | boolean | … | (string | number | boolean | … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | …; } | string | number | boolean | { [x: string]: string | number | boolean | … | (string | number | boolean | … | (string | number | boolean | … | (string | number | boolean | … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | …[]; }; }; } | - | src/types/messages.ts:797 |
reasoning.text? | string | The text content of the reasoning process. | src/types/messages.ts:728 |
reasoning.signature? | string | A cryptographic signature for verification purposes. | src/types/messages.ts:733 |
reasoning.redactedContent? | string | The redacted content of the reasoning process. | src/types/messages.ts:738 |
reasoning.providerData? | { provider: string; modelId: string; data: { [key: string]: | string | number | boolean | { [key: string]: string | number | boolean | { [x: string]: string | number | boolean | … | (string | number | boolean | … | (string | number | boolean | … | (string | number | boolean | … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | …; } | string | number | boolean | { [x: string]: string | number | boolean | … | (string | number | boolean | … | (string | number | boolean | … | (string | number | boolean | … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | …[]; }; } | Provider-native reasoning, sent only to models that take it back. | src/types/messages.ts:743 |
reasoning.providerData.provider | string | The format tag of the provider that wrote it: 'openai_responses', or the vendor that signed it ('anthropic', 'google'). | src/types/messages.ts:707 |
reasoning.providerData.modelId | string | The model that produced the reasoning. | src/types/messages.ts:712 |
reasoning.providerData.data | { [key: string]: | string | number | boolean | { [key: string]: string | number | boolean | { [x: string]: string | number | boolean | … | (string | number | boolean | … | (string | number | boolean | … | (string | number | boolean | … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | …; } | string | number | boolean | { [x: string]: string | number | boolean | … | (string | number | boolean | … | (string | number | boolean | … | (string | number | boolean | … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | …[]; } | The provider’s own JSON payload; private to that provider and not a stable shape. Empty when the block’s own fields already hold everything, as for a signature. | src/types/messages.ts:718 |
Implementation of
Section titled “Implementation of”JSONSerializable.toJSON
fromJSON()
Section titled “fromJSON()”static fromJSON(data): ReasoningBlock;Defined in: src/types/messages.ts:815
Creates a ReasoningBlock instance from its wrapped data format. Base64-encoded redactedContent is decoded back to Uint8Array.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
data | { reasoning: { text?: string; signature?: string; redactedContent?: string | Uint8Array<ArrayBufferLike>; providerData?: { provider: string; modelId: string; data: { [key: string]: | string | number | boolean | { [key: string]: string | number | boolean | { [x: string]: string | number | boolean | … | (string | number | boolean | … | (string | number | boolean | … | (string | number | boolean | … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | …; } | string | number | boolean | { [x: string]: string | number | boolean | … | (string | number | boolean | … | (string | number | boolean | … | (string | number | boolean | … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | …[]; }; }; }; } | Wrapped ReasoningBlockData to deserialize (accepts both string and Uint8Array for redactedContent) |
data.reasoning | { text?: string; signature?: string; redactedContent?: string | Uint8Array<ArrayBufferLike>; providerData?: { provider: string; modelId: string; data: { [key: string]: | string | number | boolean | { [key: string]: string | number | boolean | { [x: string]: string | number | boolean | … | (string | number | boolean | … | (string | number | boolean | … | (string | number | boolean | … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | …; } | string | number | boolean | { [x: string]: string | number | boolean | … | (string | number | boolean | … | (string | number | boolean | … | (string | number | boolean | … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | …[]; }; }; } | - |
data.reasoning.text? | string | The text content of the reasoning process. |
data.reasoning.signature? | string | A cryptographic signature for verification purposes. |
data.reasoning.redactedContent? | string | Uint8Array<ArrayBufferLike> | The redacted content of the reasoning process. |
data.reasoning.providerData? | { provider: string; modelId: string; data: { [key: string]: | string | number | boolean | { [key: string]: string | number | boolean | { [x: string]: string | number | boolean | … | (string | number | boolean | … | (string | number | boolean | … | (string | number | boolean | … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | …; } | string | number | boolean | { [x: string]: string | number | boolean | … | (string | number | boolean | … | (string | number | boolean | … | (string | number | boolean | … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | …[]; }; } | Provider-native reasoning, sent only to models that take it back. |
data.reasoning.providerData.provider | string | The format tag of the provider that wrote it: 'openai_responses', or the vendor that signed it ('anthropic', 'google'). |
data.reasoning.providerData.modelId | string | The model that produced the reasoning. |
data.reasoning.providerData.data | { [key: string]: | string | number | boolean | { [key: string]: string | number | boolean | { [x: string]: string | number | boolean | … | (string | number | boolean | … | (string | number | boolean | … | (string | number | boolean | … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | …; } | string | number | boolean | { [x: string]: string | number | boolean | … | (string | number | boolean | … | (string | number | boolean | … | (string | number | boolean | … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | (string | … 3 more … | …[]; } | The provider’s own JSON payload; private to that provider and not a stable shape. Empty when the block’s own fields already hold everything, as for a signature. |
Returns
Section titled “Returns”ReasoningBlock
ReasoningBlock instance