langchain
Version:
Typescript bindings for langchain
1 lines • 4.52 kB
Source Map (JSON)
{"version":3,"file":"types.d.cts","names":["LanguageModelLike","BaseMessage","SystemMessage","ServerTool","ClientTool","Runtime","AgentBuiltInState","ModelRequest","TState","TContext","Record"],"sources":["../../../src/agents/nodes/types.d.ts"],"sourcesContent":["import type { LanguageModelLike } from \"@langchain/core/language_models/base\";\nimport type { BaseMessage, SystemMessage } from \"@langchain/core/messages\";\nimport type { ServerTool, ClientTool } from \"@langchain/core/tools\";\nimport type { Runtime, AgentBuiltInState } from \"../runtime.js\";\n/**\n * Configuration for modifying a model call at runtime.\n * All fields are optional and only provided fields will override defaults.\n *\n * @template TState - The agent's state type, must extend Record<string, unknown>. Defaults to Record<string, unknown>.\n * @template TContext - The runtime context type for accessing metadata and control flow. Defaults to unknown.\n */\nexport interface ModelRequest<TState extends Record<string, unknown> = Record<string, unknown>, TContext = unknown> {\n /**\n * The model to use for this step.\n */\n model: LanguageModelLike;\n /**\n * The messages to send to the model.\n */\n messages: BaseMessage[];\n /**\n * The system message string for this step.\n *\n * @default \"\"\n * @deprecated Use {@link ModelRequest.systemMessage} instead.\n */\n systemPrompt: string;\n /**\n * The system message for this step. If no `systemPrompt` was provided, when `createAgent`\n * was initialized, an empty system message will be used.\n *\n * @default new SystemMessage(\"\")\n * @example extend system message with a string\n * ```ts\n * wrapModelCall: async (request, handler) => {\n * return handler({\n * ...request,\n * systemMessage: request.systemMessage.concat(\"something\")\n * });\n * }\n * ```\n * @example extend system message with a SystemMessage and cache control\n * ```ts\n * wrapModelCall: async (request, handler) => {\n * return handler({\n * ...request,\n * systemMessage: request.systemMessage.concat(\n * new SystemMessage({\n * content: [{\n * type: \"text\",\n * text: \"something\",\n * cache_control: { type: \"ephemeral\", ttl: \"1m\" }\n * }],\n * })\n * ),\n * });\n * }\n * ```\n */\n systemMessage: SystemMessage;\n /**\n * Tool choice configuration (model-specific format).\n * Can be one of:\n * - `\"auto\"`: means the model can pick between generating a message or calling one or more tools.\n * - `\"none\"`: means the model will not call any tool and instead generates a message.\n * - `\"required\"`: means the model must call one or more tools.\n * - `{ type: \"function\", function: { name: string } }`: The model will use the specified function.\n */\n toolChoice?: \"auto\" | \"none\" | \"required\" | {\n type: \"function\";\n function: {\n name: string;\n };\n };\n /**\n * The tools to make available for this step.\n */\n tools: (ServerTool | ClientTool)[];\n /**\n * The current agent state (includes both middleware state and built-in state).\n */\n state: TState & AgentBuiltInState;\n /**\n * The runtime context containing metadata, signal, writer, interrupt, etc.\n */\n runtime: Runtime<TContext>;\n /**\n * Additional settings to bind to the model when preparing it for invocation.\n * These settings are applied via `bindTools()` and can include parameters like\n * `headers`, `container`, etc. The model is re-bound on each request,\n * so these settings can vary per invocation.\n *\n * @example\n * ```ts\n * modelSettings: {\n * headers: { \"anthropic-beta\": \"code-execution-2025-08-25\" },\n * container: \"container_abc123\"\n * }\n * ```\n */\n modelSettings?: Record<string, unknown>;\n}\n//# sourceMappingURL=types.d.ts.map"],"mappings":";;;;;;;;;AAWA;;;;;AAgDmBE,UAhDFK,YAgDEL,CAAAA,eAhD0BQ,MAgD1BR,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA,GAhDoDQ,MAgDpDR,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA,EAAAA,WAAAA,OAAAA,CAAAA,CAAAA;EAkBPC;;;EAIQG,KAAAA,EAlETN,iBAkESM;EAICG;;;EAeK,QAAA,EAjFZR,WAiFY,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAzCPC;;;;;;;;;;;;;;;;;;UAkBPC,aAAaC;;;;SAIdI,SAASF;;;;WAIPD,QAAQI;;;;;;;;;;;;;;;kBAeDC"}