langchain 1.0.5 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/README.md +1 -1
- package/chat_models/universal.cjs +1 -0
- package/chat_models/universal.d.cts +1 -0
- package/chat_models/universal.d.ts +1 -0
- package/chat_models/universal.js +1 -0
- package/dist/agents/ReactAgent.cjs +43 -39
- package/dist/agents/ReactAgent.cjs.map +1 -1
- package/dist/agents/ReactAgent.js +46 -42
- package/dist/agents/ReactAgent.js.map +1 -1
- package/dist/agents/index.d.cts +0 -2
- package/dist/agents/index.d.ts +0 -2
- package/dist/agents/middleware/constants.cjs +16 -0
- package/dist/agents/middleware/constants.cjs.map +1 -0
- package/dist/agents/middleware/constants.js +15 -0
- package/dist/agents/middleware/constants.js.map +1 -0
- package/dist/agents/middleware/contextEditing.cjs.map +1 -1
- package/dist/agents/middleware/contextEditing.d.cts +23 -7
- package/dist/agents/middleware/contextEditing.d.ts +23 -7
- package/dist/agents/middleware/contextEditing.js.map +1 -1
- package/dist/agents/middleware/dynamicSystemPrompt.cjs +5 -2
- package/dist/agents/middleware/dynamicSystemPrompt.cjs.map +1 -1
- package/dist/agents/middleware/dynamicSystemPrompt.d.cts +2 -1
- package/dist/agents/middleware/dynamicSystemPrompt.d.ts +2 -1
- package/dist/agents/middleware/dynamicSystemPrompt.js +4 -2
- package/dist/agents/middleware/dynamicSystemPrompt.js.map +1 -1
- package/dist/agents/middleware/error.cjs +20 -0
- package/dist/agents/middleware/error.cjs.map +1 -0
- package/dist/agents/middleware/error.js +19 -0
- package/dist/agents/middleware/error.js.map +1 -0
- package/dist/agents/middleware/index.cjs +4 -2
- package/dist/agents/middleware/index.d.ts +18 -0
- package/dist/agents/middleware/index.js +4 -2
- package/dist/agents/middleware/modelRetry.cjs +162 -0
- package/dist/agents/middleware/modelRetry.cjs.map +1 -0
- package/dist/agents/middleware/modelRetry.d.cts +134 -0
- package/dist/agents/middleware/modelRetry.d.ts +134 -0
- package/dist/agents/middleware/modelRetry.js +161 -0
- package/dist/agents/middleware/modelRetry.js.map +1 -0
- package/dist/agents/middleware/{promptCaching.cjs → provider/anthropic/promptCaching.cjs} +3 -3
- package/dist/agents/middleware/provider/anthropic/promptCaching.cjs.map +1 -0
- package/dist/agents/middleware/{promptCaching.d.cts → provider/anthropic/promptCaching.d.cts} +2 -2
- package/dist/agents/middleware/{promptCaching.d.ts → provider/anthropic/promptCaching.d.ts} +2 -2
- package/dist/agents/middleware/{promptCaching.js → provider/anthropic/promptCaching.js} +2 -2
- package/dist/agents/middleware/provider/anthropic/promptCaching.js.map +1 -0
- package/dist/agents/middleware/provider/openai/moderation.cjs +299 -0
- package/dist/agents/middleware/provider/openai/moderation.cjs.map +1 -0
- package/dist/agents/middleware/provider/openai/moderation.d.cts +133 -0
- package/dist/agents/middleware/provider/openai/moderation.d.ts +133 -0
- package/dist/agents/middleware/provider/openai/moderation.js +298 -0
- package/dist/agents/middleware/provider/openai/moderation.js.map +1 -0
- package/dist/agents/middleware/summarization.d.cts +0 -4
- package/dist/agents/middleware/summarization.d.ts +0 -4
- package/dist/agents/middleware/todoListMiddleware.cjs +1 -1
- package/dist/agents/middleware/todoListMiddleware.cjs.map +1 -1
- package/dist/agents/middleware/todoListMiddleware.js +1 -1
- package/dist/agents/middleware/todoListMiddleware.js.map +1 -1
- package/dist/agents/middleware/toolRetry.cjs +32 -44
- package/dist/agents/middleware/toolRetry.cjs.map +1 -1
- package/dist/agents/middleware/toolRetry.d.cts +16 -36
- package/dist/agents/middleware/toolRetry.d.ts +16 -36
- package/dist/agents/middleware/toolRetry.js +32 -44
- package/dist/agents/middleware/toolRetry.js.map +1 -1
- package/dist/agents/middleware/types.d.cts +9 -10
- package/dist/agents/middleware/types.d.ts +9 -10
- package/dist/agents/middleware/utils.cjs +23 -0
- package/dist/agents/middleware/utils.cjs.map +1 -1
- package/dist/agents/middleware/utils.d.ts +2 -0
- package/dist/agents/middleware/utils.js +23 -1
- package/dist/agents/middleware/utils.js.map +1 -1
- package/dist/agents/nodes/AgentNode.cjs +72 -28
- package/dist/agents/nodes/AgentNode.cjs.map +1 -1
- package/dist/agents/nodes/AgentNode.js +74 -31
- package/dist/agents/nodes/AgentNode.js.map +1 -1
- package/dist/agents/nodes/ToolNode.cjs +5 -0
- package/dist/agents/nodes/ToolNode.cjs.map +1 -1
- package/dist/agents/nodes/ToolNode.js +5 -1
- package/dist/agents/nodes/ToolNode.js.map +1 -1
- package/dist/agents/nodes/types.d.cts +39 -3
- package/dist/agents/nodes/types.d.ts +39 -3
- package/dist/agents/responses.cjs.map +1 -1
- package/dist/agents/responses.d.cts +2 -19
- package/dist/agents/responses.d.ts +2 -19
- package/dist/agents/responses.js.map +1 -1
- package/dist/agents/runtime.d.ts +1 -0
- package/dist/agents/tests/utils.cjs +10 -1
- package/dist/agents/tests/utils.cjs.map +1 -1
- package/dist/agents/tests/utils.js +10 -1
- package/dist/agents/tests/utils.js.map +1 -1
- package/dist/agents/types.d.cts +68 -2
- package/dist/agents/types.d.ts +68 -2
- package/dist/agents/utils.cjs +15 -12
- package/dist/agents/utils.cjs.map +1 -1
- package/dist/agents/utils.js +16 -13
- package/dist/agents/utils.js.map +1 -1
- package/dist/chat_models/universal.cjs +50 -16
- package/dist/chat_models/universal.cjs.map +1 -1
- package/dist/chat_models/universal.d.cts +19 -1
- package/dist/chat_models/universal.d.ts +19 -1
- package/dist/chat_models/universal.js +50 -16
- package/dist/chat_models/universal.js.map +1 -1
- package/dist/index.cjs +8 -2
- package/dist/index.d.cts +5 -3
- package/dist/index.d.ts +6 -3
- package/dist/index.js +7 -3
- package/dist/load/import_constants.cjs +2 -1
- package/dist/load/import_constants.cjs.map +1 -1
- package/dist/load/import_constants.js +2 -1
- package/dist/load/import_constants.js.map +1 -1
- package/dist/load/import_map.cjs +2 -19
- package/dist/load/import_map.cjs.map +1 -1
- package/dist/load/import_map.js +2 -19
- package/dist/load/import_map.js.map +1 -1
- package/hub/node.cjs +1 -0
- package/hub/node.d.cts +1 -0
- package/hub/node.d.ts +1 -0
- package/hub/node.js +1 -0
- package/hub.cjs +1 -0
- package/hub.d.cts +1 -0
- package/hub.d.ts +1 -0
- package/hub.js +1 -0
- package/load/serializable.cjs +1 -0
- package/load/serializable.d.cts +1 -0
- package/load/serializable.d.ts +1 -0
- package/load/serializable.js +1 -0
- package/load.cjs +1 -0
- package/load.d.cts +1 -0
- package/load.d.ts +1 -0
- package/load.js +1 -0
- package/package.json +65 -52
- package/storage/encoder_backed.cjs +1 -0
- package/storage/encoder_backed.d.cts +1 -0
- package/storage/encoder_backed.d.ts +1 -0
- package/storage/encoder_backed.js +1 -0
- package/storage/file_system.cjs +1 -0
- package/storage/file_system.d.cts +1 -0
- package/storage/file_system.d.ts +1 -0
- package/storage/file_system.js +1 -0
- package/storage/in_memory.cjs +1 -0
- package/storage/in_memory.d.cts +1 -0
- package/storage/in_memory.d.ts +1 -0
- package/storage/in_memory.js +1 -0
- package/dist/agents/ReactAgent.d.cts.map +0 -1
- package/dist/agents/ReactAgent.d.ts.map +0 -1
- package/dist/agents/constants.cjs +0 -7
- package/dist/agents/constants.cjs.map +0 -1
- package/dist/agents/constants.d.cts.map +0 -1
- package/dist/agents/constants.d.ts.map +0 -1
- package/dist/agents/constants.js +0 -6
- package/dist/agents/constants.js.map +0 -1
- package/dist/agents/errors.d.cts.map +0 -1
- package/dist/agents/errors.d.ts.map +0 -1
- package/dist/agents/index.d.cts.map +0 -1
- package/dist/agents/index.d.ts.map +0 -1
- package/dist/agents/middleware/contextEditing.d.cts.map +0 -1
- package/dist/agents/middleware/contextEditing.d.ts.map +0 -1
- package/dist/agents/middleware/dynamicSystemPrompt.d.cts.map +0 -1
- package/dist/agents/middleware/dynamicSystemPrompt.d.ts.map +0 -1
- package/dist/agents/middleware/hitl.d.cts.map +0 -1
- package/dist/agents/middleware/hitl.d.ts.map +0 -1
- package/dist/agents/middleware/llmToolSelector.d.cts.map +0 -1
- package/dist/agents/middleware/llmToolSelector.d.ts.map +0 -1
- package/dist/agents/middleware/modelCallLimit.d.cts.map +0 -1
- package/dist/agents/middleware/modelCallLimit.d.ts.map +0 -1
- package/dist/agents/middleware/modelFallback.d.cts.map +0 -1
- package/dist/agents/middleware/modelFallback.d.ts.map +0 -1
- package/dist/agents/middleware/pii.d.cts.map +0 -1
- package/dist/agents/middleware/pii.d.ts.map +0 -1
- package/dist/agents/middleware/piiRedaction.d.cts.map +0 -1
- package/dist/agents/middleware/piiRedaction.d.ts.map +0 -1
- package/dist/agents/middleware/promptCaching.cjs.map +0 -1
- package/dist/agents/middleware/promptCaching.d.cts.map +0 -1
- package/dist/agents/middleware/promptCaching.d.ts.map +0 -1
- package/dist/agents/middleware/promptCaching.js.map +0 -1
- package/dist/agents/middleware/summarization.d.cts.map +0 -1
- package/dist/agents/middleware/summarization.d.ts.map +0 -1
- package/dist/agents/middleware/todoListMiddleware.d.cts.map +0 -1
- package/dist/agents/middleware/todoListMiddleware.d.ts.map +0 -1
- package/dist/agents/middleware/toolCallLimit.d.cts.map +0 -1
- package/dist/agents/middleware/toolCallLimit.d.ts.map +0 -1
- package/dist/agents/middleware/toolEmulator.d.cts.map +0 -1
- package/dist/agents/middleware/toolEmulator.d.ts.map +0 -1
- package/dist/agents/middleware/toolRetry.d.cts.map +0 -1
- package/dist/agents/middleware/toolRetry.d.ts.map +0 -1
- package/dist/agents/middleware/types.d.cts.map +0 -1
- package/dist/agents/middleware/types.d.ts.map +0 -1
- package/dist/agents/middleware/utils.d.cts.map +0 -1
- package/dist/agents/middleware/utils.d.ts.map +0 -1
- package/dist/agents/middleware.d.cts.map +0 -1
- package/dist/agents/middleware.d.ts.map +0 -1
- package/dist/agents/nodes/types.d.cts.map +0 -1
- package/dist/agents/nodes/types.d.ts.map +0 -1
- package/dist/agents/responses.d.cts.map +0 -1
- package/dist/agents/responses.d.ts.map +0 -1
- package/dist/agents/runtime.d.cts.map +0 -1
- package/dist/agents/runtime.d.ts.map +0 -1
- package/dist/agents/tests/utils.d.cts.map +0 -1
- package/dist/agents/tests/utils.d.ts.map +0 -1
- package/dist/agents/types.d.cts.map +0 -1
- package/dist/agents/types.d.ts.map +0 -1
- package/dist/chat_models/universal.d.cts.map +0 -1
- package/dist/chat_models/universal.d.ts.map +0 -1
- package/dist/hub/base.d.cts.map +0 -1
- package/dist/hub/base.d.ts.map +0 -1
- package/dist/hub/index.d.cts.map +0 -1
- package/dist/hub/index.d.ts.map +0 -1
- package/dist/hub/node.d.cts.map +0 -1
- package/dist/hub/node.d.ts.map +0 -1
- package/dist/load/import_type.d.cts.map +0 -1
- package/dist/load/import_type.d.ts.map +0 -1
- package/dist/load/index.d.cts.map +0 -1
- package/dist/load/index.d.ts.map +0 -1
- package/dist/storage/encoder_backed.d.cts.map +0 -1
- package/dist/storage/encoder_backed.d.ts.map +0 -1
- package/dist/storage/file_system.d.cts.map +0 -1
- package/dist/storage/file_system.d.ts.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":["LanguageModelLike","BaseMessage","ServerTool","ClientTool","Runtime","AgentBuiltInState","ModelRequest","Record","TState","TContext"],"sources":["../../../src/agents/nodes/types.d.ts"],"sourcesContent":["import type { LanguageModelLike } from \"@langchain/core/language_models/base\";\nimport type { BaseMessage } 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 for this step.\n */\n systemPrompt?: string;\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"],"mappings":";;;;;;;;;AAWA;;;;;AAQcC,UARGK,YAQHL,CAAAA,eAR+BM,MAQ/BN,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA,GARyDM,MAQzDN,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA,EAAAA,WAAAA,OAAAA,CAAAA,CAAAA;EAAW;;;EA0BR,KAAGI,EA9BTL,iBA8BSK;EAAiB;;;EAmBX,QAAA,EA7CZJ,WA6CY,EAAA;;;;;;;;;;;;;;;;;;;;;;UAvBdC,aAAaC;;;;SAIdK,SAASH;;;;WAIPD,QAAQK;;;;;;;;;;;;;;;kBAeDF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"responses.d.cts","names":["InteropZodObject","InteropZodType","AIMessage","LanguageModelLike","FunctionDefinition","StructuredOutputParsingError","MultipleStructuredOutputsError","ResponseFormatUndefined","ToolStrategy","Record","ToolStrategyOptions","S","U","ProviderStrategy","T","ResponseFormat","transformResponseFormat","JsonSchemaFormat","TypedToolStrategy","Array","ToolStrategyError","Promise","toolStrategy","K","providerStrategy","hasSupportForJsonSchemaOutput"],"sources":["../../src/agents/responses.d.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable no-instanceof/no-instanceof */\nimport { InteropZodObject, InteropZodType } from \"@langchain/core/utils/types\";\nimport { type AIMessage } from \"@langchain/core/messages\";\nimport { type LanguageModelLike } from \"@langchain/core/language_models/base\";\nimport { type FunctionDefinition } from \"@langchain/core/language_models/base\";\nimport { StructuredOutputParsingError, MultipleStructuredOutputsError } from \"./errors.js\";\n/**\n * Special type to indicate that no response format is provided.\n * When this type is used, the structuredResponse property should not be present in the result.\n */\nexport type ResponseFormatUndefined = {\n __responseFormatUndefined: true;\n};\n/**\n * Information for tracking structured output tool metadata.\n * This contains all necessary information to handle structured responses generated\n * via tool calls, including the original schema, its type classification, and the\n * corresponding tool implementation used by the tools strategy.\n */\nexport declare class ToolStrategy<_T = unknown> {\n readonly schema: Record<string, unknown>;\n readonly tool: {\n type: \"function\";\n function: FunctionDefinition;\n };\n readonly options?: ToolStrategyOptions | undefined;\n private constructor();\n get name(): string;\n static fromSchema<S extends InteropZodObject>(schema: S, outputOptions?: ToolStrategyOptions): ToolStrategy<S extends InteropZodType<infer U> ? U : unknown>;\n static fromSchema(schema: Record<string, unknown>, outputOptions?: ToolStrategyOptions): ToolStrategy<Record<string, unknown>>;\n /**\n * Parse tool arguments according to the schema.\n *\n * @throws {StructuredOutputParsingError} if the response is not valid\n * @param toolArgs - The arguments from the tool call\n * @returns The parsed response according to the schema type\n */\n parse(toolArgs: Record<string, unknown>): Record<string, unknown>;\n}\nexport declare class ProviderStrategy<T = unknown> {\n readonly schema: Record<string, unknown>;\n // @ts-expect-error - _schemaType is used only for type inference\n private _schemaType?;\n private constructor();\n static fromSchema<T>(schema: InteropZodType<T>): ProviderStrategy<T>;\n static fromSchema(schema: Record<string, unknown>): ProviderStrategy<Record<string, unknown>>;\n /**\n * Parse tool arguments according to the schema. If the response is not valid, return undefined.\n *\n * @param toolArgs - The arguments from the tool call\n * @returns The parsed response according to the schema type\n */\n parse(response: AIMessage): any;\n}\nexport type ResponseFormat = ToolStrategy<any> | ProviderStrategy<any>;\n/**\n * Handle user input for `responseFormat` parameter of `CreateAgentParams`.\n * This function defines the default behavior for the `responseFormat` parameter, which is:\n *\n * - if value is a Zod schema, default to structured output via tool calling\n * - if value is a JSON schema, default to structured output via tool calling\n * - if value is a custom response format, return it as is\n * - if value is an array, ensure all array elements are instance of `ToolStrategy`\n * @param responseFormat - The response format to transform, provided by the user\n * @param options - The response format options for tool strategy\n * @param model - The model to check if it supports JSON schema output\n * @returns\n */\nexport declare function transformResponseFormat(responseFormat?: InteropZodType<any> | InteropZodType<any>[] | JsonSchemaFormat | JsonSchemaFormat[] | ResponseFormat | ToolStrategy<any>[] | ResponseFormatUndefined, options?: ToolStrategyOptions, model?: LanguageModelLike | string): ResponseFormat[];\n/**\n * Branded type for ToolStrategy arrays that preserves type information\n */\nexport interface TypedToolStrategy<T = unknown> extends Array<ToolStrategy<any>> {\n _schemaType?: T;\n}\nexport type ToolStrategyError = StructuredOutputParsingError | MultipleStructuredOutputsError;\nexport interface ToolStrategyOptions {\n /**\n * Allows you to customize the message that appears in the conversation history when structured\n * output is generated.\n */\n toolMessageContent?: string;\n /**\n * Handle errors from the structured output tool call. Using tools to generate structured output\n * can cause errors, e.g. if:\n * - you provide multiple structured output schemas and the model calls multiple structured output tools\n * - if the structured output generated by the tool call doesn't match provided schema\n *\n * This property allows to handle these errors in different ways:\n * - `true` - retry the tool call\n * - `false` - throw an error\n * - `string` - retry the tool call with the provided message\n * - `(error: ToolStrategyError) => Promise<string> | string` - retry with the provided message or throw the error\n */\n handleError?: boolean | string | ((error: ToolStrategyError) => Promise<string> | string);\n}\nexport declare function toolStrategy<T extends InteropZodType<any>>(responseFormat: T, options?: ToolStrategyOptions): TypedToolStrategy<T extends InteropZodType<infer U> ? U : never>;\nexport declare function toolStrategy<T extends readonly InteropZodType<any>[]>(responseFormat: T, options?: ToolStrategyOptions): TypedToolStrategy<{\n [K in keyof T]: T[K] extends InteropZodType<infer U> ? U : never;\n}[number]>;\nexport declare function toolStrategy(responseFormat: JsonSchemaFormat, options?: ToolStrategyOptions): TypedToolStrategy<Record<string, unknown>>;\nexport declare function toolStrategy(responseFormat: JsonSchemaFormat[], options?: ToolStrategyOptions): TypedToolStrategy<Record<string, unknown>>;\nexport declare function providerStrategy<T extends InteropZodType<any>>(responseFormat: T): ProviderStrategy<T extends InteropZodType<infer U> ? U : never>;\nexport declare function providerStrategy(responseFormat: JsonSchemaFormat): ProviderStrategy<Record<string, unknown>>;\n/**\n * Type representing a JSON Schema object format.\n * This is a strict type that excludes ToolStrategy and ProviderStrategy instances.\n */\nexport type JsonSchemaFormat = {\n type: \"null\" | \"boolean\" | \"object\" | \"array\" | \"number\" | \"string\" | \"integer\";\n properties?: Record<string, unknown>;\n required?: string[];\n additionalProperties?: boolean;\n [key: string]: unknown;\n} & {\n // Brand to ensure this is not a ToolStrategy or ProviderStrategy\n __brand?: never;\n};\n/**\n * Identifies the models that support JSON schema output\n * @param model - The model to check\n * @returns True if the model supports JSON schema output, false otherwise\n */\nexport declare function hasSupportForJsonSchemaOutput(model?: LanguageModelLike | string): boolean;\n"],"mappings":";;;;;;;AAoBA;;;;AAMuBU,KAfXH,uBAAAA,GAeWG;EAAmB,yBAGVV,EAAAA,IAAAA;CAAgB;;;;;;;AACuBU,cAVlDF,YAUkDE,CAAAA,KAAAA,OAAAA,CAAAA,CAAAA;EAAmB,SAAgBD,MAAAA,EATrFA,MASqFA,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA;EAAM,SAAnBD,IAAAA,EAAAA;IAQzEC,IAAAA,EAAAA,UAAAA;IAA0BA,QAAAA,EAd5BL,kBAc4BK;EAAM,CAAA;EAE/BI,SAAAA,OAAAA,CAAAA,EAdEH,mBAcc,GAA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FA,CAIyFA,CAJvFS,CAIuFT,CAAAA,SAJ5Eb,cAI4Ea,CAAAA,KAAAA,EAAAA,CAAAA,GAJlDF,CAIkDE,GAAAA,KAAAA,EAAC,CAAA,MAASb,CAAAA,CAAAA;AAA0BW,iBAFzHU,YAAAA,CAEyHV,cAAAA,EAF5FK,gBAE4FL,EAAAA,OAAAA,CAAAA,EAFhEF,mBAEgEE,CAAAA,EAF1CM,iBAE0CN,CAFxBH,MAEwBG,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA,CAAAA;AAArDC,iBADpES,YAAAA,CACoET,cAAAA,EADvCI,gBACuCJ,EAAAA,EAAAA,OAAAA,CAAAA,EADTH,mBACSG,CAAAA,EADaK,iBACbL,CAD+BJ,MAC/BI,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA,CAAAA;AAAgB,iBAApFW,gBAAoF,CAAA,UAAzDvB,cAAyD,CAAA,GAAA,CAAA,CAAA,CAAA,cAAA,EAApBa,CAAoB,CAAA,EAAhBD,gBAAgB,CAACC,CAAD,SAAWb,cAAX,CAAA,KAAA,EAAA,CAAA,GAAqCW,CAArC,GAAA,KAAA,CAAA;AACpFY,iBAAAA,gBAAAA,CAAgB,cAAA,EAAiBP,gBAAjB,CAAA,EAAoCJ,gBAApC,CAAqDJ,MAArD,CAAA,MAAA,EAAA,OAAA,CAAA,CAAA;;;;;AAAoD,KAKhFQ,gBAAAA,GALgF;EAKhFA,IAAAA,EAAAA,MAAAA,GAAAA,SAAgB,GAAA,QAEXR,GAAM,OAAA,GAAA,QAAA,GAAA,QAAA,GAAA,SAAA;eAANA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"responses.d.ts","names":["InteropZodObject","InteropZodType","AIMessage","LanguageModelLike","FunctionDefinition","StructuredOutputParsingError","MultipleStructuredOutputsError","ResponseFormatUndefined","ToolStrategy","Record","ToolStrategyOptions","S","U","ProviderStrategy","T","ResponseFormat","transformResponseFormat","JsonSchemaFormat","TypedToolStrategy","Array","ToolStrategyError","Promise","toolStrategy","K","providerStrategy","hasSupportForJsonSchemaOutput"],"sources":["../../src/agents/responses.d.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable no-instanceof/no-instanceof */\nimport { InteropZodObject, InteropZodType } from \"@langchain/core/utils/types\";\nimport { type AIMessage } from \"@langchain/core/messages\";\nimport { type LanguageModelLike } from \"@langchain/core/language_models/base\";\nimport { type FunctionDefinition } from \"@langchain/core/language_models/base\";\nimport { StructuredOutputParsingError, MultipleStructuredOutputsError } from \"./errors.js\";\n/**\n * Special type to indicate that no response format is provided.\n * When this type is used, the structuredResponse property should not be present in the result.\n */\nexport type ResponseFormatUndefined = {\n __responseFormatUndefined: true;\n};\n/**\n * Information for tracking structured output tool metadata.\n * This contains all necessary information to handle structured responses generated\n * via tool calls, including the original schema, its type classification, and the\n * corresponding tool implementation used by the tools strategy.\n */\nexport declare class ToolStrategy<_T = unknown> {\n readonly schema: Record<string, unknown>;\n readonly tool: {\n type: \"function\";\n function: FunctionDefinition;\n };\n readonly options?: ToolStrategyOptions | undefined;\n private constructor();\n get name(): string;\n static fromSchema<S extends InteropZodObject>(schema: S, outputOptions?: ToolStrategyOptions): ToolStrategy<S extends InteropZodType<infer U> ? U : unknown>;\n static fromSchema(schema: Record<string, unknown>, outputOptions?: ToolStrategyOptions): ToolStrategy<Record<string, unknown>>;\n /**\n * Parse tool arguments according to the schema.\n *\n * @throws {StructuredOutputParsingError} if the response is not valid\n * @param toolArgs - The arguments from the tool call\n * @returns The parsed response according to the schema type\n */\n parse(toolArgs: Record<string, unknown>): Record<string, unknown>;\n}\nexport declare class ProviderStrategy<T = unknown> {\n readonly schema: Record<string, unknown>;\n // @ts-expect-error - _schemaType is used only for type inference\n private _schemaType?;\n private constructor();\n static fromSchema<T>(schema: InteropZodType<T>): ProviderStrategy<T>;\n static fromSchema(schema: Record<string, unknown>): ProviderStrategy<Record<string, unknown>>;\n /**\n * Parse tool arguments according to the schema. If the response is not valid, return undefined.\n *\n * @param toolArgs - The arguments from the tool call\n * @returns The parsed response according to the schema type\n */\n parse(response: AIMessage): any;\n}\nexport type ResponseFormat = ToolStrategy<any> | ProviderStrategy<any>;\n/**\n * Handle user input for `responseFormat` parameter of `CreateAgentParams`.\n * This function defines the default behavior for the `responseFormat` parameter, which is:\n *\n * - if value is a Zod schema, default to structured output via tool calling\n * - if value is a JSON schema, default to structured output via tool calling\n * - if value is a custom response format, return it as is\n * - if value is an array, ensure all array elements are instance of `ToolStrategy`\n * @param responseFormat - The response format to transform, provided by the user\n * @param options - The response format options for tool strategy\n * @param model - The model to check if it supports JSON schema output\n * @returns\n */\nexport declare function transformResponseFormat(responseFormat?: InteropZodType<any> | InteropZodType<any>[] | JsonSchemaFormat | JsonSchemaFormat[] | ResponseFormat | ToolStrategy<any>[] | ResponseFormatUndefined, options?: ToolStrategyOptions, model?: LanguageModelLike | string): ResponseFormat[];\n/**\n * Branded type for ToolStrategy arrays that preserves type information\n */\nexport interface TypedToolStrategy<T = unknown> extends Array<ToolStrategy<any>> {\n _schemaType?: T;\n}\nexport type ToolStrategyError = StructuredOutputParsingError | MultipleStructuredOutputsError;\nexport interface ToolStrategyOptions {\n /**\n * Allows you to customize the message that appears in the conversation history when structured\n * output is generated.\n */\n toolMessageContent?: string;\n /**\n * Handle errors from the structured output tool call. Using tools to generate structured output\n * can cause errors, e.g. if:\n * - you provide multiple structured output schemas and the model calls multiple structured output tools\n * - if the structured output generated by the tool call doesn't match provided schema\n *\n * This property allows to handle these errors in different ways:\n * - `true` - retry the tool call\n * - `false` - throw an error\n * - `string` - retry the tool call with the provided message\n * - `(error: ToolStrategyError) => Promise<string> | string` - retry with the provided message or throw the error\n */\n handleError?: boolean | string | ((error: ToolStrategyError) => Promise<string> | string);\n}\nexport declare function toolStrategy<T extends InteropZodType<any>>(responseFormat: T, options?: ToolStrategyOptions): TypedToolStrategy<T extends InteropZodType<infer U> ? U : never>;\nexport declare function toolStrategy<T extends readonly InteropZodType<any>[]>(responseFormat: T, options?: ToolStrategyOptions): TypedToolStrategy<{\n [K in keyof T]: T[K] extends InteropZodType<infer U> ? U : never;\n}[number]>;\nexport declare function toolStrategy(responseFormat: JsonSchemaFormat, options?: ToolStrategyOptions): TypedToolStrategy<Record<string, unknown>>;\nexport declare function toolStrategy(responseFormat: JsonSchemaFormat[], options?: ToolStrategyOptions): TypedToolStrategy<Record<string, unknown>>;\nexport declare function providerStrategy<T extends InteropZodType<any>>(responseFormat: T): ProviderStrategy<T extends InteropZodType<infer U> ? U : never>;\nexport declare function providerStrategy(responseFormat: JsonSchemaFormat): ProviderStrategy<Record<string, unknown>>;\n/**\n * Type representing a JSON Schema object format.\n * This is a strict type that excludes ToolStrategy and ProviderStrategy instances.\n */\nexport type JsonSchemaFormat = {\n type: \"null\" | \"boolean\" | \"object\" | \"array\" | \"number\" | \"string\" | \"integer\";\n properties?: Record<string, unknown>;\n required?: string[];\n additionalProperties?: boolean;\n [key: string]: unknown;\n} & {\n // Brand to ensure this is not a ToolStrategy or ProviderStrategy\n __brand?: never;\n};\n/**\n * Identifies the models that support JSON schema output\n * @param model - The model to check\n * @returns True if the model supports JSON schema output, false otherwise\n */\nexport declare function hasSupportForJsonSchemaOutput(model?: LanguageModelLike | string): boolean;\n"],"mappings":";;;;;;;AAoBA;;;;AAMuBU,KAfXH,uBAAAA,GAeWG;EAAmB,yBAGVV,EAAAA,IAAAA;CAAgB;;;;;;;AACuBU,cAVlDF,YAUkDE,CAAAA,KAAAA,OAAAA,CAAAA,CAAAA;EAAmB,SAAgBD,MAAAA,EATrFA,MASqFA,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA;EAAM,SAAnBD,IAAAA,EAAAA;IAQzEC,IAAAA,EAAAA,UAAAA;IAA0BA,QAAAA,EAd5BL,kBAc4BK;EAAM,CAAA;EAE/BI,SAAAA,OAAAA,CAAAA,EAdEH,mBAcc,GAAA,SAAA;EAAA,QAAA,WAAA,CAAA;EAAA,IAChBD,IAAA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4Ea,CAAAA,KAAAA,EAAAA,CAAAA,GAJlDF,CAIkDE,GAAAA,KAAAA,EAAC,CAAA,MAASb,CAAAA,CAAAA;AAA0BW,iBAFzHU,YAAAA,CAEyHV,cAAAA,EAF5FK,gBAE4FL,EAAAA,OAAAA,CAAAA,EAFhEF,mBAEgEE,CAAAA,EAF1CM,iBAE0CN,CAFxBH,MAEwBG,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA,CAAAA;AAArDC,iBADpES,YAAAA,CACoET,cAAAA,EADvCI,gBACuCJ,EAAAA,EAAAA,OAAAA,CAAAA,EADTH,mBACSG,CAAAA,EADaK,iBACbL,CAD+BJ,MAC/BI,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA,CAAAA;AAAgB,iBAApFW,gBAAoF,CAAA,UAAzDvB,cAAyD,CAAA,GAAA,CAAA,CAAA,CAAA,cAAA,EAApBa,CAAoB,CAAA,EAAhBD,gBAAgB,CAACC,CAAD,SAAWb,cAAX,CAAA,KAAA,EAAA,CAAA,GAAqCW,CAArC,GAAA,KAAA,CAAA;AACpFY,iBAAAA,gBAAAA,CAAgB,cAAA,EAAiBP,gBAAjB,CAAA,EAAoCJ,gBAApC,CAAqDJ,MAArD,CAAA,MAAA,EAAA,OAAA,CAAA,CAAA;;;;;AAAoD,KAKhFQ,gBAAAA,GALgF;EAKhFA,IAAAA,EAAAA,MAAAA,GAAAA,SAAgB,GAAA,QAEXR,GAAM,OAAA,GAAA,QAAA,GAAA,QAAA,GAAA,SAAA;eAANA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.cts","names":["InteropZodOptional","InteropZodDefault","Runtime","LangGraphRuntime","PregelOptions","StreamMode","BaseMessage","BaseCallbackConfig","ResponseFormatUndefined","AgentBuiltInState","Record","IsOptionalZodObject","T","IsDefaultZodObject","WithMaybeContext","TContext","Omit","Partial","InternalAgentState","StructuredResponseType","IsOptionalType","ExtractNonUndefined","IsAllOptional","CreateAgentPregelOptions","CreateAgentPregelStreamOptions","InvokeConfiguration","ContextSchema","Pick","StreamConfiguration","TStreamMode","TEncoding"],"sources":["../../src/agents/runtime.d.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { InteropZodOptional } from \"@langchain/core/utils/types\";\nimport type { InteropZodDefault } from \"@langchain/core/utils/types\";\nimport type { Runtime as LangGraphRuntime, PregelOptions, StreamMode } from \"@langchain/langgraph\";\nimport type { BaseMessage } from \"@langchain/core/messages\";\nimport type { BaseCallbackConfig } from \"@langchain/core/callbacks/manager\";\nimport type { ResponseFormatUndefined } from \"./responses.js\";\n/**\n * Type for the agent's built-in state properties.\n */\nexport type AgentBuiltInState = {\n /**\n * Array of messages representing the conversation history.\n *\n * This includes all messages exchanged during the agent's execution:\n * - Human messages: Input from the user\n * - AI messages: Responses from the language model\n * - Tool messages: Results from tool executions\n * - System messages: System-level instructions or information\n *\n * Messages are accumulated throughout the agent's lifecycle and can be\n * accessed or modified by middleware hooks during execution.\n */\n messages: BaseMessage[];\n /**\n * Structured response data returned by the agent when a `responseFormat` is configured.\n *\n * This property is only populated when you provide a `responseFormat` schema\n * (as Zod or JSON schema) to the agent configuration. The agent will format\n * its final output to match the specified schema and store it in this property.\n *\n * Note: The type is specified as `Record<string, unknown>` because TypeScript cannot\n * infer the actual response format type in contexts like middleware, where the agent's\n * generic type parameters are not accessible. You may need to cast this to your specific\n * response type when accessing it.\n */\n structuredResponse?: Record<string, unknown>;\n};\n/**\n * Type helper to check if TContext is an optional Zod schema\n */\ntype IsOptionalZodObject<T> = T extends InteropZodOptional<any> ? true : false;\ntype IsDefaultZodObject<T> = T extends InteropZodDefault<any> ? true : false;\nexport type WithMaybeContext<TContext> = undefined extends TContext ? {\n readonly context?: TContext;\n} : IsOptionalZodObject<TContext> extends true ? {\n readonly context?: TContext;\n} : IsDefaultZodObject<TContext> extends true ? {\n readonly context?: TContext;\n} : {\n readonly context: TContext;\n};\n/**\n * Runtime information available to middleware (readonly).\n */\nexport type Runtime<TContext = unknown> = Partial<Omit<LangGraphRuntime<TContext>, \"context\" | \"configurable\">> & WithMaybeContext<TContext> & {\n configurable?: {\n thread_id?: string;\n [key: string]: unknown;\n };\n};\nexport type InternalAgentState<StructuredResponseType extends Record<string, unknown> | undefined = Record<string, unknown>> = {\n messages: BaseMessage[];\n} & (StructuredResponseType extends ResponseFormatUndefined ? Record<string, never> : {\n structuredResponse: StructuredResponseType;\n});\n/**\n * Helper type to check if a type is optional (includes undefined)\n */\ntype IsOptionalType<T> = undefined extends T ? true : false;\n/**\n * Extract non-undefined part of a union that includes undefined\n */\ntype ExtractNonUndefined<T> = T extends undefined ? never : T;\n/**\n * Helper type to check if all properties of a type are optional\n */\nexport type IsAllOptional<T> = \n// If T includes undefined, then it's optional (can be omitted entirely)\nundefined extends T ? true : IsOptionalType<T> extends true ? true : ExtractNonUndefined<T> extends Record<string, any> ? {} extends ExtractNonUndefined<T> ? true : false : IsOptionalType<T>;\n/**\n * Pregel options that are propagated to the agent\n */\ntype CreateAgentPregelOptions = \"configurable\" | \"durability\" | \"store\" | \"cache\" | \"signal\" | \"recursionLimit\" | \"maxConcurrency\" | \"timeout\";\n/**\n * Pregel stream options that are propagated to the agent\n */\ntype CreateAgentPregelStreamOptions = \"encoding\" | \"streamMode\";\n/**\n * Decide whether provided configuration requires a context\n */\nexport type InvokeConfiguration<ContextSchema extends Record<string, any>> = \n/**\n * If the context schema is a default object, `context` can be optional\n */\nContextSchema extends InteropZodDefault<any> ? BaseCallbackConfig & Partial<Pick<PregelOptions<any, any, any>, CreateAgentPregelOptions>> & {\n context?: Partial<ContextSchema>;\n} : IsAllOptional<ContextSchema> extends true ? BaseCallbackConfig & Partial<Pick<PregelOptions<any, any, any>, CreateAgentPregelOptions>> & {\n context?: Partial<ContextSchema>;\n} : BaseCallbackConfig & Partial<Pick<PregelOptions<any, any, any>, CreateAgentPregelOptions>> & WithMaybeContext<ContextSchema>;\nexport type StreamConfiguration<ContextSchema extends Record<string, any>, TStreamMode extends StreamMode | StreamMode[] | undefined, TEncoding extends \"text/event-stream\" | undefined> = \n/**\n * If the context schema is a default object, `context` can be optional\n */\nContextSchema extends InteropZodDefault<any> ? Partial<Pick<PregelOptions<any, any, any, TStreamMode, boolean, TEncoding>, CreateAgentPregelOptions>> & {\n context?: Partial<ContextSchema>;\n} : IsAllOptional<ContextSchema> extends true ? Partial<Pick<PregelOptions<any, any, any, TStreamMode, boolean, TEncoding>, CreateAgentPregelOptions | CreateAgentPregelStreamOptions>> & {\n context?: Partial<ContextSchema>;\n} : Partial<Pick<PregelOptions<any, any, any, TStreamMode, boolean, TEncoding>, CreateAgentPregelOptions | CreateAgentPregelStreamOptions>> & WithMaybeContext<ContextSchema>;\nexport {};\n"],"mappings":";;;;;;;;;;AAoC+B,KA1BnBS,iBAAAA,GA0BmB;EAK1BE;;;;AAAqD;AAAA;;;;AACF;AACxD;;EAA4B,QAA+BI,EApB7CT,WAoB6CS,EAAAA;EAAQ;;;;;;;;AAOrC;AAK9B;;;EAAgF,kBAAzBZ,CAAAA,EAnB9BO,MAmB8BP,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA;CAAgB;;;;AAA2D,KAd7HQ,mBAc6H,CAAA,CAAA,CAAA,GAdpGC,CAcoG,SAd1FZ,kBAc0F,CAAA,GAAA,CAAA,GAAA,IAAA,GAAA,KAAA;AAU/H,KAvBEa,kBA2Bc,CAAA,CAAA,CAAA,GA3BUD,CA2BV,SA3BoBX,iBA2BK,CAAA,GAAA,CAAA,GAAA,IAAA,GAAA,KAAA;AAIvCoB,KA9BOP,gBA8BY,CAAA,QAAA,CAAA,GAAA,SAAA,SA9BmCC,QA8BnC,GAAA;EAAA,SAAA,OAAA,CAAA,EA7BDA,QA6BC;CAAA,GA5BpBJ,mBA4B0BC,CA5BNG,QA4BMH,CAAAA,SAAAA,IAAAA,GAAAA;EAAC,SAA6BA,OAAAA,CAAAA,EA3BrCG,QA2BqCH;AAAC,CAAA,GA1BzDC,kBA0ByD,CA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A,GAAAA,OAAAA,CAAQU,IAARV,CAAab,aAAba,CAAAA,GAAAA,EAAAA,GAAAA,EAAAA,GAAAA,EAA0CY,WAA1CZ,EAAAA,OAAAA,EAAgEa,SAAhEb,CAAAA,EAA4EM,wBAA5EN,CAAAA,CAAAA,GAAAA;EAAO,OAChCS,CAAAA,EAART,OAAQS,CAAAA,aAAAA,CAAAA;CAAa,GAC/BJ,aADUL,CACIS,aADJT,CAAAA,SAAAA,IAAAA,GACkCA,OADlCA,CAC0CU,IAD1CV,CAC+Cb,aAD/Ca,CAAAA,GAAAA,EAAAA,GAAAA,EAAAA,GAAAA,EAC4EY,WAD5EZ,EAAAA,OAAAA,EACkGa,SADlGb,CAAAA,EAC8GM,wBAD9GN,GACyIO,8BADzIP,CAAAA,CAAAA,GAAAA;EAAO,OACHS,CAAAA,EACJT,OADIS,CACIA,aADJA,CAAAA;CAAa,GAE3BT,OAFAK,CAEQK,IAFRL,CAEalB,aAFbkB,CAAAA,GAAAA,EAAAA,GAAAA,EAAAA,GAAAA,EAE0CO,WAF1CP,EAAAA,OAAAA,EAEgEQ,SAFhER,CAAAA,EAE4EC,wBAF5ED,GAEuGE,8BAFvGF,CAAAA,CAAAA,GAE0IR,gBAF1IQ,CAE2JI,aAF3JJ,CAAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","names":["InteropZodOptional","InteropZodDefault","Runtime","LangGraphRuntime","PregelOptions","StreamMode","BaseMessage","BaseCallbackConfig","ResponseFormatUndefined","AgentBuiltInState","Record","IsOptionalZodObject","T","IsDefaultZodObject","WithMaybeContext","TContext","Omit","Partial","InternalAgentState","StructuredResponseType","IsOptionalType","ExtractNonUndefined","IsAllOptional","CreateAgentPregelOptions","CreateAgentPregelStreamOptions","InvokeConfiguration","ContextSchema","Pick","StreamConfiguration","TStreamMode","TEncoding"],"sources":["../../src/agents/runtime.d.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { InteropZodOptional } from \"@langchain/core/utils/types\";\nimport type { InteropZodDefault } from \"@langchain/core/utils/types\";\nimport type { Runtime as LangGraphRuntime, PregelOptions, StreamMode } from \"@langchain/langgraph\";\nimport type { BaseMessage } from \"@langchain/core/messages\";\nimport type { BaseCallbackConfig } from \"@langchain/core/callbacks/manager\";\nimport type { ResponseFormatUndefined } from \"./responses.js\";\n/**\n * Type for the agent's built-in state properties.\n */\nexport type AgentBuiltInState = {\n /**\n * Array of messages representing the conversation history.\n *\n * This includes all messages exchanged during the agent's execution:\n * - Human messages: Input from the user\n * - AI messages: Responses from the language model\n * - Tool messages: Results from tool executions\n * - System messages: System-level instructions or information\n *\n * Messages are accumulated throughout the agent's lifecycle and can be\n * accessed or modified by middleware hooks during execution.\n */\n messages: BaseMessage[];\n /**\n * Structured response data returned by the agent when a `responseFormat` is configured.\n *\n * This property is only populated when you provide a `responseFormat` schema\n * (as Zod or JSON schema) to the agent configuration. The agent will format\n * its final output to match the specified schema and store it in this property.\n *\n * Note: The type is specified as `Record<string, unknown>` because TypeScript cannot\n * infer the actual response format type in contexts like middleware, where the agent's\n * generic type parameters are not accessible. You may need to cast this to your specific\n * response type when accessing it.\n */\n structuredResponse?: Record<string, unknown>;\n};\n/**\n * Type helper to check if TContext is an optional Zod schema\n */\ntype IsOptionalZodObject<T> = T extends InteropZodOptional<any> ? true : false;\ntype IsDefaultZodObject<T> = T extends InteropZodDefault<any> ? true : false;\nexport type WithMaybeContext<TContext> = undefined extends TContext ? {\n readonly context?: TContext;\n} : IsOptionalZodObject<TContext> extends true ? {\n readonly context?: TContext;\n} : IsDefaultZodObject<TContext> extends true ? {\n readonly context?: TContext;\n} : {\n readonly context: TContext;\n};\n/**\n * Runtime information available to middleware (readonly).\n */\nexport type Runtime<TContext = unknown> = Partial<Omit<LangGraphRuntime<TContext>, \"context\" | \"configurable\">> & WithMaybeContext<TContext> & {\n configurable?: {\n thread_id?: string;\n [key: string]: unknown;\n };\n};\nexport type InternalAgentState<StructuredResponseType extends Record<string, unknown> | undefined = Record<string, unknown>> = {\n messages: BaseMessage[];\n} & (StructuredResponseType extends ResponseFormatUndefined ? Record<string, never> : {\n structuredResponse: StructuredResponseType;\n});\n/**\n * Helper type to check if a type is optional (includes undefined)\n */\ntype IsOptionalType<T> = undefined extends T ? true : false;\n/**\n * Extract non-undefined part of a union that includes undefined\n */\ntype ExtractNonUndefined<T> = T extends undefined ? never : T;\n/**\n * Helper type to check if all properties of a type are optional\n */\nexport type IsAllOptional<T> = \n// If T includes undefined, then it's optional (can be omitted entirely)\nundefined extends T ? true : IsOptionalType<T> extends true ? true : ExtractNonUndefined<T> extends Record<string, any> ? {} extends ExtractNonUndefined<T> ? true : false : IsOptionalType<T>;\n/**\n * Pregel options that are propagated to the agent\n */\ntype CreateAgentPregelOptions = \"configurable\" | \"durability\" | \"store\" | \"cache\" | \"signal\" | \"recursionLimit\" | \"maxConcurrency\" | \"timeout\";\n/**\n * Pregel stream options that are propagated to the agent\n */\ntype CreateAgentPregelStreamOptions = \"encoding\" | \"streamMode\";\n/**\n * Decide whether provided configuration requires a context\n */\nexport type InvokeConfiguration<ContextSchema extends Record<string, any>> = \n/**\n * If the context schema is a default object, `context` can be optional\n */\nContextSchema extends InteropZodDefault<any> ? BaseCallbackConfig & Partial<Pick<PregelOptions<any, any, any>, CreateAgentPregelOptions>> & {\n context?: Partial<ContextSchema>;\n} : IsAllOptional<ContextSchema> extends true ? BaseCallbackConfig & Partial<Pick<PregelOptions<any, any, any>, CreateAgentPregelOptions>> & {\n context?: Partial<ContextSchema>;\n} : BaseCallbackConfig & Partial<Pick<PregelOptions<any, any, any>, CreateAgentPregelOptions>> & WithMaybeContext<ContextSchema>;\nexport type StreamConfiguration<ContextSchema extends Record<string, any>, TStreamMode extends StreamMode | StreamMode[] | undefined, TEncoding extends \"text/event-stream\" | undefined> = \n/**\n * If the context schema is a default object, `context` can be optional\n */\nContextSchema extends InteropZodDefault<any> ? Partial<Pick<PregelOptions<any, any, any, TStreamMode, boolean, TEncoding>, CreateAgentPregelOptions>> & {\n context?: Partial<ContextSchema>;\n} : IsAllOptional<ContextSchema> extends true ? Partial<Pick<PregelOptions<any, any, any, TStreamMode, boolean, TEncoding>, CreateAgentPregelOptions | CreateAgentPregelStreamOptions>> & {\n context?: Partial<ContextSchema>;\n} : Partial<Pick<PregelOptions<any, any, any, TStreamMode, boolean, TEncoding>, CreateAgentPregelOptions | CreateAgentPregelStreamOptions>> & WithMaybeContext<ContextSchema>;\nexport {};\n"],"mappings":";;;;;;;;;;AAoC+B,KA1BnBS,iBAAAA,GA0BmB;EAK1BE;;;;AAAqD;AAAA;;;;AACF;AACxD;;EAA4B,QAA+BI,EApB7CT,WAoB6CS,EAAAA;EAAQ;;;;;;;;AAOrC;AAK9B;;;EAAgF,kBAAzBZ,CAAAA,EAnB9BO,MAmB8BP,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA;CAAgB;;;;AAA2D,KAd7HQ,mBAc6H,CAAA,CAAA,CAAA,GAdpGC,CAcoG,SAd1FZ,kBAc0F,CAAA,GAAA,CAAA,GAAA,IAAA,GAAA,KAAA;AAU/H,KAvBEa,kBA2Bc,CAAA,CAAA,CAAA,GA3BUD,CA2BV,SA3BoBX,iBA2BK,CAAA,GAAA,CAAA,GAAA,IAAA,GAAA,KAAA;AAIvCoB,KA9BOP,gBA8BY,CAAA,QAAA,CAAA,GAAA,SAAA,SA9BmCC,QA8BnC,GAAA;EAAA,SAAA,OAAA,CAAA,EA7BDA,QA6BC;CAAA,GA5BpBJ,mBA4B0BC,CA5BNG,QA4BMH,CAAAA,SAAAA,IAAAA,GAAAA;EAAC,SAA6BA,OAAAA,CAAAA,EA3BrCG,QA2BqCH;AAAC,CAAA,GA1BzDC,kBA0ByD,CA1BtCE,QA0BsC,CAAA,SAAA,IAAA,GAAA;EAIjDO,SAAAA,OAAa,CAAA,EA7BFP,QA6BE;CAAA,GAAA;EAAA,SAEPH,OAAAA,EA7BIG,QA6BJH;CAAC;;;;AAAi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EM,wBAA5EN,CAAAA,CAAAA,GAAAA;EAAO,OAChCS,CAAAA,EAART,OAAQS,CAAAA,aAAAA,CAAAA;CAAa,GAC/BJ,aADUL,CACIS,aADJT,CAAAA,SAAAA,IAAAA,GACkCA,OADlCA,CAC0CU,IAD1CV,CAC+Cb,aAD/Ca,CAAAA,GAAAA,EAAAA,GAAAA,EAAAA,GAAAA,EAC4EY,WAD5EZ,EAAAA,OAAAA,EACkGa,SADlGb,CAAAA,EAC8GM,wBAD9GN,GACyIO,8BADzIP,CAAAA,CAAAA,GAAAA;EAAO,OACHS,CAAAA,EACJT,OADIS,CACIA,aADJA,CAAAA;CAAa,GAE3BT,OAFAK,CAEQK,IAFRL,CAEalB,aAFbkB,CAAAA,GAAAA,EAAAA,GAAAA,EAAAA,GAAAA,EAE0CO,WAF1CP,EAAAA,OAAAA,EAEgEQ,SAFhER,CAAAA,EAE4EC,wBAF5ED,GAEuGE,8BAFvGF,CAAAA,CAAAA,GAE0IR,gBAF1IQ,CAE2JI,aAF3JJ,CAAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.cts","names":["CallbackManagerForLLMRun","BaseChatModel","BaseChatModelParams","BindToolsInput","ToolChoice","StructuredTool","BaseMessage","AIMessage","HumanMessage","BaseMessageFields","AIMessageFields","ToolMessage","ToolMessageFields","ChatResult","Runnable","RunnableConfig","RunnableLambda","RunnableBinding","MemorySaver","Checkpoint","CheckpointMetadata","BaseCheckpointSaver","LanguageModelLike","z","_AnyIdAIMessage","_AnyIdHumanMessage","_AnyIdToolMessage","FakeConfigurableModel","Record","Promise","FakeToolCallingChatModel","MemorySaverAssertImmutable","Uint8Array","ToolCall","FakeToolCallingModelFields","createCheckpointer","FakeToolCallingModel","toolCalls","toolStyle","index","structuredResponse","indexRef","SearchAPI","ZodString","ZodTypeAny","ZodObject","this","schema","infer"],"sources":["../../../src/agents/tests/utils.d.ts"],"sourcesContent":["import { CallbackManagerForLLMRun } from \"@langchain/core/callbacks/manager\";\nimport { BaseChatModel, BaseChatModelParams, BindToolsInput, ToolChoice } from \"@langchain/core/language_models/chat_models\";\nimport { StructuredTool } from \"@langchain/core/tools\";\nimport { BaseMessage, AIMessage, HumanMessage, BaseMessageFields, AIMessageFields, ToolMessage, ToolMessageFields } from \"@langchain/core/messages\";\nimport { ChatResult } from \"@langchain/core/outputs\";\nimport { Runnable, RunnableConfig, RunnableLambda, RunnableBinding } from \"@langchain/core/runnables\";\nimport { MemorySaver, Checkpoint, CheckpointMetadata, type BaseCheckpointSaver } from \"@langchain/langgraph-checkpoint\";\nimport { LanguageModelLike } from \"@langchain/core/language_models/base\";\nimport { z } from \"zod/v3\";\nexport declare class _AnyIdAIMessage extends AIMessage {\n get lc_id(): string[];\n constructor(fields: AIMessageFields | string);\n}\nexport declare class _AnyIdHumanMessage extends HumanMessage {\n get lc_id(): string[];\n constructor(fields: BaseMessageFields | string);\n}\nexport declare class _AnyIdToolMessage extends ToolMessage {\n get lc_id(): string[];\n constructor(fields: ToolMessageFields);\n}\nexport declare class FakeConfigurableModel extends BaseChatModel {\n _queuedMethodOperations: Record<string, any>;\n _chatModel: LanguageModelLike;\n constructor(fields: {\n model: LanguageModelLike;\n } & BaseChatModelParams);\n _llmType(): string;\n _generate(_messages: BaseMessage[], _options: this[\"ParsedCallOptions\"], _runManager?: CallbackManagerForLLMRun): Promise<ChatResult>;\n _model(): Promise<LanguageModelLike>;\n bindTools(tools: BindToolsInput[]): FakeConfigurableModel;\n}\nexport declare class FakeToolCallingChatModel extends BaseChatModel {\n sleep?: number;\n responses?: BaseMessage[];\n thrownErrorString?: string;\n idx: number;\n toolStyle: \"openai\" | \"anthropic\" | \"bedrock\" | \"google\";\n structuredResponse?: Record<string, unknown>;\n // Track messages passed to structured output calls\n structuredOutputMessages: BaseMessage[][];\n constructor(fields: {\n sleep?: number;\n responses?: BaseMessage[];\n thrownErrorString?: string;\n toolStyle?: \"openai\" | \"anthropic\" | \"bedrock\" | \"google\";\n structuredResponse?: Record<string, unknown>;\n } & BaseChatModelParams);\n _llmType(): string;\n _generate(messages: BaseMessage[], _options: this[\"ParsedCallOptions\"], runManager?: CallbackManagerForLLMRun): Promise<ChatResult>;\n bindTools(tools: BindToolsInput[]): Runnable<any>;\n withStructuredOutput<RunOutput extends Record<string, any> = Record<string, any>>(_: unknown): Runnable<any>;\n}\nexport declare class MemorySaverAssertImmutable extends MemorySaver {\n storageForCopies: Record<string, Record<string, Uint8Array>>;\n constructor();\n put(config: RunnableConfig, checkpoint: Checkpoint, metadata: CheckpointMetadata): Promise<RunnableConfig>;\n}\ninterface ToolCall {\n name: string;\n args: Record<string, any>;\n id: string;\n type?: \"tool_call\";\n}\ninterface FakeToolCallingModelFields {\n toolCalls?: ToolCall[][];\n toolStyle?: \"openai\" | \"anthropic\";\n index?: number;\n structuredResponse?: any;\n}\n// Helper function to create checkpointer\nexport declare function createCheckpointer(): BaseCheckpointSaver;\n/**\n * Fake chat model for testing tool calling functionality\n */\nexport declare class FakeToolCallingModel extends BaseChatModel {\n toolCalls: ToolCall[][];\n toolStyle: \"openai\" | \"anthropic\";\n // Use a shared reference object so the index persists across bindTools calls\n private indexRef;\n structuredResponse?: any;\n private tools;\n constructor({ toolCalls, toolStyle, index, structuredResponse, indexRef, ...rest }?: FakeToolCallingModelFields & {\n indexRef?: {\n current: number;\n };\n });\n // Getter/setter for backwards compatibility\n get index(): number;\n set index(value: number);\n _llmType(): string;\n _combineLLMOutput(): never[];\n bindTools(tools: StructuredTool[]): FakeToolCallingModel | RunnableBinding<any, any, any & {\n tool_choice?: ToolChoice | undefined;\n }>;\n withStructuredOutput(_schema: any): RunnableLambda<unknown, any, RunnableConfig<Record<string, any>>>;\n _generate(messages: BaseMessage[], _options?: this[\"ParsedCallOptions\"], _runManager?: CallbackManagerForLLMRun): Promise<ChatResult>;\n}\nexport declare class SearchAPI extends StructuredTool {\n name: string;\n description: string;\n schema: z.ZodObject<{\n query: z.ZodString;\n }, \"strip\", z.ZodTypeAny, {\n query: string;\n }, {\n query: string;\n }>;\n _call(input: z.infer<typeof this.schema>): Promise<string>;\n}\nexport {};\n"],"mappings":";;;;;;;;;;;;UA0DUiC,UAAAA;;QAEAL;;;;UAIAM,0BAAAA;cACMD;;;;;;;;;;cAUKG,oBAAAA,SAA6BnC,aAAAA;aACnCgC;;;;;;;;;;;;;MAM0EC;;;;;;;;;;mBAUpE7B,mBAAmB+B,uBAAuBnB;kBACzCb;;sCAEkBY,6BAA6BD,eAAea;sBAC5DtB,mEAAmEN,2BAA2B6B,QAAQhB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","names":["CallbackManagerForLLMRun","BaseChatModel","BaseChatModelParams","BindToolsInput","ToolChoice","StructuredTool","BaseMessage","AIMessage","HumanMessage","BaseMessageFields","AIMessageFields","ToolMessage","ToolMessageFields","ChatResult","Runnable","RunnableConfig","RunnableLambda","RunnableBinding","MemorySaver","Checkpoint","CheckpointMetadata","BaseCheckpointSaver","LanguageModelLike","z","_AnyIdAIMessage","_AnyIdHumanMessage","_AnyIdToolMessage","FakeConfigurableModel","Record","Promise","FakeToolCallingChatModel","MemorySaverAssertImmutable","Uint8Array","ToolCall","FakeToolCallingModelFields","createCheckpointer","FakeToolCallingModel","toolCalls","toolStyle","index","structuredResponse","indexRef","SearchAPI","ZodString","ZodTypeAny","ZodObject","this","schema","infer"],"sources":["../../../src/agents/tests/utils.d.ts"],"sourcesContent":["import { CallbackManagerForLLMRun } from \"@langchain/core/callbacks/manager\";\nimport { BaseChatModel, BaseChatModelParams, BindToolsInput, ToolChoice } from \"@langchain/core/language_models/chat_models\";\nimport { StructuredTool } from \"@langchain/core/tools\";\nimport { BaseMessage, AIMessage, HumanMessage, BaseMessageFields, AIMessageFields, ToolMessage, ToolMessageFields } from \"@langchain/core/messages\";\nimport { ChatResult } from \"@langchain/core/outputs\";\nimport { Runnable, RunnableConfig, RunnableLambda, RunnableBinding } from \"@langchain/core/runnables\";\nimport { MemorySaver, Checkpoint, CheckpointMetadata, type BaseCheckpointSaver } from \"@langchain/langgraph-checkpoint\";\nimport { LanguageModelLike } from \"@langchain/core/language_models/base\";\nimport { z } from \"zod/v3\";\nexport declare class _AnyIdAIMessage extends AIMessage {\n get lc_id(): string[];\n constructor(fields: AIMessageFields | string);\n}\nexport declare class _AnyIdHumanMessage extends HumanMessage {\n get lc_id(): string[];\n constructor(fields: BaseMessageFields | string);\n}\nexport declare class _AnyIdToolMessage extends ToolMessage {\n get lc_id(): string[];\n constructor(fields: ToolMessageFields);\n}\nexport declare class FakeConfigurableModel extends BaseChatModel {\n _queuedMethodOperations: Record<string, any>;\n _chatModel: LanguageModelLike;\n constructor(fields: {\n model: LanguageModelLike;\n } & BaseChatModelParams);\n _llmType(): string;\n _generate(_messages: BaseMessage[], _options: this[\"ParsedCallOptions\"], _runManager?: CallbackManagerForLLMRun): Promise<ChatResult>;\n _model(): Promise<LanguageModelLike>;\n bindTools(tools: BindToolsInput[]): FakeConfigurableModel;\n}\nexport declare class FakeToolCallingChatModel extends BaseChatModel {\n sleep?: number;\n responses?: BaseMessage[];\n thrownErrorString?: string;\n idx: number;\n toolStyle: \"openai\" | \"anthropic\" | \"bedrock\" | \"google\";\n structuredResponse?: Record<string, unknown>;\n // Track messages passed to structured output calls\n structuredOutputMessages: BaseMessage[][];\n constructor(fields: {\n sleep?: number;\n responses?: BaseMessage[];\n thrownErrorString?: string;\n toolStyle?: \"openai\" | \"anthropic\" | \"bedrock\" | \"google\";\n structuredResponse?: Record<string, unknown>;\n } & BaseChatModelParams);\n _llmType(): string;\n _generate(messages: BaseMessage[], _options: this[\"ParsedCallOptions\"], runManager?: CallbackManagerForLLMRun): Promise<ChatResult>;\n bindTools(tools: BindToolsInput[]): Runnable<any>;\n withStructuredOutput<RunOutput extends Record<string, any> = Record<string, any>>(_: unknown): Runnable<any>;\n}\nexport declare class MemorySaverAssertImmutable extends MemorySaver {\n storageForCopies: Record<string, Record<string, Uint8Array>>;\n constructor();\n put(config: RunnableConfig, checkpoint: Checkpoint, metadata: CheckpointMetadata): Promise<RunnableConfig>;\n}\ninterface ToolCall {\n name: string;\n args: Record<string, any>;\n id: string;\n type?: \"tool_call\";\n}\ninterface FakeToolCallingModelFields {\n toolCalls?: ToolCall[][];\n toolStyle?: \"openai\" | \"anthropic\";\n index?: number;\n structuredResponse?: any;\n}\n// Helper function to create checkpointer\nexport declare function createCheckpointer(): BaseCheckpointSaver;\n/**\n * Fake chat model for testing tool calling functionality\n */\nexport declare class FakeToolCallingModel extends BaseChatModel {\n toolCalls: ToolCall[][];\n toolStyle: \"openai\" | \"anthropic\";\n // Use a shared reference object so the index persists across bindTools calls\n private indexRef;\n structuredResponse?: any;\n private tools;\n constructor({ toolCalls, toolStyle, index, structuredResponse, indexRef, ...rest }?: FakeToolCallingModelFields & {\n indexRef?: {\n current: number;\n };\n });\n // Getter/setter for backwards compatibility\n get index(): number;\n set index(value: number);\n _llmType(): string;\n _combineLLMOutput(): never[];\n bindTools(tools: StructuredTool[]): FakeToolCallingModel | RunnableBinding<any, any, any & {\n tool_choice?: ToolChoice | undefined;\n }>;\n withStructuredOutput(_schema: any): RunnableLambda<unknown, any, RunnableConfig<Record<string, any>>>;\n _generate(messages: BaseMessage[], _options?: this[\"ParsedCallOptions\"], _runManager?: CallbackManagerForLLMRun): Promise<ChatResult>;\n}\nexport declare class SearchAPI extends StructuredTool {\n name: string;\n description: string;\n schema: z.ZodObject<{\n query: z.ZodString;\n }, \"strip\", z.ZodTypeAny, {\n query: string;\n }, {\n query: string;\n }>;\n _call(input: z.infer<typeof this.schema>): Promise<string>;\n}\nexport {};\n"],"mappings":";;;;;;;;;;;;UA0DUiC,UAAAA;;QAEAL;;;;UAIAM,0BAAAA;cACMD;;;;;;;;;;cAUKG,oBAAAA,SAA6BnC,aAAAA;aACnCgC;;;;;;;;;;;;;MAM0EC;;;;;;;;;;mBAUpE7B,mBAAmB+B,uBAAuBnB;kBACzCb;;sCAEkBY,6BAA6BD,eAAea;sBAC5DtB,mEAAmEN,2BAA2B6B,QAAQhB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","names":["InteropZodObject","InteropZodType","START","END","StateGraph","LanguageModelLike","BaseMessage","BaseCheckpointSaver","BaseStore","Messages","ClientTool","ServerTool","ResponseFormat","ToolStrategy","TypedToolStrategy","ProviderStrategy","JsonSchemaFormat","ResponseFormatUndefined","AgentMiddleware","AnyAnnotationRoot","InferSchemaInput","JumpToTarget","N","Interrupt","TValue","BuiltInState","UserInput","TStateSchema","ToolCall","Record","ToolResult","JumpTo","ExecutedToolCall","CreateAgentParams","StructuredResponseType","StateSchema","ContextSchema","ResponseFormatType","AbortSignal","ExtractZodArrayTypes","T","Rest","A","WithStateGraphNodes","Graph","SD","S","U","K","I","O","C"],"sources":["../../src/agents/types.d.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { InteropZodObject, InteropZodType } from \"@langchain/core/utils/types\";\nimport type { START, END, StateGraph } from \"@langchain/langgraph\";\nimport type { LanguageModelLike } from \"@langchain/core/language_models/base\";\nimport type { BaseMessage } from \"@langchain/core/messages\";\nimport type { BaseCheckpointSaver, BaseStore } from \"@langchain/langgraph-checkpoint\";\nimport type { Messages } from \"@langchain/langgraph/\";\nimport type { ClientTool, ServerTool } from \"@langchain/core/tools\";\nimport type { ResponseFormat, ToolStrategy, TypedToolStrategy, ProviderStrategy, JsonSchemaFormat, ResponseFormatUndefined } from \"./responses.js\";\nimport type { AgentMiddleware, AnyAnnotationRoot, InferSchemaInput } from \"./middleware/types.js\";\nimport type { JumpToTarget } from \"./constants.js\";\nexport type N = typeof START | \"model_request\" | \"tools\";\n/**\n * Represents information about an interrupt.\n */\nexport interface Interrupt<TValue = unknown> {\n /**\n * The ID of the interrupt.\n */\n id: string;\n /**\n * The requests for human input.\n */\n value: TValue;\n}\nexport interface BuiltInState {\n messages: BaseMessage[];\n __interrupt__?: Interrupt[];\n /**\n * Optional property to control routing after afterModel middleware execution.\n * When set by middleware, the agent will jump to the specified node instead of\n * following normal routing logic. The property is automatically cleared after use.\n *\n * - \"model_request\": Jump back to the model for another LLM call\n * - \"tools\": Jump to tool execution (requires tools to be available)\n */\n jumpTo?: JumpToTarget;\n}\n/**\n * Base input type for `.invoke` and `.stream` methods.\n */\nexport type UserInput<TStateSchema extends AnyAnnotationRoot | InteropZodObject | undefined = undefined> = InferSchemaInput<TStateSchema> & {\n messages: Messages;\n};\n/**\n * Information about a tool call that has been executed.\n */\nexport interface ToolCall {\n /**\n * The ID of the tool call.\n */\n id: string;\n /**\n * The name of the tool that was called.\n */\n name: string;\n /**\n * The arguments that were passed to the tool.\n */\n args: Record<string, any>;\n /**\n * The result of the tool call.\n */\n result?: unknown;\n /**\n * An optional error message if the tool call failed.\n */\n error?: string;\n}\n/**\n * Information about a tool result from a tool execution.\n */\nexport interface ToolResult {\n /**\n * The ID of the tool call.\n */\n id: string;\n /**\n * The result of the tool call.\n */\n result: any;\n /**\n * An optional error message if the tool call failed.\n */\n error?: string;\n}\n/**\n * jump targets (internal)\n */\nexport type JumpTo = \"model_request\" | \"tools\" | typeof END;\n/**\n * Information about a tool call that has been executed.\n */\nexport interface ExecutedToolCall {\n /**\n * The name of the tool that was called.\n */\n name: string;\n /**\n * The arguments that were passed to the tool.\n */\n args: Record<string, unknown>;\n /**\n * The ID of the tool call.\n */\n tool_id: string;\n /**\n * The result of the tool call (if available).\n */\n result?: unknown;\n}\nexport type CreateAgentParams<StructuredResponseType extends Record<string, any> = Record<string, any>, StateSchema extends AnyAnnotationRoot | InteropZodObject | undefined = undefined, ContextSchema extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot, ResponseFormatType = InteropZodType<StructuredResponseType> | InteropZodType<unknown>[] | JsonSchemaFormat | JsonSchemaFormat[] | ResponseFormat | TypedToolStrategy<StructuredResponseType> | ToolStrategy<StructuredResponseType> | ProviderStrategy<StructuredResponseType> | ResponseFormatUndefined> = {\n /**\n * Defines a model to use for the agent. You can either pass in an instance of a LangChain chat model\n * or a string. If a string is provided the agent initializes a ChatModel based on the provided model name and provider.\n * It supports various model providers and allows for runtime configuration of model parameters.\n *\n * @uses {@link initChatModel}\n * @example\n * ```ts\n * const agent = createAgent({\n * model: \"anthropic:claude-3-7-sonnet-latest\",\n * // ...\n * });\n * ```\n *\n * @example\n * ```ts\n * import { ChatOpenAI } from \"@langchain/openai\";\n * const agent = createAgent({\n * model: new ChatOpenAI({ model: \"gpt-4o\" }),\n * // ...\n * });\n * ```\n */\n model: string | LanguageModelLike;\n /**\n * A list of tools or a ToolNode.\n *\n * @example\n * ```ts\n * import { tool } from \"langchain\";\n *\n * const weatherTool = tool(() => \"Sunny!\", {\n * name: \"get_weather\",\n * description: \"Get the weather for a location\",\n * schema: z.object({\n * location: z.string().describe(\"The location to get weather for\"),\n * }),\n * });\n *\n * const agent = createAgent({\n * tools: [weatherTool],\n * // ...\n * });\n * ```\n */\n tools?: (ServerTool | ClientTool)[];\n /**\n * An optional system message for the model.\n */\n systemPrompt?: string;\n /**\n * An optional schema for the agent state. It allows you to define custom state properties that persist\n * across agent invocations and can be accessed in hooks, middleware, and throughout the agent's execution.\n * The state is persisted when using a checkpointer and can be updated by middleware or during execution.\n *\n * As opposed to the context (defined in `contextSchema`), the state is persisted between agent invocations\n * when using a checkpointer, making it suitable for maintaining conversation history, user preferences,\n * or any other data that should persist across multiple interactions.\n *\n * @example\n * ```ts\n * import { z } from \"zod\";\n * import { createAgent } from \"@langchain/langgraph\";\n *\n * const agent = createAgent({\n * model: \"openai:gpt-4o\",\n * tools: [getWeather],\n * stateSchema: z.object({\n * userPreferences: z.object({\n * temperatureUnit: z.enum([\"celsius\", \"fahrenheit\"]).default(\"celsius\"),\n * location: z.string().optional(),\n * }).optional(),\n * conversationCount: z.number().default(0),\n * }),\n * prompt: (state, config) => {\n * const unit = state.userPreferences?.temperatureUnit || \"celsius\";\n * return [\n * new SystemMessage(`You are a helpful assistant. Use ${unit} for temperature.`),\n * ];\n * },\n * });\n *\n * const result = await agent.invoke({\n * messages: [\n * new HumanMessage(\"What's the weather like?\"),\n * ],\n * userPreferences: {\n * temperatureUnit: \"fahrenheit\",\n * location: \"New York\",\n * },\n * conversationCount: 1,\n * });\n * ```\n */\n stateSchema?: StateSchema;\n /**\n * An optional schema for the context. It allows to pass in a typed context object into the agent\n * invocation and allows to access it in hooks such as `prompt` and middleware.\n * As opposed to the agent state, defined in `stateSchema`, the context is not persisted between\n * agent invocations.\n *\n * @example\n * ```ts\n * const agent = createAgent({\n * llm: model,\n * tools: [getWeather],\n * contextSchema: z.object({\n * capital: z.string(),\n * }),\n * prompt: (state, config) => {\n * return [\n * new SystemMessage(`You are a helpful assistant. The capital of France is ${config.context.capital}.`),\n * ];\n * },\n * });\n *\n * const result = await agent.invoke({\n * messages: [\n * new SystemMessage(\"You are a helpful assistant.\"),\n * new HumanMessage(\"What is the capital of France?\"),\n * ],\n * }, {\n * context: {\n * capital: \"Paris\",\n * },\n * });\n * ```\n */\n contextSchema?: ContextSchema;\n /**\n * An optional checkpoint saver to persist the agent's state.\n * @see {@link https://docs.langchain.com/oss/javascript/langgraph/persistence | Checkpointing}\n */\n checkpointer?: BaseCheckpointSaver | boolean;\n /**\n * An optional store to persist the agent's state.\n * @see {@link https://docs.langchain.com/oss/javascript/langgraph/memory#memory-storage | Long-term memory}\n */\n store?: BaseStore;\n /**\n * An optional schema for the final agent output.\n *\n * If provided, output will be formatted to match the given schema and returned in the 'structuredResponse' state key.\n * If not provided, `structuredResponse` will not be present in the output state.\n *\n * Can be passed in as:\n * - Zod schema\n * ```ts\n * const agent = createAgent({\n * responseFormat: z.object({\n * capital: z.string(),\n * }),\n * // ...\n * });\n * ```\n * - JSON schema\n * ```ts\n * const agent = createAgent({\n * responseFormat: {\n * type: \"json_schema\",\n * schema: {\n * type: \"object\",\n * properties: {\n * capital: { type: \"string\" },\n * },\n * required: [\"capital\"],\n * },\n * },\n * // ...\n * });\n * ```\n * - Create React Agent ResponseFormat\n * ```ts\n * import { providerStrategy, toolStrategy } from \"langchain\";\n * const agent = createAgent({\n * responseFormat: providerStrategy(\n * z.object({\n * capital: z.string(),\n * })\n * ),\n * // or\n * responseFormat: [\n * toolStrategy({ ... }),\n * toolStrategy({ ... }),\n * ]\n * // ...\n * });\n * ```\n *\n * **Note**: The graph will make a separate call to the LLM to generate the structured response after the agent loop is finished.\n * This is not the only strategy to get structured responses, see more options in [this guide](https://langchain-ai.github.io/langgraph/how-tos/react-agent-structured-output/).\n */\n responseFormat?: ResponseFormatType;\n /**\n * Middleware instances to run during agent execution.\n * Each middleware can define its own state schema and hook into the agent lifecycle.\n *\n * @see {@link https://docs.langchain.com/oss/javascript/langchain/middleware | Middleware}\n */\n middleware?: readonly AgentMiddleware<any, any, any>[];\n /**\n * An optional name for the agent.\n */\n name?: string;\n /**\n * An optional description for the agent.\n * This can be used to describe the agent to the underlying supervisor LLM.\n */\n description?: string;\n /**\n * Use to specify how to expose the agent name to the underlying supervisor LLM.\n * - `undefined`: Relies on the LLM provider {@link AIMessage#name}. Currently, only OpenAI supports this.\n * - `\"inline\"`: Add the agent name directly into the content field of the {@link AIMessage} using XML-style tags.\n * Example: `\"How can I help you\"` -> `\"<name>agent_name</name><content>How can I help you?</content>\"`\n */\n includeAgentName?: \"inline\" | undefined;\n /**\n * An optional abort signal that indicates that the overall operation should be aborted.\n */\n signal?: AbortSignal;\n /**\n * Determines the version of the graph to create.\n *\n * Can be one of\n * - `\"v1\"`: The tool node processes a single message. All tool calls in the message are\n * executed in parallel within the tool node.\n * - `\"v2\"`: The tool node processes a single tool call. Tool calls are distributed across\n * multiple instances of the tool node using the Send API.\n *\n * @default `\"v2\"`\n */\n version?: \"v1\" | \"v2\";\n};\n/**\n * Type helper to extract union type from an array of Zod schemas\n */\nexport type ExtractZodArrayTypes<T extends readonly InteropZodType<any>[]> = T extends readonly [InteropZodType<infer A>, ...infer Rest] ? Rest extends readonly InteropZodType<any>[] ? A | ExtractZodArrayTypes<Rest> : A : never;\nexport type WithStateGraphNodes<K extends string, Graph> = Graph extends StateGraph<infer SD, infer S, infer U, infer N, infer I, infer O, infer C> ? StateGraph<SD, S, U, N | K, I, O, C> : never;\n"],"mappings":";;;;;;;;;;;;KAWYsB,CAAAA,UAAWpB;AAAvB;AAIA;AAUA;AAA6B,UAVZqB,SAUY,CAAA,SAAA,OAAA,CAAA,CAAA;EAAA;;;EAWJ,EAAA,EAAA,MAAA;EAKbG;;;EAAgD,KAAG1B,EAlBpDwB,MAkBoDxB;;AAA4CoB,UAhB1FK,YAAAA,CAgB0FL;EAAgB,QAC7GX,EAhBAH,WAgBAG,EAAAA;EAAQ,aAAA,CAAA,EAfFc,SAeE,EAAA;EAKLK;AAyBjB;AAiBA;AAIA;AAkBA;;;;EAAyF,MAAmCT,CAAAA,EA3E/GE,YA2E+GF;;;;;AAAkLe,KAtElSR,SAsEkSQ,CAAAA,qBAtEnQf,iBAsEmQe,GAtE/OlC,gBAsE+OkC,GAAAA,SAAAA,GAAAA,SAAAA,CAAAA,GAtEnMd,gBAsEmMc,CAtElLP,YAsEkLO,CAAAA,GAAAA;EAAsB,QAArCjC,EArEjRQ,QAqEiRR;CAAc;;;;AAAkIiC,UAhE9ZN,UAAAA,CAgE8ZM;EAAsB;;;EAAgB,EAAA,EAA4CA,MAAAA;EAAsB;;;EAwBlf,IAsBxBvB,EAAAA,MAAAA;EAAU;;;EAmFU,IAKdJ,EA1LTsB,MA0LStB,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA;EAAmB;;;EAkEG,MAoB5B+B,CAAAA,EAAAA,OAAAA;EAAW;AAiBxB;;EAAgC,KAAoBrC,CAAAA,EAAAA,MAAAA;;;;;AAAqIyC,UApRxKZ,UAAAA,CAoRwKY;EAAC;;;EAAiC,EAAA,EAAA,MAAA;EAC/MC;;;EAAoD,MAASvC,EAAAA,GAAAA;EAAU;;;EAAsF,KAAEkB,CAAAA,EAAAA,MAAAA;;;;;AAArBlB,KApQ1I2B,MAAAA,GAoQ0I3B,eAAAA,GAAAA,OAAAA,GAAAA,OApQ9FD,GAoQ8FC;AAAU;;;UAhQ/I4B,gBAAAA;;;;;;;;QAQPH;;;;;;;;;;KAUEI,iDAAiDJ,sBAAsBA,yCAAyCV,oBAAoBnB,gEAAgEmB,oBAAoBnB,mBAAmBmB,wCAAwClB,eAAeiC,0BAA0BjC,4BAA4Be,mBAAmBA,qBAAqBJ,iBAAiBE,kBAAkBoB,0BAA0BrB,aAAaqB,0BAA0BnB,iBAAiBmB,0BAA0BjB;;;;;;;;;;;;;;;;;;;;;;;;kBAwBvgBZ;;;;;;;;;;;;;;;;;;;;;;WAsBPM,aAAaD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAiDRyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAkCEC;;;;;iBAKD7B;;;;;UAKPC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAsDS6B;;;;;;;wBAOKnB;;;;;;;;;;;;;;;;;;;;WAoBboB;;;;;;;;;;;;;;;;;KAiBDC,wCAAwCtC,yBAAyBuC,oBAAoBvC,0CAA0CwC,sBAAsBxC,wBAAwByC,IAAIH,qBAAqBE,QAAQC;KAC9MC,+CAA+CC,cAAcxC,6EAA6EA,WAAWyC,IAAIC,GAAGC,GAAGzB,IAAI0B,GAAGC,GAAGC,GAAGC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":["InteropZodObject","InteropZodType","START","END","StateGraph","LanguageModelLike","BaseMessage","BaseCheckpointSaver","BaseStore","Messages","ClientTool","ServerTool","ResponseFormat","ToolStrategy","TypedToolStrategy","ProviderStrategy","JsonSchemaFormat","ResponseFormatUndefined","AgentMiddleware","AnyAnnotationRoot","InferSchemaInput","JumpToTarget","N","Interrupt","TValue","BuiltInState","UserInput","TStateSchema","ToolCall","Record","ToolResult","JumpTo","ExecutedToolCall","CreateAgentParams","StructuredResponseType","StateSchema","ContextSchema","ResponseFormatType","AbortSignal","ExtractZodArrayTypes","T","Rest","A","WithStateGraphNodes","Graph","SD","S","U","K","I","O","C"],"sources":["../../src/agents/types.d.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { InteropZodObject, InteropZodType } from \"@langchain/core/utils/types\";\nimport type { START, END, StateGraph } from \"@langchain/langgraph\";\nimport type { LanguageModelLike } from \"@langchain/core/language_models/base\";\nimport type { BaseMessage } from \"@langchain/core/messages\";\nimport type { BaseCheckpointSaver, BaseStore } from \"@langchain/langgraph-checkpoint\";\nimport type { Messages } from \"@langchain/langgraph/\";\nimport type { ClientTool, ServerTool } from \"@langchain/core/tools\";\nimport type { ResponseFormat, ToolStrategy, TypedToolStrategy, ProviderStrategy, JsonSchemaFormat, ResponseFormatUndefined } from \"./responses.js\";\nimport type { AgentMiddleware, AnyAnnotationRoot, InferSchemaInput } from \"./middleware/types.js\";\nimport type { JumpToTarget } from \"./constants.js\";\nexport type N = typeof START | \"model_request\" | \"tools\";\n/**\n * Represents information about an interrupt.\n */\nexport interface Interrupt<TValue = unknown> {\n /**\n * The ID of the interrupt.\n */\n id: string;\n /**\n * The requests for human input.\n */\n value: TValue;\n}\nexport interface BuiltInState {\n messages: BaseMessage[];\n __interrupt__?: Interrupt[];\n /**\n * Optional property to control routing after afterModel middleware execution.\n * When set by middleware, the agent will jump to the specified node instead of\n * following normal routing logic. The property is automatically cleared after use.\n *\n * - \"model_request\": Jump back to the model for another LLM call\n * - \"tools\": Jump to tool execution (requires tools to be available)\n */\n jumpTo?: JumpToTarget;\n}\n/**\n * Base input type for `.invoke` and `.stream` methods.\n */\nexport type UserInput<TStateSchema extends AnyAnnotationRoot | InteropZodObject | undefined = undefined> = InferSchemaInput<TStateSchema> & {\n messages: Messages;\n};\n/**\n * Information about a tool call that has been executed.\n */\nexport interface ToolCall {\n /**\n * The ID of the tool call.\n */\n id: string;\n /**\n * The name of the tool that was called.\n */\n name: string;\n /**\n * The arguments that were passed to the tool.\n */\n args: Record<string, any>;\n /**\n * The result of the tool call.\n */\n result?: unknown;\n /**\n * An optional error message if the tool call failed.\n */\n error?: string;\n}\n/**\n * Information about a tool result from a tool execution.\n */\nexport interface ToolResult {\n /**\n * The ID of the tool call.\n */\n id: string;\n /**\n * The result of the tool call.\n */\n result: any;\n /**\n * An optional error message if the tool call failed.\n */\n error?: string;\n}\n/**\n * jump targets (internal)\n */\nexport type JumpTo = \"model_request\" | \"tools\" | typeof END;\n/**\n * Information about a tool call that has been executed.\n */\nexport interface ExecutedToolCall {\n /**\n * The name of the tool that was called.\n */\n name: string;\n /**\n * The arguments that were passed to the tool.\n */\n args: Record<string, unknown>;\n /**\n * The ID of the tool call.\n */\n tool_id: string;\n /**\n * The result of the tool call (if available).\n */\n result?: unknown;\n}\nexport type CreateAgentParams<StructuredResponseType extends Record<string, any> = Record<string, any>, StateSchema extends AnyAnnotationRoot | InteropZodObject | undefined = undefined, ContextSchema extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot, ResponseFormatType = InteropZodType<StructuredResponseType> | InteropZodType<unknown>[] | JsonSchemaFormat | JsonSchemaFormat[] | ResponseFormat | TypedToolStrategy<StructuredResponseType> | ToolStrategy<StructuredResponseType> | ProviderStrategy<StructuredResponseType> | ResponseFormatUndefined> = {\n /**\n * Defines a model to use for the agent. You can either pass in an instance of a LangChain chat model\n * or a string. If a string is provided the agent initializes a ChatModel based on the provided model name and provider.\n * It supports various model providers and allows for runtime configuration of model parameters.\n *\n * @uses {@link initChatModel}\n * @example\n * ```ts\n * const agent = createAgent({\n * model: \"anthropic:claude-3-7-sonnet-latest\",\n * // ...\n * });\n * ```\n *\n * @example\n * ```ts\n * import { ChatOpenAI } from \"@langchain/openai\";\n * const agent = createAgent({\n * model: new ChatOpenAI({ model: \"gpt-4o\" }),\n * // ...\n * });\n * ```\n */\n model: string | LanguageModelLike;\n /**\n * A list of tools or a ToolNode.\n *\n * @example\n * ```ts\n * import { tool } from \"langchain\";\n *\n * const weatherTool = tool(() => \"Sunny!\", {\n * name: \"get_weather\",\n * description: \"Get the weather for a location\",\n * schema: z.object({\n * location: z.string().describe(\"The location to get weather for\"),\n * }),\n * });\n *\n * const agent = createAgent({\n * tools: [weatherTool],\n * // ...\n * });\n * ```\n */\n tools?: (ServerTool | ClientTool)[];\n /**\n * An optional system message for the model.\n */\n systemPrompt?: string;\n /**\n * An optional schema for the agent state. It allows you to define custom state properties that persist\n * across agent invocations and can be accessed in hooks, middleware, and throughout the agent's execution.\n * The state is persisted when using a checkpointer and can be updated by middleware or during execution.\n *\n * As opposed to the context (defined in `contextSchema`), the state is persisted between agent invocations\n * when using a checkpointer, making it suitable for maintaining conversation history, user preferences,\n * or any other data that should persist across multiple interactions.\n *\n * @example\n * ```ts\n * import { z } from \"zod\";\n * import { createAgent } from \"@langchain/langgraph\";\n *\n * const agent = createAgent({\n * model: \"openai:gpt-4o\",\n * tools: [getWeather],\n * stateSchema: z.object({\n * userPreferences: z.object({\n * temperatureUnit: z.enum([\"celsius\", \"fahrenheit\"]).default(\"celsius\"),\n * location: z.string().optional(),\n * }).optional(),\n * conversationCount: z.number().default(0),\n * }),\n * prompt: (state, config) => {\n * const unit = state.userPreferences?.temperatureUnit || \"celsius\";\n * return [\n * new SystemMessage(`You are a helpful assistant. Use ${unit} for temperature.`),\n * ];\n * },\n * });\n *\n * const result = await agent.invoke({\n * messages: [\n * new HumanMessage(\"What's the weather like?\"),\n * ],\n * userPreferences: {\n * temperatureUnit: \"fahrenheit\",\n * location: \"New York\",\n * },\n * conversationCount: 1,\n * });\n * ```\n */\n stateSchema?: StateSchema;\n /**\n * An optional schema for the context. It allows to pass in a typed context object into the agent\n * invocation and allows to access it in hooks such as `prompt` and middleware.\n * As opposed to the agent state, defined in `stateSchema`, the context is not persisted between\n * agent invocations.\n *\n * @example\n * ```ts\n * const agent = createAgent({\n * llm: model,\n * tools: [getWeather],\n * contextSchema: z.object({\n * capital: z.string(),\n * }),\n * prompt: (state, config) => {\n * return [\n * new SystemMessage(`You are a helpful assistant. The capital of France is ${config.context.capital}.`),\n * ];\n * },\n * });\n *\n * const result = await agent.invoke({\n * messages: [\n * new SystemMessage(\"You are a helpful assistant.\"),\n * new HumanMessage(\"What is the capital of France?\"),\n * ],\n * }, {\n * context: {\n * capital: \"Paris\",\n * },\n * });\n * ```\n */\n contextSchema?: ContextSchema;\n /**\n * An optional checkpoint saver to persist the agent's state.\n * @see {@link https://docs.langchain.com/oss/javascript/langgraph/persistence | Checkpointing}\n */\n checkpointer?: BaseCheckpointSaver | boolean;\n /**\n * An optional store to persist the agent's state.\n * @see {@link https://docs.langchain.com/oss/javascript/langgraph/memory#memory-storage | Long-term memory}\n */\n store?: BaseStore;\n /**\n * An optional schema for the final agent output.\n *\n * If provided, output will be formatted to match the given schema and returned in the 'structuredResponse' state key.\n * If not provided, `structuredResponse` will not be present in the output state.\n *\n * Can be passed in as:\n * - Zod schema\n * ```ts\n * const agent = createAgent({\n * responseFormat: z.object({\n * capital: z.string(),\n * }),\n * // ...\n * });\n * ```\n * - JSON schema\n * ```ts\n * const agent = createAgent({\n * responseFormat: {\n * type: \"json_schema\",\n * schema: {\n * type: \"object\",\n * properties: {\n * capital: { type: \"string\" },\n * },\n * required: [\"capital\"],\n * },\n * },\n * // ...\n * });\n * ```\n * - Create React Agent ResponseFormat\n * ```ts\n * import { providerStrategy, toolStrategy } from \"langchain\";\n * const agent = createAgent({\n * responseFormat: providerStrategy(\n * z.object({\n * capital: z.string(),\n * })\n * ),\n * // or\n * responseFormat: [\n * toolStrategy({ ... }),\n * toolStrategy({ ... }),\n * ]\n * // ...\n * });\n * ```\n *\n * **Note**: The graph will make a separate call to the LLM to generate the structured response after the agent loop is finished.\n * This is not the only strategy to get structured responses, see more options in [this guide](https://langchain-ai.github.io/langgraph/how-tos/react-agent-structured-output/).\n */\n responseFormat?: ResponseFormatType;\n /**\n * Middleware instances to run during agent execution.\n * Each middleware can define its own state schema and hook into the agent lifecycle.\n *\n * @see {@link https://docs.langchain.com/oss/javascript/langchain/middleware | Middleware}\n */\n middleware?: readonly AgentMiddleware<any, any, any>[];\n /**\n * An optional name for the agent.\n */\n name?: string;\n /**\n * An optional description for the agent.\n * This can be used to describe the agent to the underlying supervisor LLM.\n */\n description?: string;\n /**\n * Use to specify how to expose the agent name to the underlying supervisor LLM.\n * - `undefined`: Relies on the LLM provider {@link AIMessage#name}. Currently, only OpenAI supports this.\n * - `\"inline\"`: Add the agent name directly into the content field of the {@link AIMessage} using XML-style tags.\n * Example: `\"How can I help you\"` -> `\"<name>agent_name</name><content>How can I help you?</content>\"`\n */\n includeAgentName?: \"inline\" | undefined;\n /**\n * An optional abort signal that indicates that the overall operation should be aborted.\n */\n signal?: AbortSignal;\n /**\n * Determines the version of the graph to create.\n *\n * Can be one of\n * - `\"v1\"`: The tool node processes a single message. All tool calls in the message are\n * executed in parallel within the tool node.\n * - `\"v2\"`: The tool node processes a single tool call. Tool calls are distributed across\n * multiple instances of the tool node using the Send API.\n *\n * @default `\"v2\"`\n */\n version?: \"v1\" | \"v2\";\n};\n/**\n * Type helper to extract union type from an array of Zod schemas\n */\nexport type ExtractZodArrayTypes<T extends readonly InteropZodType<any>[]> = T extends readonly [InteropZodType<infer A>, ...infer Rest] ? Rest extends readonly InteropZodType<any>[] ? A | ExtractZodArrayTypes<Rest> : A : never;\nexport type WithStateGraphNodes<K extends string, Graph> = Graph extends StateGraph<infer SD, infer S, infer U, infer N, infer I, infer O, infer C> ? StateGraph<SD, S, U, N | K, I, O, C> : never;\n"],"mappings":";;;;;;;;;;;;KAWYsB,CAAAA,UAAWpB;AAAvB;AAIA;AAUA;AAA6B,UAVZqB,SAUY,CAAA,SAAA,OAAA,CAAA,CAAA;EAAA;;;EAWJ,EAAA,EAAA,MAAA;EAKbG;;;EAAgD,KAAG1B,EAlBpDwB,MAkBoDxB;;AAA4CoB,UAhB1FK,YAAAA,CAgB0FL;EAAgB,QAC7GX,EAhBAH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;;;;;;;;;WAsBPM,aAAaD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAiDRyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAkCEC;;;;;iBAKD7B;;;;;UAKPC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAsDS6B;;;;;;;wBAOKnB;;;;;;;;;;;;;;;;;;;;WAoBboB;;;;;;;;;;;;;;;;;KAiBDC,wCAAwCtC,yBAAyBuC,oBAAoBvC,0CAA0CwC,sBAAsBxC,wBAAwByC,IAAIH,qBAAqBE,QAAQC;KAC9MC,+CAA+CC,cAAcxC,6EAA6EA,WAAWyC,IAAIC,GAAGC,GAAGzB,IAAI0B,GAAGC,GAAGC,GAAGC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"universal.d.cts","names":["BaseLanguageModelInput","ToolDefinition","BaseChatModel","BaseChatModelParams","BindToolsInput","BaseChatModelCallOptions","BaseMessage","AIMessageChunk","MessageStructure","RunnableBatchOptions","RunnableBinding","RunnableConfig","RunnableToolLike","IterableReadableStream","LogStreamCallbackHandlerInput","RunLogPatch","StreamEvent","StructuredToolInterface","CallbackManagerForLLMRun","ChatResult","EventStreamCallbackHandlerInput","Omit","ConfigurableChatModelCallOptions","Record","MODEL_PROVIDER_CONFIG","ChatModelProvider","getChatModelByClassName","Promise","_inferModelProvider","ConfigurableModelFields","ConfigurableModel","CallOptions","RunInput","Partial","Error","AsyncGenerator","Uint8Array","InitChatModelFields","ConfigurableFields","initChatModel"],"sources":["../../src/chat_models/universal.d.ts"],"sourcesContent":["import { BaseLanguageModelInput, ToolDefinition } from \"@langchain/core/language_models/base\";\nimport { BaseChatModel, BaseChatModelParams, BindToolsInput, type BaseChatModelCallOptions } from \"@langchain/core/language_models/chat_models\";\nimport { BaseMessage, type AIMessageChunk, MessageStructure } from \"@langchain/core/messages\";\nimport { type RunnableBatchOptions, RunnableBinding, type RunnableConfig, type RunnableToolLike } from \"@langchain/core/runnables\";\nimport { IterableReadableStream } from \"@langchain/core/utils/stream\";\nimport { type LogStreamCallbackHandlerInput, type RunLogPatch, type StreamEvent } from \"@langchain/core/tracers/log_stream\";\nimport { type StructuredToolInterface } from \"@langchain/core/tools\";\nimport { CallbackManagerForLLMRun } from \"@langchain/core/callbacks/manager\";\nimport { ChatResult } from \"@langchain/core/outputs\";\n// TODO: remove once `EventStreamCallbackHandlerInput` is exposed in core\ninterface EventStreamCallbackHandlerInput extends Omit<LogStreamCallbackHandlerInput, \"_schemaFormat\"> {\n}\nexport interface ConfigurableChatModelCallOptions extends BaseChatModelCallOptions {\n tools?: (StructuredToolInterface | Record<string, unknown> | ToolDefinition | RunnableToolLike)[];\n}\n// Configuration map for model providers\nexport declare const MODEL_PROVIDER_CONFIG: {\n readonly openai: {\n readonly package: \"@langchain/openai\";\n readonly className: \"ChatOpenAI\";\n };\n readonly anthropic: {\n readonly package: \"@langchain/anthropic\";\n readonly className: \"ChatAnthropic\";\n };\n readonly azure_openai: {\n readonly package: \"@langchain/openai\";\n readonly className: \"AzureChatOpenAI\";\n };\n readonly cohere: {\n readonly package: \"@langchain/cohere\";\n readonly className: \"ChatCohere\";\n };\n readonly \"google-vertexai\": {\n readonly package: \"@langchain/google-vertexai\";\n readonly className: \"ChatVertexAI\";\n };\n readonly \"google-vertexai-web\": {\n readonly package: \"@langchain/google-vertexai-web\";\n readonly className: \"ChatVertexAI\";\n };\n readonly \"google-genai\": {\n readonly package: \"@langchain/google-genai\";\n readonly className: \"ChatGoogleGenerativeAI\";\n };\n readonly ollama: {\n readonly package: \"@langchain/ollama\";\n readonly className: \"ChatOllama\";\n };\n readonly mistralai: {\n readonly package: \"@langchain/mistralai\";\n readonly className: \"ChatMistralAI\";\n };\n readonly mistral: {\n readonly package: \"@langchain/mistralai\";\n readonly className: \"ChatMistralAI\";\n };\n readonly groq: {\n readonly package: \"@langchain/groq\";\n readonly className: \"ChatGroq\";\n };\n readonly cerebras: {\n readonly package: \"@langchain/cerebras\";\n readonly className: \"ChatCerebras\";\n };\n readonly bedrock: {\n readonly package: \"@langchain/aws\";\n readonly className: \"ChatBedrockConverse\";\n };\n readonly deepseek: {\n readonly package: \"@langchain/deepseek\";\n readonly className: \"ChatDeepSeek\";\n };\n readonly xai: {\n readonly package: \"@langchain/xai\";\n readonly className: \"ChatXAI\";\n };\n readonly fireworks: {\n readonly package: \"@langchain/community/chat_models/fireworks\";\n readonly className: \"ChatFireworks\";\n readonly hasCircularDependency: true;\n };\n readonly together: {\n readonly package: \"@langchain/community/chat_models/togetherai\";\n readonly className: \"ChatTogetherAI\";\n readonly hasCircularDependency: true;\n };\n readonly perplexity: {\n readonly package: \"@langchain/community/chat_models/perplexity\";\n readonly className: \"ChatPerplexity\";\n readonly hasCircularDependency: true;\n };\n};\nexport type ChatModelProvider = keyof typeof MODEL_PROVIDER_CONFIG;\n/**\n * Helper function to get a chat model class by its class name\n * @param className The class name (e.g., \"ChatOpenAI\", \"ChatAnthropic\")\n * @returns The imported model class or undefined if not found\n */\nexport declare function getChatModelByClassName(className: string): Promise<any>;\n/**\n * Attempts to infer the model provider based on the given model name.\n *\n * @param {string} modelName - The name of the model to infer the provider for.\n * @returns {string | undefined} The inferred model provider name, or undefined if unable to infer.\n *\n * @example\n * _inferModelProvider(\"gpt-4\"); // returns \"openai\"\n * _inferModelProvider(\"claude-2\"); // returns \"anthropic\"\n * _inferModelProvider(\"unknown-model\"); // returns undefined\n */\nexport declare function _inferModelProvider(modelName: string): string | undefined;\ninterface ConfigurableModelFields extends BaseChatModelParams {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n defaultConfig?: Record<string, any>;\n /**\n * @default \"any\"\n */\n configurableFields?: string[] | \"any\";\n /**\n * @default \"\"\n */\n configPrefix?: string;\n /**\n * Methods which should be called after the model is initialized.\n * The key will be the method name, and the value will be the arguments.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n queuedMethodOperations?: Record<string, any>;\n}\n/**\n * Internal class used to create chat models.\n *\n * @internal\n */\nexport declare class ConfigurableModel<RunInput extends BaseLanguageModelInput = BaseLanguageModelInput, CallOptions extends ConfigurableChatModelCallOptions = ConfigurableChatModelCallOptions> extends BaseChatModel<CallOptions, AIMessageChunk> {\n _llmType(): string;\n lc_namespace: string[];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n _defaultConfig?: Record<string, any>;\n /**\n * @default \"any\"\n */\n _configurableFields: string[] | \"any\";\n /**\n * @default \"\"\n */\n _configPrefix: string;\n /**\n * Methods which should be called after the model is initialized.\n * The key will be the method name, and the value will be the arguments.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n _queuedMethodOperations: Record<string, any>;\n constructor(fields: ConfigurableModelFields);\n _model(config?: RunnableConfig): Promise<BaseChatModel<BaseChatModelCallOptions, AIMessageChunk<MessageStructure>>>;\n _generate(messages: BaseMessage[], options?: this[\"ParsedCallOptions\"], runManager?: CallbackManagerForLLMRun): Promise<ChatResult>;\n bindTools(tools: BindToolsInput[], \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n params?: Record<string, any>): ConfigurableModel<RunInput, CallOptions>;\n // Extract the input types from the `BaseModel` class.\n withStructuredOutput: BaseChatModel[\"withStructuredOutput\"];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n _modelParams(config?: RunnableConfig): Record<string, any>;\n _removePrefix(str: string, prefix: string): string;\n /**\n * Bind config to a Runnable, returning a new Runnable.\n * @param {RunnableConfig | undefined} [config] - The config to bind.\n * @returns {RunnableBinding<RunInput, RunOutput, CallOptions>} A new RunnableBinding with the bound config.\n */\n withConfig(config?: RunnableConfig): RunnableBinding<RunInput, AIMessageChunk, CallOptions>;\n invoke(input: RunInput, options?: CallOptions): Promise<AIMessageChunk>;\n stream(input: RunInput, options?: CallOptions): Promise<IterableReadableStream<AIMessageChunk>>;\n batch(inputs: RunInput[], options?: Partial<CallOptions> | Partial<CallOptions>[], batchOptions?: RunnableBatchOptions & {\n returnExceptions?: false;\n }): Promise<AIMessageChunk[]>;\n batch(inputs: RunInput[], options?: Partial<CallOptions> | Partial<CallOptions>[], batchOptions?: RunnableBatchOptions & {\n returnExceptions: true;\n }): Promise<(AIMessageChunk | Error)[]>;\n batch(inputs: RunInput[], options?: Partial<CallOptions> | Partial<CallOptions>[], batchOptions?: RunnableBatchOptions): Promise<(AIMessageChunk | Error)[]>;\n transform(generator: AsyncGenerator<RunInput>, options: CallOptions): AsyncGenerator<AIMessageChunk>;\n streamLog(input: RunInput, options?: Partial<CallOptions>, streamOptions?: Omit<LogStreamCallbackHandlerInput, \"autoClose\">): AsyncGenerator<RunLogPatch>;\n streamEvents(input: RunInput, options: Partial<CallOptions> & {\n version: \"v1\" | \"v2\";\n }, streamOptions?: Omit<EventStreamCallbackHandlerInput, \"autoClose\">): IterableReadableStream<StreamEvent>;\n streamEvents(input: RunInput, options: Partial<CallOptions> & {\n version: \"v1\" | \"v2\";\n encoding: \"text/event-stream\";\n }, streamOptions?: Omit<EventStreamCallbackHandlerInput, \"autoClose\">): IterableReadableStream<Uint8Array>;\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface InitChatModelFields extends Partial<Record<string, any>> {\n modelProvider?: string;\n configurableFields?: string[] | \"any\";\n configPrefix?: string;\n}\nexport type ConfigurableFields = \"any\" | string[];\nexport declare function initChatModel<RunInput extends BaseLanguageModelInput = BaseLanguageModelInput, CallOptions extends ConfigurableChatModelCallOptions = ConfigurableChatModelCallOptions>(model: string, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfields?: Partial<Record<string, any>> & {\n modelProvider?: string;\n configurableFields?: never;\n configPrefix?: string;\n}): Promise<ConfigurableModel<RunInput, CallOptions>>;\nexport declare function initChatModel<RunInput extends BaseLanguageModelInput = BaseLanguageModelInput, CallOptions extends ConfigurableChatModelCallOptions = ConfigurableChatModelCallOptions>(model: never, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\noptions?: Partial<Record<string, any>> & {\n modelProvider?: string;\n configurableFields?: never;\n configPrefix?: string;\n}): Promise<ConfigurableModel<RunInput, CallOptions>>;\nexport declare function initChatModel<RunInput extends BaseLanguageModelInput = BaseLanguageModelInput, CallOptions extends ConfigurableChatModelCallOptions = ConfigurableChatModelCallOptions>(model?: string, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\noptions?: Partial<Record<string, any>> & {\n modelProvider?: string;\n configurableFields?: ConfigurableFields;\n configPrefix?: string;\n}): Promise<ConfigurableModel<RunInput, CallOptions>>;\nexport {};\n"],"mappings":";;;;;;;;;;;;UAUUoB,+BAAAA,SAAwCC,KAAKP,iDAFF;AAEZ,UAExBQ,gCAAAA,SAAyCjB,wBAFjB,CAAA;EAAA,KAAcS,CAAAA,EAAAA,CAG1CG,uBAH0CH,GAGhBS,MAHgBT,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA,GAGUb,cAHVa,GAG2BF,gBAH3BE,CAAAA,EAAAA;;AAAD;AAErCQ,cAIIE,qBAJ4B,EAAA;EAAA,SAAA,MAAA,EAAA;IACpCP,SAAAA,OAAAA,EAAAA,mBAAAA;IAA0BM,SAAAA,SAAAA,EAAAA,YAAAA;EAAM,CAAA;EAAkC,SAAGX,SAAAA,EAAAA;IADxBP,SAAAA,OAAAA,EAAAA,sBAAAA;IAAwB,SAAA,SAAA,EAAA,eAAA;EAI7DmB,CAAAA;EA6ETC,SAAAA,YAAiB,EAAA;IAMLC,SAAAA,OAAAA,EAAAA,mBAA4CC;IAY5CC,SAAAA,SAAmB,EAAA,iBAAA;EACjCC,CAAAA;EAAuB,SAAA,MAAA,EAAA;IAEbN,SAAAA,OAAAA,EAAAA,mBAAAA;IAcSA,SAAAA,SAAAA,EAAAA,YAAAA;EAAM,CAAA;EAhB0B,SAAA,iBAAA,EAAA;IAuBxCO,SAAAA,OAAiB,EAAA,4BAAA;IAAA,SAAA,SAAA,EAAA,cAAA;EAAA,CAAA;EAAwC,SAAG9B,qBAAAA,E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C,QAAQF,8BAA8BV,KAAKP,8CAA8CqB,eAAepB;sBACzHiB,mBAAmBC,QAAQF;;qBAE5BV,KAAKD,gDAAgDP,uBAAuBG;sBAC3EgB,mBAAmBC,QAAQF;;;qBAG5BV,KAAKD,gDAAgDP,uBAAuBuB;;;UAGlFC,mBAAAA,SAA4BJ,QAAQV;;;;;KAKzCe,kBAAAA;iBACYC,+BAA+BvC,yBAAyBA,4CAA4CsB,mCAAmCA;;SAEtJW,QAAQV;;;;IAIbI,QAAQG,kBAAkBE,UAAUD;iBAChBQ,+BAA+BvC,yBAAyBA,4CAA4CsB,mCAAmCA;;UAErJW,QAAQV;;;;IAIdI,QAAQG,kBAAkBE,UAAUD;iBAChBQ,+BAA+BvC,yBAAyBA,4CAA4CsB,mCAAmCA;;UAErJW,QAAQV;;uBAEOe;;IAErBX,QAAQG,kBAAkBE,UAAUD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"universal.d.ts","names":["BaseLanguageModelInput","ToolDefinition","BaseChatModel","BaseChatModelParams","BindToolsInput","BaseChatModelCallOptions","BaseMessage","AIMessageChunk","MessageStructure","RunnableBatchOptions","RunnableBinding","RunnableConfig","RunnableToolLike","IterableReadableStream","LogStreamCallbackHandlerInput","RunLogPatch","StreamEvent","StructuredToolInterface","CallbackManagerForLLMRun","ChatResult","EventStreamCallbackHandlerInput","Omit","ConfigurableChatModelCallOptions","Record","MODEL_PROVIDER_CONFIG","ChatModelProvider","getChatModelByClassName","Promise","_inferModelProvider","ConfigurableModelFields","ConfigurableModel","CallOptions","RunInput","Partial","Error","AsyncGenerator","Uint8Array","InitChatModelFields","ConfigurableFields","initChatModel"],"sources":["../../src/chat_models/universal.d.ts"],"sourcesContent":["import { BaseLanguageModelInput, ToolDefinition } from \"@langchain/core/language_models/base\";\nimport { BaseChatModel, BaseChatModelParams, BindToolsInput, type BaseChatModelCallOptions } from \"@langchain/core/language_models/chat_models\";\nimport { BaseMessage, type AIMessageChunk, MessageStructure } from \"@langchain/core/messages\";\nimport { type RunnableBatchOptions, RunnableBinding, type RunnableConfig, type RunnableToolLike } from \"@langchain/core/runnables\";\nimport { IterableReadableStream } from \"@langchain/core/utils/stream\";\nimport { type LogStreamCallbackHandlerInput, type RunLogPatch, type StreamEvent } from \"@langchain/core/tracers/log_stream\";\nimport { type StructuredToolInterface } from \"@langchain/core/tools\";\nimport { CallbackManagerForLLMRun } from \"@langchain/core/callbacks/manager\";\nimport { ChatResult } from \"@langchain/core/outputs\";\n// TODO: remove once `EventStreamCallbackHandlerInput` is exposed in core\ninterface EventStreamCallbackHandlerInput extends Omit<LogStreamCallbackHandlerInput, \"_schemaFormat\"> {\n}\nexport interface ConfigurableChatModelCallOptions extends BaseChatModelCallOptions {\n tools?: (StructuredToolInterface | Record<string, unknown> | ToolDefinition | RunnableToolLike)[];\n}\n// Configuration map for model providers\nexport declare const MODEL_PROVIDER_CONFIG: {\n readonly openai: {\n readonly package: \"@langchain/openai\";\n readonly className: \"ChatOpenAI\";\n };\n readonly anthropic: {\n readonly package: \"@langchain/anthropic\";\n readonly className: \"ChatAnthropic\";\n };\n readonly azure_openai: {\n readonly package: \"@langchain/openai\";\n readonly className: \"AzureChatOpenAI\";\n };\n readonly cohere: {\n readonly package: \"@langchain/cohere\";\n readonly className: \"ChatCohere\";\n };\n readonly \"google-vertexai\": {\n readonly package: \"@langchain/google-vertexai\";\n readonly className: \"ChatVertexAI\";\n };\n readonly \"google-vertexai-web\": {\n readonly package: \"@langchain/google-vertexai-web\";\n readonly className: \"ChatVertexAI\";\n };\n readonly \"google-genai\": {\n readonly package: \"@langchain/google-genai\";\n readonly className: \"ChatGoogleGenerativeAI\";\n };\n readonly ollama: {\n readonly package: \"@langchain/ollama\";\n readonly className: \"ChatOllama\";\n };\n readonly mistralai: {\n readonly package: \"@langchain/mistralai\";\n readonly className: \"ChatMistralAI\";\n };\n readonly mistral: {\n readonly package: \"@langchain/mistralai\";\n readonly className: \"ChatMistralAI\";\n };\n readonly groq: {\n readonly package: \"@langchain/groq\";\n readonly className: \"ChatGroq\";\n };\n readonly cerebras: {\n readonly package: \"@langchain/cerebras\";\n readonly className: \"ChatCerebras\";\n };\n readonly bedrock: {\n readonly package: \"@langchain/aws\";\n readonly className: \"ChatBedrockConverse\";\n };\n readonly deepseek: {\n readonly package: \"@langchain/deepseek\";\n readonly className: \"ChatDeepSeek\";\n };\n readonly xai: {\n readonly package: \"@langchain/xai\";\n readonly className: \"ChatXAI\";\n };\n readonly fireworks: {\n readonly package: \"@langchain/community/chat_models/fireworks\";\n readonly className: \"ChatFireworks\";\n readonly hasCircularDependency: true;\n };\n readonly together: {\n readonly package: \"@langchain/community/chat_models/togetherai\";\n readonly className: \"ChatTogetherAI\";\n readonly hasCircularDependency: true;\n };\n readonly perplexity: {\n readonly package: \"@langchain/community/chat_models/perplexity\";\n readonly className: \"ChatPerplexity\";\n readonly hasCircularDependency: true;\n };\n};\nexport type ChatModelProvider = keyof typeof MODEL_PROVIDER_CONFIG;\n/**\n * Helper function to get a chat model class by its class name\n * @param className The class name (e.g., \"ChatOpenAI\", \"ChatAnthropic\")\n * @returns The imported model class or undefined if not found\n */\nexport declare function getChatModelByClassName(className: string): Promise<any>;\n/**\n * Attempts to infer the model provider based on the given model name.\n *\n * @param {string} modelName - The name of the model to infer the provider for.\n * @returns {string | undefined} The inferred model provider name, or undefined if unable to infer.\n *\n * @example\n * _inferModelProvider(\"gpt-4\"); // returns \"openai\"\n * _inferModelProvider(\"claude-2\"); // returns \"anthropic\"\n * _inferModelProvider(\"unknown-model\"); // returns undefined\n */\nexport declare function _inferModelProvider(modelName: string): string | undefined;\ninterface ConfigurableModelFields extends BaseChatModelParams {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n defaultConfig?: Record<string, any>;\n /**\n * @default \"any\"\n */\n configurableFields?: string[] | \"any\";\n /**\n * @default \"\"\n */\n configPrefix?: string;\n /**\n * Methods which should be called after the model is initialized.\n * The key will be the method name, and the value will be the arguments.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n queuedMethodOperations?: Record<string, any>;\n}\n/**\n * Internal class used to create chat models.\n *\n * @internal\n */\nexport declare class ConfigurableModel<RunInput extends BaseLanguageModelInput = BaseLanguageModelInput, CallOptions extends ConfigurableChatModelCallOptions = ConfigurableChatModelCallOptions> extends BaseChatModel<CallOptions, AIMessageChunk> {\n _llmType(): string;\n lc_namespace: string[];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n _defaultConfig?: Record<string, any>;\n /**\n * @default \"any\"\n */\n _configurableFields: string[] | \"any\";\n /**\n * @default \"\"\n */\n _configPrefix: string;\n /**\n * Methods which should be called after the model is initialized.\n * The key will be the method name, and the value will be the arguments.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n _queuedMethodOperations: Record<string, any>;\n constructor(fields: ConfigurableModelFields);\n _model(config?: RunnableConfig): Promise<BaseChatModel<BaseChatModelCallOptions, AIMessageChunk<MessageStructure>>>;\n _generate(messages: BaseMessage[], options?: this[\"ParsedCallOptions\"], runManager?: CallbackManagerForLLMRun): Promise<ChatResult>;\n bindTools(tools: BindToolsInput[], \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n params?: Record<string, any>): ConfigurableModel<RunInput, CallOptions>;\n // Extract the input types from the `BaseModel` class.\n withStructuredOutput: BaseChatModel[\"withStructuredOutput\"];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n _modelParams(config?: RunnableConfig): Record<string, any>;\n _removePrefix(str: string, prefix: string): string;\n /**\n * Bind config to a Runnable, returning a new Runnable.\n * @param {RunnableConfig | undefined} [config] - The config to bind.\n * @returns {RunnableBinding<RunInput, RunOutput, CallOptions>} A new RunnableBinding with the bound config.\n */\n withConfig(config?: RunnableConfig): RunnableBinding<RunInput, AIMessageChunk, CallOptions>;\n invoke(input: RunInput, options?: CallOptions): Promise<AIMessageChunk>;\n stream(input: RunInput, options?: CallOptions): Promise<IterableReadableStream<AIMessageChunk>>;\n batch(inputs: RunInput[], options?: Partial<CallOptions> | Partial<CallOptions>[], batchOptions?: RunnableBatchOptions & {\n returnExceptions?: false;\n }): Promise<AIMessageChunk[]>;\n batch(inputs: RunInput[], options?: Partial<CallOptions> | Partial<CallOptions>[], batchOptions?: RunnableBatchOptions & {\n returnExceptions: true;\n }): Promise<(AIMessageChunk | Error)[]>;\n batch(inputs: RunInput[], options?: Partial<CallOptions> | Partial<CallOptions>[], batchOptions?: RunnableBatchOptions): Promise<(AIMessageChunk | Error)[]>;\n transform(generator: AsyncGenerator<RunInput>, options: CallOptions): AsyncGenerator<AIMessageChunk>;\n streamLog(input: RunInput, options?: Partial<CallOptions>, streamOptions?: Omit<LogStreamCallbackHandlerInput, \"autoClose\">): AsyncGenerator<RunLogPatch>;\n streamEvents(input: RunInput, options: Partial<CallOptions> & {\n version: \"v1\" | \"v2\";\n }, streamOptions?: Omit<EventStreamCallbackHandlerInput, \"autoClose\">): IterableReadableStream<StreamEvent>;\n streamEvents(input: RunInput, options: Partial<CallOptions> & {\n version: \"v1\" | \"v2\";\n encoding: \"text/event-stream\";\n }, streamOptions?: Omit<EventStreamCallbackHandlerInput, \"autoClose\">): IterableReadableStream<Uint8Array>;\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface InitChatModelFields extends Partial<Record<string, any>> {\n modelProvider?: string;\n configurableFields?: string[] | \"any\";\n configPrefix?: string;\n}\nexport type ConfigurableFields = \"any\" | string[];\nexport declare function initChatModel<RunInput extends BaseLanguageModelInput = BaseLanguageModelInput, CallOptions extends ConfigurableChatModelCallOptions = ConfigurableChatModelCallOptions>(model: string, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfields?: Partial<Record<string, any>> & {\n modelProvider?: string;\n configurableFields?: never;\n configPrefix?: string;\n}): Promise<ConfigurableModel<RunInput, CallOptions>>;\nexport declare function initChatModel<RunInput extends BaseLanguageModelInput = BaseLanguageModelInput, CallOptions extends ConfigurableChatModelCallOptions = ConfigurableChatModelCallOptions>(model: never, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\noptions?: Partial<Record<string, any>> & {\n modelProvider?: string;\n configurableFields?: never;\n configPrefix?: string;\n}): Promise<ConfigurableModel<RunInput, CallOptions>>;\nexport declare function initChatModel<RunInput extends BaseLanguageModelInput = BaseLanguageModelInput, CallOptions extends ConfigurableChatModelCallOptions = ConfigurableChatModelCallOptions>(model?: string, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\noptions?: Partial<Record<string, any>> & {\n modelProvider?: string;\n configurableFields?: ConfigurableFields;\n configPrefix?: string;\n}): Promise<ConfigurableModel<RunInput, CallOptions>>;\nexport {};\n"],"mappings":";;;;;;;;;;;;UAUUoB,+BAAAA,SAAwCC,KAAKP,iDAFF;AAEZ,UAExBQ,gCAAAA,SAAyCjB,wBAFjB,CAAA;EAAA,KAAcS,CAAAA,EAAAA,CAG1CG,uBAH0CH,GAGhBS,MAHgBT,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA,GAGUb,cAHVa,GAG2BF,gBAH3BE,CAAAA,EAAAA;;AAAD;AAErCQ,cAIIE,qBAJ4B,EAAA;EAAA,SAAA,MAAA,EAAA;IACpCP,SAAAA,OAAAA,EAAAA,mBAAAA;IAA0BM,SAAAA,SAAAA,EAAAA,YAAAA;EAAM,CAAA;EAAkC,SAAGX,SAAAA,EAAAA;IADxBP,SAAAA,OAAAA,EAAAA,sBAAAA;IAAwB,SAAA,SAAA,EAAA,eAAA;EAI7DmB,CAAAA;EA6ETC,SAAAA,YAAiB,EAAA;IAMLC,SAAAA,OAAAA,EAAAA,mBAA4CC;IAY5CC,SAAAA,SAAmB,EAAA,iBAAA;EACjCC,CAAAA;EAAuB,SAAA,MAAA,EAAA;IAEbN,SAAAA,OAAAA,EAAAA,mBAAAA;IAcSA,SAAAA,SAAAA,EAAAA,YAAAA;EAAM,CAAA;EAhB0B,SAAA,iBAAA,EAAA;IAuBxCO,SAAAA,OAAiB,EAAA,4BAAA;IAAA,SAAA,SAAA,EAAA,cAAA;E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BD,cAAcI,eAAe5B;mBACpEyB,oBAAoBC,QAAQF,8BAA8BV,KAAKP,8CAA8CqB,eAAepB;sBACzHiB,mBAAmBC,QAAQF;;qBAE5BV,KAAKD,gDAAgDP,uBAAuBG;sBAC3EgB,mBAAmBC,QAAQF;;;qBAG5BV,KAAKD,gDAAgDP,uBAAuBuB;;;UAGlFC,mBAAAA,SAA4BJ,QAAQV;;;;;KAKzCe,kBAAAA;iBACYC,+BAA+BvC,yBAAyBA,4CAA4CsB,mCAAmCA;;SAEtJW,QAAQV;;;;IAIbI,QAAQG,kBAAkBE,UAAUD;iBAChBQ,+BAA+BvC,yBAAyBA,4CAA4CsB,mCAAmCA;;UAErJW,QAAQV;;;;IAIdI,QAAQG,kBAAkBE,UAAUD;iBAChBQ,+BAA+BvC,yBAAyBA,4CAA4CsB,mCAAmCA;;UAErJW,QAAQV;;uBAEOe;;IAErBX,QAAQG,kBAAkBE,UAAUD"}
|
package/dist/hub/base.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.cts","names":["BaseLanguageModel","Runnable","PromptCommit","basePush","Promise","basePull","generateModelImportMap","Record","generateOptionalImportMap","bindOutputSchema","T"],"sources":["../../src/hub/base.d.ts"],"sourcesContent":["import type { BaseLanguageModel } from \"@langchain/core/language_models/base\";\nimport type { Runnable } from \"@langchain/core/runnables\";\nimport type { PromptCommit } from \"langsmith/schemas\";\n/**\n * Push a prompt to the hub.\n * If the specified repo doesn't already exist, it will be created.\n * @param repoFullName The full name of the repo.\n * @param runnable The prompt to push.\n * @param options\n * @returns The URL of the newly pushed prompt in the hub.\n */\nexport declare function basePush(repoFullName: string, runnable: Runnable, options?: {\n apiKey?: string;\n apiUrl?: string;\n parentCommitHash?: string;\n isPublic?: boolean;\n description?: string;\n readme?: string;\n tags?: string[];\n}): Promise<string>;\nexport declare function basePull(ownerRepoCommit: string, options?: {\n apiKey?: string;\n apiUrl?: string;\n includeModel?: boolean;\n}): Promise<PromptCommit>;\nexport declare function generateModelImportMap(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nmodelClass?: new (...args: any[]) => BaseLanguageModel): Record<string, any>;\nexport declare function generateOptionalImportMap(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nmodelClass?: new (...args: any[]) => BaseLanguageModel): Record<string, any>;\nexport declare function bindOutputSchema<T extends Runnable>(loadedSequence: T): T;\n"],"mappings":";;;;;;AAWA;;;;AAQW;;;iBARaG,QAAAA,iCAAyCF;;;;;;;;IAQ7DG"}
|
package/dist/hub/base.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","names":["BaseLanguageModel","Runnable","PromptCommit","basePush","Promise","basePull","generateModelImportMap","Record","generateOptionalImportMap","bindOutputSchema","T"],"sources":["../../src/hub/base.d.ts"],"sourcesContent":["import type { BaseLanguageModel } from \"@langchain/core/language_models/base\";\nimport type { Runnable } from \"@langchain/core/runnables\";\nimport type { PromptCommit } from \"langsmith/schemas\";\n/**\n * Push a prompt to the hub.\n * If the specified repo doesn't already exist, it will be created.\n * @param repoFullName The full name of the repo.\n * @param runnable The prompt to push.\n * @param options\n * @returns The URL of the newly pushed prompt in the hub.\n */\nexport declare function basePush(repoFullName: string, runnable: Runnable, options?: {\n apiKey?: string;\n apiUrl?: string;\n parentCommitHash?: string;\n isPublic?: boolean;\n description?: string;\n readme?: string;\n tags?: string[];\n}): Promise<string>;\nexport declare function basePull(ownerRepoCommit: string, options?: {\n apiKey?: string;\n apiUrl?: string;\n includeModel?: boolean;\n}): Promise<PromptCommit>;\nexport declare function generateModelImportMap(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nmodelClass?: new (...args: any[]) => BaseLanguageModel): Record<string, any>;\nexport declare function generateOptionalImportMap(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nmodelClass?: new (...args: any[]) => BaseLanguageModel): Record<string, any>;\nexport declare function bindOutputSchema<T extends Runnable>(loadedSequence: T): T;\n"],"mappings":";;;;;;AAWA;;;;AAQW;;;iBARaG,QAAAA,iCAAyCF;;;;;;;;IAQ7DG"}
|
package/dist/hub/index.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":["Runnable","BaseLanguageModel","basePush","push","pull","T","Promise"],"sources":["../../src/hub/index.d.ts"],"sourcesContent":["import { Runnable } from \"@langchain/core/runnables\";\nimport type { BaseLanguageModel } from \"@langchain/core/language_models/base\";\nimport { basePush } from \"./base.js\";\nexport { basePush as push };\n/**\n * Pull a prompt from the hub.\n *\n * @param ownerRepoCommit The name of the repo containing the prompt, as well as an optional commit hash separated by a slash.\n * @param options.apiKey LangSmith API key to use when pulling the prompt\n * @param options.apiUrl LangSmith API URL to use when pulling the prompt\n * @param options.includeModel Whether to also instantiate and attach a model instance to the prompt,\n * if the prompt has associated model metadata. If set to true, invoking the resulting pulled prompt will\n * also invoke the instantiated model. For non-OpenAI models, you must also set \"modelClass\" to the\n * correct class of the model.\n * @param options.modelClass If includeModel is true, the class of the model to instantiate. Required\n * for non-OpenAI models. If you are running in Node or another environment that supports dynamic imports,\n * you may instead import this function from \"langchain/hub/node\" and pass \"includeModel: true\" instead\n * of specifying this parameter.\n * @returns\n */\nexport declare function pull<T extends Runnable>(ownerRepoCommit: string, options?: {\n apiKey?: string;\n apiUrl?: string;\n includeModel?: boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n modelClass?: new (...args: any[]) => BaseLanguageModel;\n}): Promise<T>;\n"],"mappings":";;;;;;;AAoBA;;;;;;AAMW;;;;;;;;;iBANaI,eAAeJ;;;;;uCAKEC;IACrCK,QAAQD"}
|
package/dist/hub/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":["Runnable","BaseLanguageModel","basePush","push","pull","T","Promise"],"sources":["../../src/hub/index.d.ts"],"sourcesContent":["import { Runnable } from \"@langchain/core/runnables\";\nimport type { BaseLanguageModel } from \"@langchain/core/language_models/base\";\nimport { basePush } from \"./base.js\";\nexport { basePush as push };\n/**\n * Pull a prompt from the hub.\n *\n * @param ownerRepoCommit The name of the repo containing the prompt, as well as an optional commit hash separated by a slash.\n * @param options.apiKey LangSmith API key to use when pulling the prompt\n * @param options.apiUrl LangSmith API URL to use when pulling the prompt\n * @param options.includeModel Whether to also instantiate and attach a model instance to the prompt,\n * if the prompt has associated model metadata. If set to true, invoking the resulting pulled prompt will\n * also invoke the instantiated model. For non-OpenAI models, you must also set \"modelClass\" to the\n * correct class of the model.\n * @param options.modelClass If includeModel is true, the class of the model to instantiate. Required\n * for non-OpenAI models. If you are running in Node or another environment that supports dynamic imports,\n * you may instead import this function from \"langchain/hub/node\" and pass \"includeModel: true\" instead\n * of specifying this parameter.\n * @returns\n */\nexport declare function pull<T extends Runnable>(ownerRepoCommit: string, options?: {\n apiKey?: string;\n apiUrl?: string;\n includeModel?: boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n modelClass?: new (...args: any[]) => BaseLanguageModel;\n}): Promise<T>;\n"],"mappings":";;;;;;;AAoBA;;;;;;AAMW;;;;;;;;;iBANaI,eAAeJ;;;;;uCAKEC;IACrCK,QAAQD"}
|
package/dist/hub/node.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.cts","names":["Runnable","basePush","push","pull","T","Promise"],"sources":["../../src/hub/node.d.ts"],"sourcesContent":["import { Runnable } from \"@langchain/core/runnables\";\n// TODO: Make this the default, add web entrypoint in next breaking release\nexport { basePush as push } from \"./base.js\";\n/**\n * Pull a prompt from the hub.\n * @param ownerRepoCommit The name of the repo containing the prompt, as well as an optional commit hash separated by a slash.\n * @param options.apiKey LangSmith API key to use when pulling the prompt\n * @param options.apiUrl LangSmith API URL to use when pulling the prompt\n * @param options.includeModel Whether to also instantiate and attach a model instance to the prompt,\n * if the prompt has associated model metadata. If set to true, invoking the resulting pulled prompt will\n * also invoke the instantiated model. You must have the appropriate LangChain integration package installed.\n * @returns\n */\nexport declare function pull<T extends Runnable>(ownerRepoCommit: string, options?: {\n apiKey?: string;\n apiUrl?: string;\n includeModel?: boolean;\n}): Promise<T>;\n"],"mappings":";;;;;;AAaA;;;;;AAIW;;;;iBAJaG,eAAeH;;;;IAInCK,QAAQD"}
|
package/dist/hub/node.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","names":["Runnable","basePush","push","pull","T","Promise"],"sources":["../../src/hub/node.d.ts"],"sourcesContent":["import { Runnable } from \"@langchain/core/runnables\";\n// TODO: Make this the default, add web entrypoint in next breaking release\nexport { basePush as push } from \"./base.js\";\n/**\n * Pull a prompt from the hub.\n * @param ownerRepoCommit The name of the repo containing the prompt, as well as an optional commit hash separated by a slash.\n * @param options.apiKey LangSmith API key to use when pulling the prompt\n * @param options.apiUrl LangSmith API URL to use when pulling the prompt\n * @param options.includeModel Whether to also instantiate and attach a model instance to the prompt,\n * if the prompt has associated model metadata. If set to true, invoking the resulting pulled prompt will\n * also invoke the instantiated model. You must have the appropriate LangChain integration package installed.\n * @returns\n */\nexport declare function pull<T extends Runnable>(ownerRepoCommit: string, options?: {\n apiKey?: string;\n apiUrl?: string;\n includeModel?: boolean;\n}): Promise<T>;\n"],"mappings":";;;;;;AAaA;;;;;AAIW;;;;iBAJaG,eAAeH;;;;IAInCK,QAAQD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"import_type.d.cts","names":["OptionalImportMap","SecretMap"],"sources":["../../src/load/import_type.d.ts"],"sourcesContent":["// Auto-generated by lc-secrets plugin. Do not edit manually.\nexport interface OptionalImportMap {\n}\nexport interface SecretMap {\n OPENAI_API_KEY?: string;\n}\n"],"mappings":";;AACiBA,UAAAA,iBAAAA,CAAiB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"import_type.d.ts","names":["OptionalImportMap","SecretMap"],"sources":["../../src/load/import_type.d.ts"],"sourcesContent":["// Auto-generated by lc-secrets plugin. Do not edit manually.\nexport interface OptionalImportMap {\n}\nexport interface SecretMap {\n OPENAI_API_KEY?: string;\n}\n"],"mappings":";;AACiBA,UAAAA,iBAAAA,CAAiB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":["OptionalImportMap","load","Record","T","Promise"],"sources":["../../src/load/index.d.ts"],"sourcesContent":["import { OptionalImportMap } from \"./import_type.js\";\n/**\n * Load a LangChain module from a serialized text representation.\n * NOTE: This functionality is currently in beta.\n * Loaded classes may change independently of semver.\n * @param text Serialized text representation of the module.\n * @param secretsMap\n * @param optionalImportsMap\n * @returns A loaded instance of a LangChain module.\n */\nexport declare function load<T>(text: string, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nsecretsMap?: Record<string, any>, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\noptionalImportsMap?: OptionalImportMap & Record<string, any>, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nadditionalImportsMap?: Record<string, any>): Promise<T>;\n"],"mappings":";;;;;;AAUA;;;;;;;AAM6CI,iBANrBH,IAMqBG,CAAAA,CAAAA,CAAAA,CAAAA,IAAAA,EAAAA,MAAAA;AAAO;aAJvCF;;qBAEQF,oBAAoBE;;uBAElBA,sBAAsBE,QAAQD"}
|
package/dist/load/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":["OptionalImportMap","load","Record","T","Promise"],"sources":["../../src/load/index.d.ts"],"sourcesContent":["import { OptionalImportMap } from \"./import_type.js\";\n/**\n * Load a LangChain module from a serialized text representation.\n * NOTE: This functionality is currently in beta.\n * Loaded classes may change independently of semver.\n * @param text Serialized text representation of the module.\n * @param secretsMap\n * @param optionalImportsMap\n * @returns A loaded instance of a LangChain module.\n */\nexport declare function load<T>(text: string, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nsecretsMap?: Record<string, any>, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\noptionalImportsMap?: OptionalImportMap & Record<string, any>, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nadditionalImportsMap?: Record<string, any>): Promise<T>;\n"],"mappings":";;;;;;AAUA;;;;;;;AAM6CI,iBANrBH,IAMqBG,CAAAA,CAAAA,CAAAA,CAAAA,IAAAA,EAAAA,MAAAA;AAAO;aAJvCF;;qBAEQF,oBAAoBE;;uBAElBA,sBAAsBE,QAAQD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"encoder_backed.d.cts","names":["Document","BaseStore","EncoderBackedStore","K","V","SerializedType","Promise","AsyncGenerator","createDocumentStoreFromByteStore","Uint8Array","Record","ArrayBufferLike"],"sources":["../../src/storage/encoder_backed.d.ts"],"sourcesContent":["import { Document } from \"@langchain/core/documents\";\nimport { BaseStore } from \"@langchain/core/stores\";\n/**\n * Class that provides a layer of abstraction over the base storage,\n * allowing for the encoding and decoding of keys and values. It extends\n * the BaseStore class.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport declare class EncoderBackedStore<K, V, SerializedType = any> extends BaseStore<K, V> {\n lc_namespace: string[];\n store: BaseStore<string, SerializedType>;\n keyEncoder: (key: K) => string;\n valueSerializer: (value: V) => SerializedType;\n valueDeserializer: (value: SerializedType) => V;\n constructor(fields: {\n store: BaseStore<string, SerializedType>;\n keyEncoder: (key: K) => string;\n valueSerializer: (value: V) => SerializedType;\n valueDeserializer: (value: SerializedType) => V;\n });\n /**\n * Method to get multiple keys at once. It works with the encoded keys and\n * serialized values.\n * @param keys Array of keys to get\n * @returns Promise that resolves with an array of values or undefined for each key\n */\n mget(keys: K[]): Promise<(V | undefined)[]>;\n /**\n * Method to set multiple keys at once. It works with the encoded keys and\n * serialized values.\n * @param keyValuePairs Array of key-value pairs to set\n * @returns Promise that resolves when the operation is complete\n */\n mset(keyValuePairs: [K, V][]): Promise<void>;\n /**\n * Method to delete multiple keys at once. It works with the encoded keys.\n * @param keys Array of keys to delete\n * @returns Promise that resolves when the operation is complete\n */\n mdelete(keys: K[]): Promise<void>;\n /**\n * Method to yield keys. It works with the encoded keys.\n * @param prefix Optional prefix to filter keys\n * @returns AsyncGenerator that yields keys\n */\n yieldKeys(prefix?: string | undefined): AsyncGenerator<string | K>;\n}\nexport declare function createDocumentStoreFromByteStore(store: BaseStore<string, Uint8Array>): EncoderBackedStore<string, Document<Record<string, any>>, Uint8Array<ArrayBufferLike>>;\n"],"mappings":";;;;;;;AAQA;;;;AAE6BK,cAFRH,kBAEQG,CAAAA,CAAAA,EAAAA,CAAAA,EAAAA,iBAAAA,GAAAA,CAAAA,SAF+CJ,SAE/CI,CAFyDF,CAEzDE,EAF4DD,CAE5DC,CAAAA,CAAAA;EAAc,YAAhCJ,EAAAA,MAAAA,EAAAA;EAAS,KACEE,EADXF,SACWE,CAAAA,MAAAA,EADOE,cACPF,CAAAA;EAAC,UACMC,EAAAA,CAAAA,GAAAA,EADPD,CACOC,EAAAA,GAAAA,MAAAA;EAAC,eAAKC,EAAAA,CAAAA,KAAAA,EAAND,CAAMC,EAAAA,GAAAA,cAAAA;EAAc,iBAClBA,EAAAA,CAAAA,KAAAA,EAAAA,cAAAA,EAAAA,GAAmBD,CAAnBC;EAAc,WAAKD,CAAAA,MAAAA,EAAAA;IAEjBC,KAAAA,EAAlBJ,SAAkBI,CAAAA,MAAAA,EAAAA,cAAAA,CAAAA;IAAlBJ,UAAAA,EAAAA,CAAAA,GAAAA,EACWE,CADXF,EAAAA,GAAAA,MAAAA;IACWE,eAAAA,EAAAA,CAAAA,KAAAA,EACOC,CADPD,EAAAA,GACaE,cADbF;IACOC,iBAAAA,EAAAA,CAAAA,KAAAA,EACEC,cADFD,EAAAA,GACqBA,CADrBA;EAAC,CAAA;EAAmB;;;;;;EAgB3B,IAAEA,CAAAA,IAAAA,EAPbD,CAOaC,EAAAA,CAAAA,EAPPE,OAOOF,CAAAA,CAPEA,CAOFA,GAAAA,SAAAA,CAAAA,EAAAA,CAAAA;EAAC;;;;;;EAzBwD,IAAA,CAAA,aAAA,EAAA,CAyB5DD,CAzB4D,EAyBzDC,CAzByD,CAAA,EAAA,CAAA,EAyBlDE,OAzBkD,CAAA,IAAA,CAAA;EAuC7DE;;;;;EAAkH,OAAfR,CAAAA,IAAAA,EARzGG,CAQyGH,EAAAA,CAAAA,EARnGM,OAQmGN,CAAAA,IAAAA,CAAAA;EAAQ;;;AAAjB;;0CAFtEO,wBAAwBJ;;iBAE5CK,gCAAAA,QAAwCP,kBAAkBQ,cAAcP,2BAA2BF,SAASU,sBAAsBD,WAAWE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"encoder_backed.d.ts","names":["Document","BaseStore","EncoderBackedStore","K","V","SerializedType","Promise","AsyncGenerator","createDocumentStoreFromByteStore","Uint8Array","Record","ArrayBufferLike"],"sources":["../../src/storage/encoder_backed.d.ts"],"sourcesContent":["import { Document } from \"@langchain/core/documents\";\nimport { BaseStore } from \"@langchain/core/stores\";\n/**\n * Class that provides a layer of abstraction over the base storage,\n * allowing for the encoding and decoding of keys and values. It extends\n * the BaseStore class.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport declare class EncoderBackedStore<K, V, SerializedType = any> extends BaseStore<K, V> {\n lc_namespace: string[];\n store: BaseStore<string, SerializedType>;\n keyEncoder: (key: K) => string;\n valueSerializer: (value: V) => SerializedType;\n valueDeserializer: (value: SerializedType) => V;\n constructor(fields: {\n store: BaseStore<string, SerializedType>;\n keyEncoder: (key: K) => string;\n valueSerializer: (value: V) => SerializedType;\n valueDeserializer: (value: SerializedType) => V;\n });\n /**\n * Method to get multiple keys at once. It works with the encoded keys and\n * serialized values.\n * @param keys Array of keys to get\n * @returns Promise that resolves with an array of values or undefined for each key\n */\n mget(keys: K[]): Promise<(V | undefined)[]>;\n /**\n * Method to set multiple keys at once. It works with the encoded keys and\n * serialized values.\n * @param keyValuePairs Array of key-value pairs to set\n * @returns Promise that resolves when the operation is complete\n */\n mset(keyValuePairs: [K, V][]): Promise<void>;\n /**\n * Method to delete multiple keys at once. It works with the encoded keys.\n * @param keys Array of keys to delete\n * @returns Promise that resolves when the operation is complete\n */\n mdelete(keys: K[]): Promise<void>;\n /**\n * Method to yield keys. It works with the encoded keys.\n * @param prefix Optional prefix to filter keys\n * @returns AsyncGenerator that yields keys\n */\n yieldKeys(prefix?: string | undefined): AsyncGenerator<string | K>;\n}\nexport declare function createDocumentStoreFromByteStore(store: BaseStore<string, Uint8Array>): EncoderBackedStore<string, Document<Record<string, any>>, Uint8Array<ArrayBufferLike>>;\n"],"mappings":";;;;;;;AAQA;;;;AAE6BK,cAFRH,kBAEQG,CAAAA,CAAAA,EAAAA,CAAAA,EAAAA,iBAAAA,GAAAA,CAAAA,SAF+CJ,SAE/CI,CAFyDF,CAEzDE,EAF4DD,CAE5DC,CAAAA,CAAAA;EAAc,YAAhCJ,EAAAA,MAAAA,EAAAA;EAAS,KACEE,EADXF,SACWE,CAAAA,MAAAA,EADOE,cACPF,CAAAA;EAAC,UACMC,EAAAA,CAAAA,GAAAA,EADPD,CACOC,EAAAA,GAAAA,MAAAA;EAAC,eAAKC,EAAAA,CAAAA,KAAAA,EAAND,CAAMC,EAAAA,GAAAA,cAAAA;EAAc,iBAClBA,EAAAA,CAAAA,KAAAA,EAAAA,cAAAA,EAAAA,GAAmBD,CAAnBC;EAAc,WAAKD,CAAAA,MAAAA,EAAAA;IAEjBC,KAAAA,EAAlBJ,SAAkBI,CAAAA,MAAAA,EAAAA,cAAAA,CAAAA;IAAlBJ,UAAAA,EAAAA,CAAAA,GAAAA,EACWE,CADXF,EAAAA,GAAAA,MAAAA;IACWE,eAAAA,EAAAA,CAAAA,KAAAA,EACOC,CADPD,EAAAA,GACaE,cADbF;IACOC,iBAAAA,EAAAA,CAAAA,KAAAA,EACEC,cADFD,EAAAA,GACqBA,CADrBA;EAAC,CAAA;EAAmB;;;;;;EAgB3B,IAAEA,CAAAA,IAAAA,EAPbD,CAOaC,EAAAA,CAAAA,EAPPE,OAOOF,CAAAA,CAPEA,CAOFA,GAAAA,SAAAA,CAAAA,EAAAA,CAAAA;EAAC;;;;;;EAzBwD,IAAA,CAAA,aAAA,EAAA,CAyB5DD,CAzB4D,EAyBzDC,CAzByD,CAAA,EAAA,CAAA,EAyBlDE,OAzBkD,CAAA,IAAA,CAAA;EAuC7DE;;;;;EAAkH,OAAfR,CAAAA,IAAAA,EARzGG,CAQyGH,EAAAA,CAAAA,EARnGM,OAQmGN,CAAAA,IAAAA,CAAAA;EAAQ;;;AAAjB;;0CAFtEO,wBAAwBJ;;iBAE5CK,gCAAAA,QAAwCP,kBAAkBQ,cAAcP,2BAA2BF,SAASU,sBAAsBD,WAAWE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file_system.d.cts","names":["BaseStore","LocalFileStore","Uint8Array","ArrayBufferLike","Promise","AsyncGenerator"],"sources":["../../src/storage/file_system.d.ts"],"sourcesContent":["import { BaseStore } from \"@langchain/core/stores\";\n/**\n * File system implementation of the BaseStore using a dictionary. Used for\n * storing key-value pairs in the file system.\n * @example\n * ```typescript\n * const store = await LocalFileStore.fromPath(\"./messages\");\n * await store.mset(\n * Array.from({ length: 5 }).map((_, index) => [\n * `message:id:${index}`,\n * new TextEncoder().encode(\n * JSON.stringify(\n * index % 2 === 0\n * ? new AIMessage(\"ai stuff...\")\n * : new HumanMessage(\"human stuff...\"),\n * ),\n * ),\n * ]),\n * );\n * const retrievedMessages = await store.mget([\"message:id:0\", \"message:id:1\"]);\n * console.log(retrievedMessages.map((v) => new TextDecoder().decode(v)));\n * for await (const key of store.yieldKeys(\"message:id:\")) {\n * await store.mdelete([key]);\n * }\n * ```\n *\n * @security **Security Notice** This file store\n * can alter any text file in the provided directory and any subfolders.\n * Make sure that the path you specify when initializing the store is free\n * of other files.\n */\nexport declare class LocalFileStore extends BaseStore<string, Uint8Array> {\n lc_namespace: string[];\n rootPath: string;\n constructor(fields: {\n rootPath: string;\n });\n private getParsedFile;\n private setFileContent;\n /**\n * Returns the full path of the file where the value of the given key is stored.\n * @param key the key to get the full path for\n */\n private getFullPath;\n /**\n * Retrieves the values associated with the given keys from the store.\n * @param keys Keys to retrieve values for.\n * @returns Array of values associated with the given keys.\n */\n mget(keys: string[]): Promise<(Uint8Array<ArrayBufferLike> | undefined)[]>;\n /**\n * Sets the values for the given keys in the store.\n * @param keyValuePairs Array of key-value pairs to set in the store.\n * @returns Promise that resolves when all key-value pairs have been set.\n */\n mset(keyValuePairs: [string, Uint8Array][]): Promise<void>;\n /**\n * Deletes the given keys and their associated values from the store.\n * @param keys Keys to delete from the store.\n * @returns Promise that resolves when all keys have been deleted.\n */\n mdelete(keys: string[]): Promise<void>;\n /**\n * Asynchronous generator that yields keys from the store. If a prefix is\n * provided, it only yields keys that start with the prefix.\n * @param prefix Optional prefix to filter keys.\n * @returns AsyncGenerator that yields keys from the store.\n */\n yieldKeys(prefix?: string): AsyncGenerator<string>;\n /**\n * Static method for initializing the class.\n * Preforms a check to see if the directory exists, and if not, creates it.\n * @param path Path to the directory.\n * @returns Promise that resolves to an instance of the class.\n */\n static fromPath(rootPath: string): Promise<LocalFileStore>;\n}\n"],"mappings":";;;;;;AA+BA;;;;;;;;;;;;;AAAqD;;;;;;;;;;;;;;;cAAhCC,cAAAA,SAAuBD,kBAAkBE;;;;;;;;;;;;;;;;;;wBAkBpCE,SAASF,WAAWC;;;;;;+BAMbD,gBAAgBE;;;;;;2BAMpBA;;;;;;;8BAOGC;;;;;;;qCAOOD,QAAQH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file_system.d.ts","names":["BaseStore","LocalFileStore","Uint8Array","ArrayBufferLike","Promise","AsyncGenerator"],"sources":["../../src/storage/file_system.d.ts"],"sourcesContent":["import { BaseStore } from \"@langchain/core/stores\";\n/**\n * File system implementation of the BaseStore using a dictionary. Used for\n * storing key-value pairs in the file system.\n * @example\n * ```typescript\n * const store = await LocalFileStore.fromPath(\"./messages\");\n * await store.mset(\n * Array.from({ length: 5 }).map((_, index) => [\n * `message:id:${index}`,\n * new TextEncoder().encode(\n * JSON.stringify(\n * index % 2 === 0\n * ? new AIMessage(\"ai stuff...\")\n * : new HumanMessage(\"human stuff...\"),\n * ),\n * ),\n * ]),\n * );\n * const retrievedMessages = await store.mget([\"message:id:0\", \"message:id:1\"]);\n * console.log(retrievedMessages.map((v) => new TextDecoder().decode(v)));\n * for await (const key of store.yieldKeys(\"message:id:\")) {\n * await store.mdelete([key]);\n * }\n * ```\n *\n * @security **Security Notice** This file store\n * can alter any text file in the provided directory and any subfolders.\n * Make sure that the path you specify when initializing the store is free\n * of other files.\n */\nexport declare class LocalFileStore extends BaseStore<string, Uint8Array> {\n lc_namespace: string[];\n rootPath: string;\n constructor(fields: {\n rootPath: string;\n });\n private getParsedFile;\n private setFileContent;\n /**\n * Returns the full path of the file where the value of the given key is stored.\n * @param key the key to get the full path for\n */\n private getFullPath;\n /**\n * Retrieves the values associated with the given keys from the store.\n * @param keys Keys to retrieve values for.\n * @returns Array of values associated with the given keys.\n */\n mget(keys: string[]): Promise<(Uint8Array<ArrayBufferLike> | undefined)[]>;\n /**\n * Sets the values for the given keys in the store.\n * @param keyValuePairs Array of key-value pairs to set in the store.\n * @returns Promise that resolves when all key-value pairs have been set.\n */\n mset(keyValuePairs: [string, Uint8Array][]): Promise<void>;\n /**\n * Deletes the given keys and their associated values from the store.\n * @param keys Keys to delete from the store.\n * @returns Promise that resolves when all keys have been deleted.\n */\n mdelete(keys: string[]): Promise<void>;\n /**\n * Asynchronous generator that yields keys from the store. If a prefix is\n * provided, it only yields keys that start with the prefix.\n * @param prefix Optional prefix to filter keys.\n * @returns AsyncGenerator that yields keys from the store.\n */\n yieldKeys(prefix?: string): AsyncGenerator<string>;\n /**\n * Static method for initializing the class.\n * Preforms a check to see if the directory exists, and if not, creates it.\n * @param path Path to the directory.\n * @returns Promise that resolves to an instance of the class.\n */\n static fromPath(rootPath: string): Promise<LocalFileStore>;\n}\n"],"mappings":";;;;;;AA+BA;;;;;;;;;;;;;AAAqD;;;;;;;;;;;;;;;cAAhCC,cAAAA,SAAuBD,kBAAkBE;;;;;;;;;;;;;;;;;;wBAkBpCE,SAASF,WAAWC;;;;;;+BAMbD,gBAAgBE;;;;;;2BAMpBA;;;;;;;8BAOGC;;;;;;;qCAOOD,QAAQH"}
|