CitationsBlock
Defined in: src/types/citations.ts:173
Citations content block within a message. Returned by models when document citations are enabled. This is an output-only block — users do not construct these directly.
Implements
Section titled “Implements”CitationsBlockDataJSONSerializable<{citations:Serialized<CitationsBlockData>; }>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new CitationsBlock(data): CitationsBlock;Defined in: src/types/citations.ts:191
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
data | CitationsBlockData |
Returns
Section titled “Returns”CitationsBlock
Properties
Section titled “Properties”readonly type: "citationsBlock";Defined in: src/types/citations.ts:179
Discriminator for citations content.
citations
Section titled “citations”readonly citations: Citation[];Defined in: src/types/citations.ts:184
Array of citations linking generated content to source locations.
Implementation of
Section titled “Implementation of”content
Section titled “content”readonly content: CitationGeneratedContent[];Defined in: src/types/citations.ts:189
The generated content associated with these citations.
Implementation of
Section titled “Implementation of”Methods
Section titled “Methods”toJSON()
Section titled “toJSON()”toJSON(): { citations: { citations: { location: | { type: "documentChar"; documentIndex: number; start: number; end: number; } | { type: "documentPage"; documentIndex: number; start: number; end: number; } | { type: "documentChunk"; documentIndex: number; start: number; end: number; } | { type: "searchResult"; searchResultIndex: number; start: number; end: number; } | { type: "web"; url: string; domain?: string; }; source: string; sourceContent: { text: string; }[]; title: string; }[]; content: { text: string; }[]; };};Defined in: src/types/citations.ts:200
Serializes the CitationsBlock to a JSON-compatible ContentBlockData object. Called automatically by JSON.stringify().
Returns
Section titled “Returns”{ citations: { citations: { location: | { type: "documentChar"; documentIndex: number; start: number; end: number; } | { type: "documentPage"; documentIndex: number; start: number; end: number; } | { type: "documentChunk"; documentIndex: number; start: number; end: number; } | { type: "searchResult"; searchResultIndex: number; start: number; end: number; } | { type: "web"; url: string; domain?: string; }; source: string; sourceContent: { text: string; }[]; title: string; }[]; content: { text: string; }[]; };}| Name | Type | Description | Defined in |
|---|---|---|---|
citations | { citations: { location: | { type: "documentChar"; documentIndex: number; start: number; end: number; } | { type: "documentPage"; documentIndex: number; start: number; end: number; } | { type: "documentChunk"; documentIndex: number; start: number; end: number; } | { type: "searchResult"; searchResultIndex: number; start: number; end: number; } | { type: "web"; url: string; domain?: string; }; source: string; sourceContent: { text: string; }[]; title: string; }[]; content: { text: string; }[]; } | - | src/types/citations.ts:200 |
citations.citations | { location: | { type: "documentChar"; documentIndex: number; start: number; end: number; } | { type: "documentPage"; documentIndex: number; start: number; end: number; } | { type: "documentChunk"; documentIndex: number; start: number; end: number; } | { type: "searchResult"; searchResultIndex: number; start: number; end: number; } | { type: "web"; url: string; domain?: string; }; source: string; sourceContent: { text: string; }[]; title: string; }[] | Array of citations linking generated content to source locations. | src/types/citations.ts:160 |
citations.content | { text: string; }[] | The generated content associated with these citations. | src/types/citations.ts:165 |
Implementation of
Section titled “Implementation of”JSONSerializable.toJSONfromJSON()
Section titled “fromJSON()”static fromJSON(data): CitationsBlock;Defined in: src/types/citations.ts:215
Creates a CitationsBlock instance from its wrapped data format.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
data | { citations: { citations: { location: | { type: "documentChar"; documentIndex: number; start: number; end: number; } | { type: "documentPage"; documentIndex: number; start: number; end: number; } | { type: "documentChunk"; documentIndex: number; start: number; end: number; } | { type: "searchResult"; searchResultIndex: number; start: number; end: number; } | { type: "web"; url: string; domain?: string; }; source: string; sourceContent: { text: string; }[]; title: string; }[]; content: { text: string; }[]; }; } | Wrapped CitationsBlockData to deserialize |
data.citations | { citations: { location: | { type: "documentChar"; documentIndex: number; start: number; end: number; } | { type: "documentPage"; documentIndex: number; start: number; end: number; } | { type: "documentChunk"; documentIndex: number; start: number; end: number; } | { type: "searchResult"; searchResultIndex: number; start: number; end: number; } | { type: "web"; url: string; domain?: string; }; source: string; sourceContent: { text: string; }[]; title: string; }[]; content: { text: string; }[]; } | - |
data.citations.citations | { location: | { type: "documentChar"; documentIndex: number; start: number; end: number; } | { type: "documentPage"; documentIndex: number; start: number; end: number; } | { type: "documentChunk"; documentIndex: number; start: number; end: number; } | { type: "searchResult"; searchResultIndex: number; start: number; end: number; } | { type: "web"; url: string; domain?: string; }; source: string; sourceContent: { text: string; }[]; title: string; }[] | Array of citations linking generated content to source locations. |
data.citations.content | { text: string; }[] | The generated content associated with these citations. |
Returns
Section titled “Returns”CitationsBlock
CitationsBlock instance