Skip to content

ReasoningBlock

Defined in: src/types/messages.ts:457

Reasoning content block within a message.

new ReasoningBlock(data): ReasoningBlock;

Defined in: src/types/messages.ts:480

| Parameter | Type | | --------- | ---------------------------------------------- | | data | ReasoningBlockData |

ReasoningBlock

readonly type: "reasoningBlock";

Defined in: src/types/messages.ts:463

Discriminator for reasoning content.


readonly optional text?: string;

Defined in: src/types/messages.ts:468

The text content of the reasoning process.

ReasoningBlockData.text


readonly optional signature?: string;

Defined in: src/types/messages.ts:473

A cryptographic signature for verification purposes.

ReasoningBlockData.signature


readonly optional redactedContent?: Uint8Array;

Defined in: src/types/messages.ts:478

The redacted content of the reasoning process.

ReasoningBlockData.redactedContent

toJSON(): {
reasoning: {
text?: string;
signature?: string;
redactedContent?: string;
};
};

Defined in: src/types/messages.ts:497

Serializes the ReasoningBlock to a JSON-compatible ContentBlockData object. Called automatically by JSON.stringify(). Uint8Array redactedContent is encoded as base64 string.

{
reasoning: {
text?: string;
signature?: string;
redactedContent?: string;
};
}

| Name | Type | Description | Defined in | | ---------------------------- | ----------------------------------------------------------------------------- | ---------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | | reasoning | { text?: string; signature?: string; redactedContent?: string; } | - | src/types/messages.ts:497 | | reasoning.text? | string | The text content of the reasoning process. | src/types/messages.ts:441 | | reasoning.signature? | string | A cryptographic signature for verification purposes. | src/types/messages.ts:446 | | reasoning.redactedContent? | string | The redacted content of the reasoning process. | src/types/messages.ts:451 |

JSONSerializable.toJSON

static fromJSON(data): ReasoningBlock;

Defined in: src/types/messages.ts:514

Creates a ReasoningBlock instance from its wrapped data format. Base64-encoded redactedContent is decoded back to Uint8Array.

| 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. |

ReasoningBlock

ReasoningBlock instance