Citation - TypeScript SDK

Citation type definition

The TypeScript SDK and docs are currently in beta. Report issues on GitHub.

Supported Types

models.AnthropicCitationCharLocationParam

1const value: models.AnthropicCitationCharLocationParam = {
2 citedText: "Example cited text",
3 documentIndex: 0,
4 documentTitle: null,
5 endCharIndex: 18,
6 startCharIndex: 0,
7 type: "char_location",
8};

models.AnthropicCitationContentBlockLocationParam

1const value: models.AnthropicCitationContentBlockLocationParam = {
2 citedText: "Example cited text",
3 documentIndex: 0,
4 documentTitle: null,
5 endBlockIndex: 1,
6 startBlockIndex: 0,
7 type: "content_block_location",
8};

models.AnthropicCitationPageLocationParam

1const value: models.AnthropicCitationPageLocationParam = {
2 citedText: "Example cited text",
3 documentIndex: 0,
4 documentTitle: null,
5 endPageNumber: 2,
6 startPageNumber: 1,
7 type: "page_location",
8};

models.AnthropicCitationSearchResultLocation

1const value: models.AnthropicCitationSearchResultLocation = {
2 citedText: "Example cited text",
3 endBlockIndex: 1,
4 searchResultIndex: 0,
5 source: "example_source",
6 startBlockIndex: 0,
7 title: "Example Result",
8 type: "search_result_location",
9};

models.AnthropicCitationWebSearchResultLocation

1const value: models.AnthropicCitationWebSearchResultLocation = {
2 citedText: "Example cited text",
3 encryptedIndex: "enc_idx_0",
4 title: "Example Page",
5 type: "web_search_result_location",
6 url: "https://example.com",
7};