UNPKG

@langchain/core

Version:
1 lines 4.32 kB
{"version":3,"file":"index.d.cts","names":["BaseContentBlock","Tools","Multimodal","Data","ContentBlock","KNOWN_BLOCK_TYPES","TValue","Citation","Array","Record","Text","Reasoning","NonStandard","Standard"],"sources":["../../../src/messages/content/index.d.ts"],"sourcesContent":["import type { BaseContentBlock } from \"./base.js\";\nimport { type Tools } from \"./tools.js\";\nimport { type Multimodal } from \"./multimodal.js\";\nimport { type Data } from \"./data.js\";\nexport interface ContentBlock extends BaseContentBlock {\n}\nexport declare const KNOWN_BLOCK_TYPES: string[];\nexport declare namespace ContentBlock {\n /**\n * Annotation for citing data from a document.\n */\n export interface Citation {\n /**\n * Type of the content block\n */\n readonly type: \"citation\";\n /**\n * Source type for the citation.\n */\n source?: string;\n /**\n * URL of the document source\n */\n url?: string;\n /**\n * Source document title.\n *\n * For example, the page title for a web page or the title of a paper.\n */\n title?: string;\n /**\n * Start index of the **response text** for which the annotation applies.\n *\n * @see {Text}\n */\n startIndex?: number;\n /**\n * End index of the **response text** for which the annotation applies.\n *\n * @see {Text}\n */\n endIndex?: number;\n /**\n * Excerpt of source text being cited.\n */\n citedText?: string;\n }\n /**\n * Text output from a LLM.\n *\n * This typically represents the main text content of a message, such as the response\n * from a language model or the text of a user message.\n */\n export interface Text extends ContentBlock {\n /**\n * Type of the content block\n */\n readonly type: \"text\";\n /**\n * Block text.\n */\n text: string;\n /**\n * Index of block in aggregate response. Used during streaming.\n */\n index?: number;\n /**\n * Citations and other annotations.\n */\n annotations?: Array<Citation | BaseContentBlock>;\n }\n /**\n * Reasoning output from a LLM.\n */\n export interface Reasoning extends ContentBlock {\n /**\n * Type of the content block\n */\n readonly type: \"reasoning\";\n /**\n * Reasoning text.\n *\n * Either the thought summary or the raw reasoning text itself.\n * This is often parsed from `<think>` tags in the model's response.\n */\n reasoning: string;\n /**\n * Index of block in aggregate response. Used during streaming.\n */\n index?: number;\n }\n /**\n * Provider-specific content block.\n *\n * This is used to represent content blocks that are not part of the standard LangChain content model.\n * If a provider's non-standard output includes reasoning and tool calls, it should be\n * the adapter's job to parse that payload and emit the corresponding standard reasoning and tool call blocks.\n */\n export interface NonStandard<TValue extends Record<string, any> = Record<string, any>> extends ContentBlock {\n /**\n * Type of the content block\n */\n type: \"non_standard\";\n /**\n * Provider-specific data\n */\n value: TValue;\n }\n export { Tools };\n export { Multimodal };\n export { Data };\n export type Standard = Text | Reasoning | NonStandard | Tools.Standard | Multimodal.Standard;\n}\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;UAIiBI,YAAAA,SAAqBJ;AAArBI,cAEIC,iBAFiBL,EAAAA,MAAAA,EAAgB;AAEjCK,kBACID,YAAAA,CADuB;EACvBA;;;EA8DHI,OAAAA,UAAAA,QAAAA,CAAAA;IAhBYJ;;;IA6CoCK,SAAAA,IAAAA,EAAAA,UAAAA;IAQvDH;;;IAGFJ,MAAAA,CAAAA,EAAAA,MAAAA;IACAC;;;IACiCS,GAAAA,CAAAA,EAAAA,MAAAA;IAAoBC;;AAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;gCA1D9DT;;;;;;;;;;;;;;;;kBAgBZI,MAAMD,WAAWP;;;;;qCAKAI;;;;;;;;;;;;;;;;;;;;;;;;8CAwBSK,sBAAsBA,6BAA6BL;;;;;;;;WAQpFE;;WAEFL;WACAC;WACAC;yBACcO,OAAOC,YAAYC,cAAcX,KAAAA,CAAMY,WAAWX,UAAAA,CAAWW"}