UNPKG

@langchain/core

Version:
1 lines 4.5 kB
{"version":3,"file":"tools.d.cts","names":["BaseContentBlock","Tools","KNOWN_BLOCK_TYPES","TName","TArgs","TOutput","Record","ToolCall","ToolCallChunk","InvalidToolCall","ServerToolCall","ServerToolCallChunk","ServerToolCallResult"],"sources":["../../../src/messages/content/tools.d.ts"],"sourcesContent":["import { BaseContentBlock } from \"./base.js\";\nexport type Tools = never;\nexport declare const KNOWN_BLOCK_TYPES: string[];\nexport declare namespace Tools {\n /**\n * Represents a request to call a tool.\n *\n * @example\n * ```ts\n * const toolCall: ToolCall = {\n * type: \"tool_call\",\n * name: \"foo\",\n * args: { a: 1 },\n * callId: \"123\"\n * };\n * ```\n * This represents a request to call the tool named \"foo\" with arguments {\"a\": 1}\n * and an identifier of \"123\".\n */\n interface ToolCall<TName extends string = string, TArgs = unknown> extends BaseContentBlock {\n /**\n * Type of the content block\n */\n readonly type: \"tool_call\";\n /**\n * The name of the tool being called\n */\n name: TName;\n /**\n * The arguments to the tool call\n */\n args: TArgs;\n }\n /** Content block to represent partial data of a tool call */\n interface ToolCallChunk<TName extends string = string> extends BaseContentBlock {\n /**\n * Type of the content block\n */\n readonly type: \"tool_call_chunk\";\n /**\n * The name of the tool being called\n */\n name?: TName;\n /**\n * The arguments to the tool call\n */\n args?: string;\n /**\n * The index of the tool call chunk\n */\n index?: number;\n }\n /** Content block to represent an invalid tool call */\n interface InvalidToolCall<TName extends string = string> extends BaseContentBlock {\n /**\n * Type of the content block\n */\n readonly type: \"invalid_tool_call\";\n /**\n * The name of the tool being called\n */\n name?: TName;\n /**\n * The arguments to the tool call\n */\n args?: string;\n /**\n * An error message associated with the tool call\n */\n error?: string;\n /**\n * Index of block in aggregate response\n */\n index?: string | number;\n }\n interface ServerToolCall<TName extends string = string, TArgs = unknown> extends BaseContentBlock {\n /**\n * Type of the content block\n */\n readonly type: \"server_tool_call\";\n /**\n * The name of the tool being called\n */\n name: TName;\n /**\n * The arguments to the tool call\n */\n args: TArgs;\n }\n interface ServerToolCallChunk<TName extends string = string> extends BaseContentBlock {\n /**\n * Type of the content block\n */\n readonly type: \"server_tool_call_chunk\";\n /**\n * The name of the tool being called\n */\n name?: TName;\n /**\n * The arguments to the tool call\n */\n args?: string;\n }\n interface ServerToolCallResult<TOutput = Record<string, unknown>> extends BaseContentBlock {\n /**\n * Type of the content block\n */\n readonly type: \"server_tool_call_result\";\n /**\n * The unique identifier of the tool call that this result corresponds to\n */\n toolCallId: string;\n /**\n * The status of the server tool call\n */\n status: \"success\" | \"error\";\n /**\n * The output of the server tool call\n */\n output: TOutput;\n }\n type Standard = ToolCall | ToolCallChunk | InvalidToolCall | ServerToolCall | ServerToolCallChunk | ServerToolCallResult;\n}\n//# sourceMappingURL=tools.d.ts.map"],"mappings":";;;KACYC,KAAAA;AAAAA,kBAEaA,KAAAA,CAFR;EAEQA;;;;;;;;;;;;;;;EAoGqDD,UAAAA,QAAAA,CAAAA,cAAAA,MAAAA,GAAAA,MAAAA,EAAAA,QAAAA,OAAAA,CAAAA,SApFCA,gBAoFDA,CAAAA;IAkB1DO;;;IAA6CG,SAAAA,IAAAA,EAAAA,WAAAA;IAAiBC;;AAA0C;UA9F9GR;;;;UAIAC;;;iEAGqDJ;;;;;;;;WAQpDG;;;;;;;;;;;mEAWsDH;;;;;;;;WAQtDG;;;;;;;;;;;;;;mFAcsEH;;;;;;;;UAQvEG;;;;UAIAC;;uEAE2DJ;;;;;;;;WAQ1DG;;;;;;2CAM8BG,iCAAiCN;;;;;;;;;;;;;;;;YAgB9DK;;kBAEIE,WAAWC,gBAAgBC,kBAAkBC,iBAAiBC,sBAAsBC"}