ReasoningBlock
Defined in: src/types/messages.ts:409
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:432
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:415
Discriminator for reasoning content.
readonly optional text: string;Defined in: src/types/messages.ts:420
The text content of the reasoning process.
Implementation of
Section titled “Implementation of”signature?
Section titled “signature?”readonly optional signature: string;Defined in: src/types/messages.ts:425
A cryptographic signature for verification purposes.
Implementation of
Section titled “Implementation of”redactedContent?
Section titled “redactedContent?”readonly optional redactedContent: Uint8Array;Defined in: src/types/messages.ts:430
The redacted content of the reasoning process.
Implementation of
Section titled “Implementation of”ReasoningBlockData.redactedContent
Methods
Section titled “Methods”toJSON()
Section titled “toJSON()”toJSON(): { reasoning: { text?: string; signature?: string; redactedContent?: string; };};Defined in: src/types/messages.ts:449
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; };}| Name | Type | Description | Defined in |
|---|---|---|---|
reasoning | { text?: string; signature?: string; redactedContent?: string; } | - | src/types/messages.ts:449 |
reasoning.text? | string | The text content of the reasoning process. | src/types/messages.ts:393 |
reasoning.signature? | string | A cryptographic signature for verification purposes. | src/types/messages.ts:398 |
reasoning.redactedContent? | string | The redacted content of the reasoning process. | src/types/messages.ts:403 |
Implementation of
Section titled “Implementation of”JSONSerializable.toJSONfromJSON()
Section titled “fromJSON()”static fromJSON(data): ReasoningBlock;Defined in: src/types/messages.ts:466
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>; }; } | Wrapped ReasoningBlockData to deserialize (accepts both string and Uint8Array for redactedContent) |
data.reasoning | { text?: string; signature?: string; redactedContent?: string | Uint8Array<ArrayBufferLike>; } | - |
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. |
Returns
Section titled “Returns”ReasoningBlock
ReasoningBlock instance