JsonBlock
Defined in: src/types/messages.ts:551
JSON content block within a message. Used for structured data returned from tools or model responses.
Implements
Section titled “Implements”JsonBlockDataJSONSerializable<JsonBlockData>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new JsonBlock(data): JsonBlock;Defined in: src/types/messages.ts:562
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
data | JsonBlockData |
Returns
Section titled “Returns”JsonBlock
Properties
Section titled “Properties”readonly type: "jsonBlock";Defined in: src/types/messages.ts:555
Discriminator for JSON content.
readonly json: JSONValue;Defined in: src/types/messages.ts:560
Structured JSON data.
Implementation of
Section titled “Implementation of”JsonBlockData.jsonMethods
Section titled “Methods”toJSON()
Section titled “toJSON()”toJSON(): JsonBlockData;Defined in: src/types/messages.ts:570
Serializes the JsonBlock to a JSON-compatible JsonBlockData object. Called automatically by JSON.stringify().
Returns
Section titled “Returns”JsonBlockData
Implementation of
Section titled “Implementation of”JSONSerializable.toJSONfromJSON()
Section titled “fromJSON()”static fromJSON(data): JsonBlock;Defined in: src/types/messages.ts:580
Creates a JsonBlock instance from JsonBlockData.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
data | JsonBlockData | JsonBlockData to deserialize |
Returns
Section titled “Returns”JsonBlock
JsonBlock instance