@langchain/core 1.1.5-dev-1765432861398 → 1.1.5-dev-1765433794876
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat_models.d.ts","names":["ZodType","ZodTypeV3","$ZodType","ZodTypeV4","BaseMessage","BaseMessageChunk","BaseMessageLike","AIMessageChunk","MessageOutputVersion","BasePromptValueInterface","LLMResult","ChatGenerationChunk","ChatResult","Generation","BaseLanguageModel","StructuredOutputMethodOptions","ToolDefinition","BaseLanguageModelCallOptions","BaseLanguageModelInput","BaseLanguageModelParams","CallbackManagerForLLMRun","Callbacks","RunnableConfig","BaseCache","StructuredToolInterface","StructuredToolParams","Runnable","RunnableToolLike","ToolChoice","Record","SerializedChatModel","SerializedLLM","BaseChatModelParams","BaseChatModelCallOptions","LangSmithParams","Array","BindToolsInput","BaseChatModel","RunOutput","CallOptions","OutputMessageType","Exclude","Omit","Partial","Promise","AsyncGenerator","messages","cache","llmStringKey","parsedOptions","handledOptions","SimpleChatModel"],"sources":["../../src/language_models/chat_models.d.ts"],"sourcesContent":["import type { ZodType as ZodTypeV3 } from \"zod/v3\";\nimport type { $ZodType as ZodTypeV4 } from \"zod/v4/core\";\nimport { type BaseMessage, BaseMessageChunk, type BaseMessageLike, AIMessageChunk, MessageOutputVersion } from \"../messages/index.js\";\nimport type { BasePromptValueInterface } from \"../prompt_values.js\";\nimport { LLMResult, ChatGenerationChunk, type ChatResult, type Generation } from \"../outputs.js\";\nimport { BaseLanguageModel, type StructuredOutputMethodOptions, type ToolDefinition, type BaseLanguageModelCallOptions, type BaseLanguageModelInput, type BaseLanguageModelParams } from \"./base.js\";\nimport { type CallbackManagerForLLMRun, type Callbacks } from \"../callbacks/manager.js\";\nimport type { RunnableConfig } from \"../runnables/config.js\";\nimport type { BaseCache } from \"../caches/index.js\";\nimport { StructuredToolInterface, StructuredToolParams } from \"../tools/index.js\";\nimport { Runnable, RunnableToolLike } from \"../runnables/base.js\";\nexport type ToolChoice = string | Record<string, any> | \"auto\" | \"any\";\n/**\n * Represents a serialized chat model.\n */\nexport type SerializedChatModel = {\n _model: string;\n _type: string;\n} & Record<string, any>;\n/**\n * Represents a serialized large language model.\n */\nexport type SerializedLLM = {\n _model: string;\n _type: string;\n} & Record<string, any>;\n/**\n * Represents the parameters for a base chat model.\n */\nexport type BaseChatModelParams = BaseLanguageModelParams & {\n /**\n * Whether to disable streaming.\n *\n * If streaming is bypassed, then `stream()` will defer to\n * `invoke()`.\n *\n * - If true, will always bypass streaming case.\n * - If false (default), will always use streaming case if available.\n */\n disableStreaming?: boolean;\n /**\n * Version of `AIMessage` output format to store in message content.\n *\n * `AIMessage.contentBlocks` will lazily parse the contents of `content` into a\n * standard format. This flag can be used to additionally store the standard format\n * as the message content, e.g., for serialization purposes.\n *\n * - \"v0\": provider-specific format in content (can lazily parse with `.contentBlocks`)\n * - \"v1\": standardized format in content (consistent with `.contentBlocks`)\n *\n * You can also set `LC_OUTPUT_VERSION` as an environment variable to \"v1\" to\n * enable this by default.\n *\n * @default \"v0\"\n */\n outputVersion?: MessageOutputVersion;\n};\n/**\n * Represents the call options for a base chat model.\n */\nexport type BaseChatModelCallOptions = BaseLanguageModelCallOptions & {\n /**\n * Specifies how the chat model should use tools.\n * @default undefined\n *\n * Possible values:\n * - \"auto\": The model may choose to use any of the provided tools, or none.\n * - \"any\": The model must use one of the provided tools.\n * - \"none\": The model must not use any tools.\n * - A string (not \"auto\", \"any\", or \"none\"): The name of a specific tool the model must use.\n * - An object: A custom schema specifying tool choice parameters. Specific to the provider.\n *\n * Note: Not all providers support tool_choice. An error will be thrown\n * if used with an unsupported model.\n */\n tool_choice?: ToolChoice;\n /**\n * Version of `AIMessage` output format to store in message content.\n *\n * `AIMessage.contentBlocks` will lazily parse the contents of `content` into a\n * standard format. This flag can be used to additionally store the standard format\n * as the message content, e.g., for serialization purposes.\n *\n * - \"v0\": provider-specific format in content (can lazily parse with `.contentBlocks`)\n * - \"v1\": standardized format in content (consistent with `.contentBlocks`)\n *\n * You can also set `LC_OUTPUT_VERSION` as an environment variable to \"v1\" to\n * enable this by default.\n *\n * @default \"v0\"\n */\n outputVersion?: MessageOutputVersion;\n};\nexport type LangSmithParams = {\n ls_provider?: string;\n ls_model_name?: string;\n ls_model_type: \"chat\";\n ls_temperature?: number;\n ls_max_tokens?: number;\n ls_stop?: Array<string>;\n};\nexport type BindToolsInput = StructuredToolInterface | Record<string, any> | ToolDefinition | RunnableToolLike | StructuredToolParams;\n/**\n * Base class for chat models. It extends the BaseLanguageModel class and\n * provides methods for generating chat based on input messages.\n */\nexport declare abstract class BaseChatModel<CallOptions extends BaseChatModelCallOptions = BaseChatModelCallOptions, OutputMessageType extends BaseMessageChunk = AIMessageChunk> extends BaseLanguageModel<OutputMessageType, CallOptions> {\n ParsedCallOptions: Omit<CallOptions, Exclude<keyof RunnableConfig, \"signal\" | \"timeout\" | \"maxConcurrency\">>;\n lc_namespace: string[];\n disableStreaming: boolean;\n outputVersion?: MessageOutputVersion;\n get callKeys(): string[];\n constructor(fields: BaseChatModelParams);\n _combineLLMOutput?(...llmOutputs: LLMResult[\"llmOutput\"][]): LLMResult[\"llmOutput\"];\n protected _separateRunnableConfigFromCallOptionsCompat(options?: Partial<CallOptions>): [RunnableConfig, this[\"ParsedCallOptions\"]];\n /**\n * Bind tool-like objects to this chat model.\n *\n * @param tools A list of tool definitions to bind to this chat model.\n * Can be a structured tool, an OpenAI formatted tool, or an object\n * matching the provider's specific tool schema.\n * @param kwargs Any additional parameters to bind.\n */\n bindTools?(tools: BindToolsInput[], kwargs?: Partial<CallOptions>): Runnable<BaseLanguageModelInput, OutputMessageType, CallOptions>;\n /**\n * Invokes the chat model with a single input.\n * @param input The input for the language model.\n * @param options The call options.\n * @returns A Promise that resolves to a BaseMessageChunk.\n */\n invoke(input: BaseLanguageModelInput, options?: CallOptions): Promise<OutputMessageType>;\n _streamResponseChunks(_messages: BaseMessage[], _options: this[\"ParsedCallOptions\"], _runManager?: CallbackManagerForLLMRun): AsyncGenerator<ChatGenerationChunk>;\n _streamIterator(input: BaseLanguageModelInput, options?: CallOptions): AsyncGenerator<OutputMessageType>;\n getLsParams(options: this[\"ParsedCallOptions\"]): LangSmithParams;\n /** @ignore */\n _generateUncached(messages: BaseMessageLike[][], parsedOptions: this[\"ParsedCallOptions\"], handledOptions: RunnableConfig, startedRunManagers?: CallbackManagerForLLMRun[]): Promise<LLMResult>;\n _generateCached({ messages, cache, llmStringKey, parsedOptions, handledOptions }: {\n messages: BaseMessageLike[][];\n cache: BaseCache<Generation[]>;\n llmStringKey: string;\n parsedOptions: any;\n handledOptions: RunnableConfig;\n }): Promise<LLMResult & {\n missingPromptIndices: number[];\n startedRunManagers?: CallbackManagerForLLMRun[];\n }>;\n /**\n * Generates chat based on the input messages.\n * @param messages An array of arrays of BaseMessage instances.\n * @param options The call options or an array of stop sequences.\n * @param callbacks The callbacks for the language model.\n * @returns A Promise that resolves to an LLMResult.\n */\n generate(messages: BaseMessageLike[][], options?: string[] | CallOptions, callbacks?: Callbacks): Promise<LLMResult>;\n /**\n * Get the parameters used to invoke the model\n */\n invocationParams(_options?: this[\"ParsedCallOptions\"]): any;\n _modelType(): string;\n abstract _llmType(): string;\n /**\n * Generates a prompt based on the input prompt values.\n * @param promptValues An array of BasePromptValue instances.\n * @param options The call options or an array of stop sequences.\n * @param callbacks The callbacks for the language model.\n * @returns A Promise that resolves to an LLMResult.\n */\n generatePrompt(promptValues: BasePromptValueInterface[], options?: string[] | CallOptions, callbacks?: Callbacks): Promise<LLMResult>;\n abstract _generate(messages: BaseMessage[], options: this[\"ParsedCallOptions\"], runManager?: CallbackManagerForLLMRun): Promise<ChatResult>;\n withStructuredOutput<RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: ZodTypeV4<RunOutput> | Record<string, any>, config?: StructuredOutputMethodOptions<false>): Runnable<BaseLanguageModelInput, RunOutput>;\n withStructuredOutput<RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: ZodTypeV4<RunOutput> | Record<string, any>, config?: StructuredOutputMethodOptions<true>): Runnable<BaseLanguageModelInput, {\n raw: BaseMessage;\n parsed: RunOutput;\n }>;\n withStructuredOutput<RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: ZodTypeV3<RunOutput> | Record<string, any>, config?: StructuredOutputMethodOptions<false>): Runnable<BaseLanguageModelInput, RunOutput>;\n withStructuredOutput<RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: ZodTypeV3<RunOutput> | Record<string, any>, config?: StructuredOutputMethodOptions<true>): Runnable<BaseLanguageModelInput, {\n raw: BaseMessage;\n parsed: RunOutput;\n }>;\n}\n/**\n * An abstract class that extends BaseChatModel and provides a simple\n * implementation of _generate.\n */\nexport declare abstract class SimpleChatModel<CallOptions extends BaseChatModelCallOptions = BaseChatModelCallOptions> extends BaseChatModel<CallOptions> {\n abstract _call(messages: BaseMessage[], options: this[\"ParsedCallOptions\"], runManager?: CallbackManagerForLLMRun): Promise<string>;\n _generate(messages: BaseMessage[], options: this[\"ParsedCallOptions\"], runManager?: CallbackManagerForLLMRun): Promise<ChatResult>;\n}\n//# sourceMappingURL=chat_models.d.ts.map"],"mappings":";;;;;;;;;;;;;;;;;;KAWY4B,UAAAA,YAAsBC;;;;KAItBC,mBAAAA;;;AAJZ,CAAA,GAOID,MAPQD,CAAAA,MAAU,EAAA,GAAA,CAAA;AAItB;AAOA;AAOA;AA+BYK,KAtCAF,aAAAA,GAsCAE;EAA2BhB,MAAAA,EAAAA,MAAAA;EAerBW,KAAAA,EAAAA,MAAAA;CAgBEpB,GAlEhBqB,MAkEgBrB,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA;AAAoB;AAExC;AAQA;AAA6BgB,KAxEjBQ,mBAAAA,GAAsBb,uBAwELK,GAAAA;EAA0BK;;;;AAA8E;AAKrI;;;;EAAkKtB,gBAAAA,CAAAA,EAAAA,OAAAA;EAA0CiC;;;;;;;;;;;;;;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T,sBAAsBA,mCAAmC1B,SAAUmC,aAAaT,8BAA8Bd,sCAAsCW,SAASR;SAC3Ld;YACGkC;;yCAE2BT,sBAAsBA,mCAAmC5B,QAAUqC,aAAaT,8BAA8Bd,uCAAuCW,SAASR,wBAAwBoB;yCACtLT,sBAAsBA,mCAAmC5B,QAAUqC,aAAaT,8BAA8Bd,sCAAsCW,SAASR;SAC3Ld;YACGkC;;;;;;;uBAOca,oCAAoClB,2BAA2BA,kCAAkCI,cAAcE;2BAChHnC,gEAAgEgB,2BAA2BwB;sBAChGxC,gEAAgEgB,2BAA2BwB,QAAQhC"}
|
|
1
|
+
{"version":3,"file":"chat_models.d.ts","names":["ZodType","ZodTypeV3","$ZodType","ZodTypeV4","BaseMessage","BaseMessageChunk","BaseMessageLike","AIMessageChunk","MessageOutputVersion","BasePromptValueInterface","LLMResult","ChatGenerationChunk","ChatResult","Generation","BaseLanguageModel","StructuredOutputMethodOptions","ToolDefinition","BaseLanguageModelCallOptions","BaseLanguageModelInput","BaseLanguageModelParams","CallbackManagerForLLMRun","Callbacks","RunnableConfig","BaseCache","StructuredToolInterface","StructuredToolParams","Runnable","RunnableToolLike","ToolChoice","Record","SerializedChatModel","SerializedLLM","BaseChatModelParams","BaseChatModelCallOptions","LangSmithParams","Array","BindToolsInput","BaseChatModel","RunOutput","CallOptions","OutputMessageType","Exclude","Omit","Partial","Promise","AsyncGenerator","messages","cache","llmStringKey","parsedOptions","handledOptions","SimpleChatModel"],"sources":["../../src/language_models/chat_models.d.ts"],"sourcesContent":["import type { ZodType as ZodTypeV3 } from \"zod/v3\";\nimport type { $ZodType as ZodTypeV4 } from \"zod/v4/core\";\nimport { type BaseMessage, BaseMessageChunk, type BaseMessageLike, AIMessageChunk, MessageOutputVersion } from \"../messages/index.js\";\nimport type { BasePromptValueInterface } from \"../prompt_values.js\";\nimport { LLMResult, ChatGenerationChunk, type ChatResult, type Generation } from \"../outputs.js\";\nimport { BaseLanguageModel, type StructuredOutputMethodOptions, type ToolDefinition, type BaseLanguageModelCallOptions, type BaseLanguageModelInput, type BaseLanguageModelParams } from \"./base.js\";\nimport { type CallbackManagerForLLMRun, type Callbacks } from \"../callbacks/manager.js\";\nimport type { RunnableConfig } from \"../runnables/config.js\";\nimport type { BaseCache } from \"../caches/index.js\";\nimport { StructuredToolInterface, StructuredToolParams } from \"../tools/index.js\";\nimport { Runnable, RunnableToolLike } from \"../runnables/base.js\";\nexport type ToolChoice = string | Record<string, any> | \"auto\" | \"any\";\n/**\n * Represents a serialized chat model.\n */\nexport type SerializedChatModel = {\n _model: string;\n _type: string;\n} & Record<string, any>;\n/**\n * Represents a serialized large language model.\n */\nexport type SerializedLLM = {\n _model: string;\n _type: string;\n} & Record<string, any>;\n/**\n * Represents the parameters for a base chat model.\n */\nexport type BaseChatModelParams = BaseLanguageModelParams & {\n /**\n * Whether to disable streaming.\n *\n * If streaming is bypassed, then `stream()` will defer to\n * `invoke()`.\n *\n * - If true, will always bypass streaming case.\n * - If false (default), will always use streaming case if available.\n */\n disableStreaming?: boolean;\n /**\n * Version of `AIMessage` output format to store in message content.\n *\n * `AIMessage.contentBlocks` will lazily parse the contents of `content` into a\n * standard format. This flag can be used to additionally store the standard format\n * as the message content, e.g., for serialization purposes.\n *\n * - \"v0\": provider-specific format in content (can lazily parse with `.contentBlocks`)\n * - \"v1\": standardized format in content (consistent with `.contentBlocks`)\n *\n * You can also set `LC_OUTPUT_VERSION` as an environment variable to \"v1\" to\n * enable this by default.\n *\n * @default \"v0\"\n */\n outputVersion?: MessageOutputVersion;\n};\n/**\n * Represents the call options for a base chat model.\n */\nexport type BaseChatModelCallOptions = BaseLanguageModelCallOptions & {\n /**\n * Specifies how the chat model should use tools.\n * @default undefined\n *\n * Possible values:\n * - \"auto\": The model may choose to use any of the provided tools, or none.\n * - \"any\": The model must use one of the provided tools.\n * - \"none\": The model must not use any tools.\n * - A string (not \"auto\", \"any\", or \"none\"): The name of a specific tool the model must use.\n * - An object: A custom schema specifying tool choice parameters. Specific to the provider.\n *\n * Note: Not all providers support tool_choice. An error will be thrown\n * if used with an unsupported model.\n */\n tool_choice?: ToolChoice;\n /**\n * Version of `AIMessage` output format to store in message content.\n *\n * `AIMessage.contentBlocks` will lazily parse the contents of `content` into a\n * standard format. This flag can be used to additionally store the standard format\n * as the message content, e.g., for serialization purposes.\n *\n * - \"v0\": provider-specific format in content (can lazily parse with `.contentBlocks`)\n * - \"v1\": standardized format in content (consistent with `.contentBlocks`)\n *\n * You can also set `LC_OUTPUT_VERSION` as an environment variable to \"v1\" to\n * enable this by default.\n *\n * @default \"v0\"\n */\n outputVersion?: MessageOutputVersion;\n};\nexport type LangSmithParams = {\n ls_provider?: string;\n ls_model_name?: string;\n ls_model_type: \"chat\";\n ls_temperature?: number;\n ls_max_tokens?: number;\n ls_stop?: Array<string>;\n};\nexport type BindToolsInput = StructuredToolInterface | Record<string, any> | ToolDefinition | RunnableToolLike | StructuredToolParams;\n/**\n * Base class for chat models. It extends the BaseLanguageModel class and\n * provides methods for generating chat based on input messages.\n */\nexport declare abstract class BaseChatModel<CallOptions extends BaseChatModelCallOptions = BaseChatModelCallOptions, OutputMessageType extends BaseMessageChunk = AIMessageChunk> extends BaseLanguageModel<OutputMessageType, CallOptions> {\n ParsedCallOptions: Omit<CallOptions, Exclude<keyof RunnableConfig, \"signal\" | \"timeout\" | \"maxConcurrency\">>;\n lc_namespace: string[];\n disableStreaming: boolean;\n outputVersion?: MessageOutputVersion;\n get callKeys(): string[];\n constructor(fields: BaseChatModelParams);\n _combineLLMOutput?(...llmOutputs: LLMResult[\"llmOutput\"][]): LLMResult[\"llmOutput\"];\n protected _separateRunnableConfigFromCallOptionsCompat(options?: Partial<CallOptions>): [RunnableConfig, this[\"ParsedCallOptions\"]];\n /**\n * Bind tool-like objects to this chat model.\n *\n * @param tools A list of tool definitions to bind to this chat model.\n * Can be a structured tool, an OpenAI formatted tool, or an object\n * matching the provider's specific tool schema.\n * @param kwargs Any additional parameters to bind.\n */\n bindTools?(tools: BindToolsInput[], kwargs?: Partial<CallOptions>): Runnable<BaseLanguageModelInput, OutputMessageType, CallOptions>;\n /**\n * Invokes the chat model with a single input.\n * @param input The input for the language model.\n * @param options The call options.\n * @returns A Promise that resolves to a BaseMessageChunk.\n */\n invoke(input: BaseLanguageModelInput, options?: CallOptions): Promise<OutputMessageType>;\n _streamResponseChunks(_messages: BaseMessage[], _options: this[\"ParsedCallOptions\"], _runManager?: CallbackManagerForLLMRun): AsyncGenerator<ChatGenerationChunk>;\n _streamIterator(input: BaseLanguageModelInput, options?: CallOptions): AsyncGenerator<OutputMessageType>;\n getLsParams(options: this[\"ParsedCallOptions\"]): LangSmithParams;\n /** @ignore */\n _generateUncached(messages: BaseMessageLike[][], parsedOptions: this[\"ParsedCallOptions\"], handledOptions: RunnableConfig, startedRunManagers?: CallbackManagerForLLMRun[]): Promise<LLMResult>;\n _generateCached({ messages, cache, llmStringKey, parsedOptions, handledOptions }: {\n messages: BaseMessageLike[][];\n cache: BaseCache<Generation[]>;\n llmStringKey: string;\n parsedOptions: any;\n handledOptions: RunnableConfig;\n }): Promise<LLMResult & {\n missingPromptIndices: number[];\n startedRunManagers?: CallbackManagerForLLMRun[];\n }>;\n /**\n * Generates chat based on the input messages.\n * @param messages An array of arrays of BaseMessage instances.\n * @param options The call options or an array of stop sequences.\n * @param callbacks The callbacks for the language model.\n * @returns A Promise that resolves to an LLMResult.\n */\n generate(messages: BaseMessageLike[][], options?: string[] | CallOptions, callbacks?: Callbacks): Promise<LLMResult>;\n /**\n * Get the parameters used to invoke the model\n */\n invocationParams(_options?: this[\"ParsedCallOptions\"]): any;\n _modelType(): string;\n abstract _llmType(): string;\n /**\n * Generates a prompt based on the input prompt values.\n * @param promptValues An array of BasePromptValue instances.\n * @param options The call options or an array of stop sequences.\n * @param callbacks The callbacks for the language model.\n * @returns A Promise that resolves to an LLMResult.\n */\n generatePrompt(promptValues: BasePromptValueInterface[], options?: string[] | CallOptions, callbacks?: Callbacks): Promise<LLMResult>;\n abstract _generate(messages: BaseMessage[], options: this[\"ParsedCallOptions\"], runManager?: CallbackManagerForLLMRun): Promise<ChatResult>;\n withStructuredOutput<RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: ZodTypeV4<RunOutput> | Record<string, any>, config?: StructuredOutputMethodOptions<false>): Runnable<BaseLanguageModelInput, RunOutput>;\n withStructuredOutput<RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: ZodTypeV4<RunOutput> | Record<string, any>, config?: StructuredOutputMethodOptions<true>): Runnable<BaseLanguageModelInput, {\n raw: BaseMessage;\n parsed: RunOutput;\n }>;\n withStructuredOutput<RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: ZodTypeV3<RunOutput> | Record<string, any>, config?: StructuredOutputMethodOptions<false>): Runnable<BaseLanguageModelInput, RunOutput>;\n withStructuredOutput<RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: ZodTypeV3<RunOutput> | Record<string, any>, config?: StructuredOutputMethodOptions<true>): Runnable<BaseLanguageModelInput, {\n raw: BaseMessage;\n parsed: RunOutput;\n }>;\n}\n/**\n * An abstract class that extends BaseChatModel and provides a simple\n * implementation of _generate.\n */\nexport declare abstract class SimpleChatModel<CallOptions extends BaseChatModelCallOptions = BaseChatModelCallOptions> extends BaseChatModel<CallOptions> {\n abstract _call(messages: BaseMessage[], options: this[\"ParsedCallOptions\"], runManager?: CallbackManagerForLLMRun): Promise<string>;\n _generate(messages: BaseMessage[], options: this[\"ParsedCallOptions\"], runManager?: CallbackManagerForLLMRun): Promise<ChatResult>;\n}\n//# sourceMappingURL=chat_models.d.ts.map"],"mappings":";;;;;;;;;;;;;;;;;;KAWY4B,UAAAA,YAAsBC;;;;KAItBC,mBAAAA;;;AAJZ,CAAA,GAOID,MAPQD,CAAAA,MAAU,EAAA,GAAA,CAAA;AAItB;AAOA;AAOA;AA+BYK,KAtCAF,aAAAA,GAsCAE;EAA2BhB,MAAAA,EAAAA,MAAAA;EAerBW,KAAAA,EAAAA,MAAAA;CAgBE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CAjCbF,SAiCaE,CAAAA;EAARgC;;AAFyB;;;;;;;;;;;+BAjB3GnC,iDAAiD8B,yBAAyBlB,YAAYuB,QAAQlC;+BAC9FN,gEAAgEgB,2BAA2BwB,QAAQhC;yCACzFiB,sBAAsBA,mCAAmC1B,SAAUmC,aAAaT,8BAA8Bd,uCAAuCW,SAASR,wBAAwBoB;yCACtLT,sBAAsBA,mCAAmC1B,SAAUmC,aAAaT,8BAA8Bd,sCAAsCW,SAASR;SAC3Ld;YACGkC;;yCAE2BT,sBAAsBA,mCAAmC5B,QAAUqC,aAAaT,8BAA8Bd,uCAAuCW,SAASR,wBAAwBoB;yCACtLT,sBAAsBA,mCAAmC5B,QAAUqC,aAAaT,8BAA8Bd,sCAAsCW,SAASR;SAC3Ld;YACGkC;;;;;;;uBAOca,oCAAoClB,2BAA2BA,kCAAkCI,cAAcE;2BAChHnC,gEAAgEgB,2BAA2BwB;sBAChGxC,gEAAgEgB,2BAA2BwB,QAAQhC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":["OptionalImportMap","SecretMap","load","T","Record","Promise"],"sources":["../../src/load/index.d.ts"],"sourcesContent":["import type { OptionalImportMap, SecretMap } from \"./import_type.js\";\nexport declare function load<T>(text: string, mappings?: {\n secretsMap?: SecretMap;\n optionalImportsMap?: OptionalImportMap;\n optionalImportEntrypoints?: string[];\n importMap?: Record<string, unknown>;\n}): Promise<T>;\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;iBACwBE,8BAIRE;eAHCH;EADOC,kBAAIC,
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":["OptionalImportMap","SecretMap","load","T","Record","Promise"],"sources":["../../src/load/index.d.ts"],"sourcesContent":["import type { OptionalImportMap, SecretMap } from \"./import_type.js\";\nexport declare function load<T>(text: string, mappings?: {\n secretsMap?: SecretMap;\n optionalImportsMap?: OptionalImportMap;\n optionalImportEntrypoints?: string[];\n importMap?: Record<string, unknown>;\n}): Promise<T>;\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;iBACwBE,8BAIRE;eAHCH;EADOC,kBAAIC,CAAA,EAEHH,iBAFG;EACXC,yBAAAA,CAAAA,EAAAA,MAAAA,EAAAA;EACQD,SAAAA,CAAAA,EAETI,MAFSJ,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA;CAETI,CAAAA,EACZC,OADYD,CACJD,CADIC,CAAAA"}
|
package/dist/memory.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.d.ts","names":["InputValues","Record","OutputValues","MemoryVariables","BaseMemory","Promise","getInputValue","getOutputValue","getPromptInputKey"],"sources":["../src/memory.d.ts"],"sourcesContent":["/**\n * Type alias for a record where the keys are strings and the values can\n * be any type. This is used to represent the input values for a Chain.\n */\nexport type InputValues = Record<string, any>;\n/**\n * Type alias for a record where the keys are strings and the values can\n * be any type. This is used to represent the output values from a Chain.\n */\nexport type OutputValues = Record<string, any>;\n/**\n * Type alias for a record where the keys are strings and the values can\n * be any type. This is used to represent the memory variables in a Chain.\n */\nexport type MemoryVariables = Record<string, any>;\n/**\n * Abstract base class for memory in LangChain's Chains. Memory refers to\n * the state in Chains. It can be used to store information about past\n * executions of a Chain and inject that information into the inputs of\n * future executions of the Chain.\n */\nexport declare abstract class BaseMemory {\n abstract get memoryKeys(): string[];\n /**\n * Abstract method that should take an object of input values and return a\n * Promise that resolves with an object of memory variables. The\n * implementation of this method should load the memory variables from the\n * provided input values.\n * @param values An object of input values.\n * @returns Promise that resolves with an object of memory variables.\n */\n abstract loadMemoryVariables(values: InputValues): Promise<MemoryVariables>;\n /**\n * Abstract method that should take two objects, one of input values and\n * one of output values, and return a Promise that resolves when the\n * context has been saved. The implementation of this method should save\n * the context based on the provided input and output values.\n * @param inputValues An object of input values.\n * @param outputValues An object of output values.\n * @returns Promise that resolves when the context has been saved.\n */\n abstract saveContext(inputValues: InputValues, outputValues: OutputValues): Promise<void>;\n}\n/**\n * This function is used by memory classes to select the input value\n * to use for the memory. If there is only one input value, it is used.\n * If there are multiple input values, the inputKey must be specified.\n */\nexport declare const getInputValue: (inputValues: InputValues, inputKey?: string | undefined) => any;\n/**\n * This function is used by memory classes to select the output value\n * to use for the memory. If there is only one output value, it is used.\n * If there are multiple output values, the outputKey must be specified.\n * If no outputKey is specified, an error is thrown.\n */\nexport declare const getOutputValue: (outputValues: OutputValues, outputKey?: string | undefined) => any;\n/**\n * Function used by memory classes to get the key of the prompt input,\n * excluding any keys that are memory variables or the \"stop\" key. If\n * there is not exactly one prompt input key, an error is thrown.\n */\nexport declare function getPromptInputKey(inputs: Record<string, unknown>, memoryVariables: string[]): string;\n//# sourceMappingURL=memory.d.ts.map"],"mappings":";;AAIA;AAKA;AAKA;AAO8BI,KAjBlBJ,WAAAA,GAAcC,MAiBc,CAAA,MAAA,EAAA,GAAA,CAAA;;;;;AAoByBC,KAhCrDA,YAAAA,GAAeD,MAgCsCC,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA;;AAAsB;AAOvF;AAOA;AAMwBM,KA/CZL,eAAAA,GAAkBF,MA+
|
|
1
|
+
{"version":3,"file":"memory.d.ts","names":["InputValues","Record","OutputValues","MemoryVariables","BaseMemory","Promise","getInputValue","getOutputValue","getPromptInputKey"],"sources":["../src/memory.d.ts"],"sourcesContent":["/**\n * Type alias for a record where the keys are strings and the values can\n * be any type. This is used to represent the input values for a Chain.\n */\nexport type InputValues = Record<string, any>;\n/**\n * Type alias for a record where the keys are strings and the values can\n * be any type. This is used to represent the output values from a Chain.\n */\nexport type OutputValues = Record<string, any>;\n/**\n * Type alias for a record where the keys are strings and the values can\n * be any type. This is used to represent the memory variables in a Chain.\n */\nexport type MemoryVariables = Record<string, any>;\n/**\n * Abstract base class for memory in LangChain's Chains. Memory refers to\n * the state in Chains. It can be used to store information about past\n * executions of a Chain and inject that information into the inputs of\n * future executions of the Chain.\n */\nexport declare abstract class BaseMemory {\n abstract get memoryKeys(): string[];\n /**\n * Abstract method that should take an object of input values and return a\n * Promise that resolves with an object of memory variables. The\n * implementation of this method should load the memory variables from the\n * provided input values.\n * @param values An object of input values.\n * @returns Promise that resolves with an object of memory variables.\n */\n abstract loadMemoryVariables(values: InputValues): Promise<MemoryVariables>;\n /**\n * Abstract method that should take two objects, one of input values and\n * one of output values, and return a Promise that resolves when the\n * context has been saved. The implementation of this method should save\n * the context based on the provided input and output values.\n * @param inputValues An object of input values.\n * @param outputValues An object of output values.\n * @returns Promise that resolves when the context has been saved.\n */\n abstract saveContext(inputValues: InputValues, outputValues: OutputValues): Promise<void>;\n}\n/**\n * This function is used by memory classes to select the input value\n * to use for the memory. If there is only one input value, it is used.\n * If there are multiple input values, the inputKey must be specified.\n */\nexport declare const getInputValue: (inputValues: InputValues, inputKey?: string | undefined) => any;\n/**\n * This function is used by memory classes to select the output value\n * to use for the memory. If there is only one output value, it is used.\n * If there are multiple output values, the outputKey must be specified.\n * If no outputKey is specified, an error is thrown.\n */\nexport declare const getOutputValue: (outputValues: OutputValues, outputKey?: string | undefined) => any;\n/**\n * Function used by memory classes to get the key of the prompt input,\n * excluding any keys that are memory variables or the \"stop\" key. If\n * there is not exactly one prompt input key, an error is thrown.\n */\nexport declare function getPromptInputKey(inputs: Record<string, unknown>, memoryVariables: string[]): string;\n//# sourceMappingURL=memory.d.ts.map"],"mappings":";;AAIA;AAKA;AAKA;AAO8BI,KAjBlBJ,WAAAA,GAAcC,MAiBc,CAAA,MAAA,EAAA,GAAA,CAAA;;;;;AAoByBC,KAhCrDA,YAAAA,GAAeD,MAgCsCC,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA;;AAAsB;AAOvF;AAOA;AAMwBM,KA/CZL,eAAAA,GAAkBF,MA+CW,CAASA,MAAM,EAAA,GAAA,CAAA;;;;;;;uBAxC1BG,UAAAA;;;;;;;;;;uCAUWJ,cAAcK,QAAQF;;;;;;;;;;oCAUzBH,2BAA2BE,eAAeG;;;;;;;cAO3DC,6BAA6BN;;;;;;;cAO7BO,+BAA+BL;;;;;;iBAM5BM,iBAAAA,SAA0BP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool.d.cts","names":["BaseMessage","BaseMessageChunk","BaseMessageFields","$InferMessageContent","MessageStructure","ToolMessageFields","TStructure","Record","DirectToolOutput","isDirectToolOutput","ToolMessage","ToolMessageChunk","ToolCall","TName","TArgs","ToolCallChunk","InvalidToolCall","defaultToolCallParser","isToolMessage","isToolMessageChunk"],"sources":["../../src/messages/tool.d.ts"],"sourcesContent":["import { BaseMessage, BaseMessageChunk, type BaseMessageFields } from \"./base.js\";\nimport { $InferMessageContent, MessageStructure } from \"./message.js\";\nexport interface ToolMessageFields<TStructure extends MessageStructure = MessageStructure> extends BaseMessageFields<TStructure, \"tool\"> {\n /**\n * Artifact of the Tool execution which is not meant to be sent to the model.\n *\n * Should only be specified if it is different from the message content, e.g. if only\n * a subset of the full tool output is being passed as message content but the full\n * output is needed in other parts of the code.\n */\n artifact?: any;\n tool_call_id: string;\n status?: \"success\" | \"error\";\n metadata?: Record<string, unknown>;\n}\n/**\n * Marker parameter for objects that tools can return directly.\n *\n * If a custom BaseTool is invoked with a ToolCall and the output of custom code is\n * not an instance of DirectToolOutput, the output will automatically be coerced to\n * a string and wrapped in a ToolMessage.\n */\nexport interface DirectToolOutput {\n readonly lc_direct_tool_output: true;\n}\nexport declare function isDirectToolOutput(x: unknown): x is DirectToolOutput;\n/**\n * Represents a tool message in a conversation.\n */\nexport declare class ToolMessage<TStructure extends MessageStructure = MessageStructure> extends BaseMessage<TStructure, \"tool\"> implements DirectToolOutput {\n static lc_name(): string;\n get lc_aliases(): Record<string, string>;\n lc_direct_tool_output: true;\n readonly type: \"tool\";\n /**\n * Status of the tool invocation.\n * @version 0.2.19\n */\n status?: \"success\" | \"error\";\n tool_call_id: string;\n metadata?: Record<string, unknown>;\n /**\n * Artifact of the Tool execution which is not meant to be sent to the model.\n *\n * Should only be specified if it is different from the message content, e.g. if only\n * a subset of the full tool output is being passed as message content but the full\n * output is needed in other parts of the code.\n */\n artifact?: any;\n constructor(fields: $InferMessageContent<TStructure, \"tool\"> | ToolMessageFields, tool_call_id: string, name?: string);\n constructor(fields: ToolMessageFields<TStructure>);\n static isInstance(message: unknown): message is ToolMessage;\n get _printableFields(): Record<string, unknown>;\n}\n/**\n * Represents a chunk of a tool message, which can be concatenated\n * with other tool message chunks.\n */\nexport declare class ToolMessageChunk<TStructure extends MessageStructure = MessageStructure> extends BaseMessageChunk<TStructure, \"tool\"> {\n readonly type: \"tool\";\n tool_call_id: string;\n /**\n * Status of the tool invocation.\n * @version 0.2.19\n */\n status?: \"success\" | \"error\";\n /**\n * Artifact of the Tool execution which is not meant to be sent to the model.\n *\n * Should only be specified if it is different from the message content, e.g. if only\n * a subset of the full tool output is being passed as message content but the full\n * output is needed in other parts of the code.\n */\n artifact?: any;\n constructor(fields: ToolMessageFields<TStructure>);\n static lc_name(): string;\n concat(chunk: ToolMessageChunk<TStructure>): this;\n get _printableFields(): Record<string, unknown>;\n}\nexport interface ToolCall<TName extends string = string, TArgs extends Record<string, any> = Record<string, any>> {\n readonly type?: \"tool_call\";\n /**\n * If provided, an identifier associated with the tool call\n */\n id?: string;\n /**\n * The name of the tool being called\n */\n name: TName;\n /**\n * The arguments to the tool call\n */\n args: TArgs;\n}\n/**\n * A chunk of a tool call (e.g., as part of a stream).\n * When merging ToolCallChunks (e.g., via AIMessageChunk.__add__),\n * all string attributes are concatenated. Chunks are only merged if their\n * values of `index` are equal and not None.\n *\n * @example\n * ```ts\n * const leftChunks = [\n * {\n * name: \"foo\",\n * args: '{\"a\":',\n * index: 0\n * }\n * ];\n *\n * const leftAIMessageChunk = new AIMessageChunk({\n * content: \"\",\n * tool_call_chunks: leftChunks\n * });\n *\n * const rightChunks = [\n * {\n * name: undefined,\n * args: '1}',\n * index: 0\n * }\n * ];\n *\n * const rightAIMessageChunk = new AIMessageChunk({\n * content: \"\",\n * tool_call_chunks: rightChunks\n * });\n *\n * const result = leftAIMessageChunk.concat(rightAIMessageChunk);\n * // result.tool_call_chunks is equal to:\n * // [\n * // {\n * // name: \"foo\",\n * // args: '{\"a\":1}'\n * // index: 0\n * // }\n * // ]\n * ```\n */\nexport interface ToolCallChunk<TName extends string = string> {\n readonly type?: \"tool_call_chunk\";\n /**\n * If provided, a substring of an identifier for the tool call\n */\n id?: string;\n /**\n * If provided, a substring of the name of the tool to be called\n */\n name?: TName;\n /**\n * If provided, a JSON substring of the arguments to the tool call\n */\n args?: string;\n /**\n * If provided, the index of the tool call in a sequence\n */\n index?: number;\n}\nexport interface InvalidToolCall<TName extends string = string> {\n readonly type?: \"invalid_tool_call\";\n /**\n * If provided, an identifier associated with the tool call\n */\n id?: string;\n /**\n /**\n * The name of the tool being called\n */\n name?: TName;\n /**\n * The arguments to the tool call\n */\n args?: string;\n /**\n * An error message associated with the tool call\n */\n error?: string;\n /**\n * Index of block in aggregate response\n */\n index?: string | number;\n}\nexport declare function defaultToolCallParser(rawToolCalls: Record<string, any>[]): [ToolCall[], InvalidToolCall[]];\n/**\n * @deprecated Use {@link ToolMessage.isInstance} instead\n */\nexport declare function isToolMessage(x: unknown): x is ToolMessage;\n/**\n * @deprecated Use {@link ToolMessageChunk.isInstance} instead\n */\nexport declare function isToolMessageChunk(x: BaseMessageChunk): x is ToolMessageChunk;\n//# sourceMappingURL=tool.d.ts.map"],"mappings":";;;;UAEiBK,qCAAqCD,mBAAmBA,0BAA0BF,kBAAkBI;;AAArH;;;;;;EAAoH,QAAA,CAAA,EAAA,GAAA;EAoBnGE,YAAAA,EAAAA,MAAgB;EAGTC,MAAAA,CAAAA,EAAAA,SAAAA,GAAkB,OAAA;EAIrBC,QAAAA,CAAAA,EAhBNH,MAgBiB,CAAA,MAAAD,EAAAA,OAAAA,CAAAA;;;;;;;;;AAqBUA,UA5BzBE,gBAAAA,CA4ByBF;EAAlBD,SAAAA,qBAAAA,EAAAA,IAAAA;;AAEIE,iBA3BJE,kBAAAA,CA2BIF,CAAAA,EAAAA,OAAAA,CAAAA,EAAAA,CAAAA,IA3BiCC,gBA2BjCD;;;AAvBgI;AA6BvII,cA7BAD,WA6BgBJ,CAAAA,mBA7BeF,gBA6Bf,GA7BkCA,gBA6BlC,CAAA,SA7B4DJ,WA6B5D,CA7BwEM,UA6BxE,EAAA,MAAA,CAAA,YA7BuGE,gBA6BvG,CAAA;EAAoBJ,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAmBA,IAAAA,UAAAA,CAAAA,CAAAA,EA3BtDG,MA2BsDH,CAAAA,MAAAA,EAAAA,MAAAA,CAAAA;EAA2CE,qBAAAA,EAAAA,IAAAA;EAgB7EA,SAAAA,IAAAA,EAAAA,MAAAA;EAAlBD;;;;EAhB8EJ,MAAAA,CAAAA,EAAAA,SAAAA,GAAAA,OAAAA;EAAgB,YAAA,EAAA,MAAA;EAqBrGW,QAAAA,CAAAA,EAvCFL,
|
|
1
|
+
{"version":3,"file":"tool.d.cts","names":["BaseMessage","BaseMessageChunk","BaseMessageFields","$InferMessageContent","MessageStructure","ToolMessageFields","TStructure","Record","DirectToolOutput","isDirectToolOutput","ToolMessage","ToolMessageChunk","ToolCall","TName","TArgs","ToolCallChunk","InvalidToolCall","defaultToolCallParser","isToolMessage","isToolMessageChunk"],"sources":["../../src/messages/tool.d.ts"],"sourcesContent":["import { BaseMessage, BaseMessageChunk, type BaseMessageFields } from \"./base.js\";\nimport { $InferMessageContent, MessageStructure } from \"./message.js\";\nexport interface ToolMessageFields<TStructure extends MessageStructure = MessageStructure> extends BaseMessageFields<TStructure, \"tool\"> {\n /**\n * Artifact of the Tool execution which is not meant to be sent to the model.\n *\n * Should only be specified if it is different from the message content, e.g. if only\n * a subset of the full tool output is being passed as message content but the full\n * output is needed in other parts of the code.\n */\n artifact?: any;\n tool_call_id: string;\n status?: \"success\" | \"error\";\n metadata?: Record<string, unknown>;\n}\n/**\n * Marker parameter for objects that tools can return directly.\n *\n * If a custom BaseTool is invoked with a ToolCall and the output of custom code is\n * not an instance of DirectToolOutput, the output will automatically be coerced to\n * a string and wrapped in a ToolMessage.\n */\nexport interface DirectToolOutput {\n readonly lc_direct_tool_output: true;\n}\nexport declare function isDirectToolOutput(x: unknown): x is DirectToolOutput;\n/**\n * Represents a tool message in a conversation.\n */\nexport declare class ToolMessage<TStructure extends MessageStructure = MessageStructure> extends BaseMessage<TStructure, \"tool\"> implements DirectToolOutput {\n static lc_name(): string;\n get lc_aliases(): Record<string, string>;\n lc_direct_tool_output: true;\n readonly type: \"tool\";\n /**\n * Status of the tool invocation.\n * @version 0.2.19\n */\n status?: \"success\" | \"error\";\n tool_call_id: string;\n metadata?: Record<string, unknown>;\n /**\n * Artifact of the Tool execution which is not meant to be sent to the model.\n *\n * Should only be specified if it is different from the message content, e.g. if only\n * a subset of the full tool output is being passed as message content but the full\n * output is needed in other parts of the code.\n */\n artifact?: any;\n constructor(fields: $InferMessageContent<TStructure, \"tool\"> | ToolMessageFields, tool_call_id: string, name?: string);\n constructor(fields: ToolMessageFields<TStructure>);\n static isInstance(message: unknown): message is ToolMessage;\n get _printableFields(): Record<string, unknown>;\n}\n/**\n * Represents a chunk of a tool message, which can be concatenated\n * with other tool message chunks.\n */\nexport declare class ToolMessageChunk<TStructure extends MessageStructure = MessageStructure> extends BaseMessageChunk<TStructure, \"tool\"> {\n readonly type: \"tool\";\n tool_call_id: string;\n /**\n * Status of the tool invocation.\n * @version 0.2.19\n */\n status?: \"success\" | \"error\";\n /**\n * Artifact of the Tool execution which is not meant to be sent to the model.\n *\n * Should only be specified if it is different from the message content, e.g. if only\n * a subset of the full tool output is being passed as message content but the full\n * output is needed in other parts of the code.\n */\n artifact?: any;\n constructor(fields: ToolMessageFields<TStructure>);\n static lc_name(): string;\n concat(chunk: ToolMessageChunk<TStructure>): this;\n get _printableFields(): Record<string, unknown>;\n}\nexport interface ToolCall<TName extends string = string, TArgs extends Record<string, any> = Record<string, any>> {\n readonly type?: \"tool_call\";\n /**\n * If provided, an identifier associated with the tool call\n */\n id?: string;\n /**\n * The name of the tool being called\n */\n name: TName;\n /**\n * The arguments to the tool call\n */\n args: TArgs;\n}\n/**\n * A chunk of a tool call (e.g., as part of a stream).\n * When merging ToolCallChunks (e.g., via AIMessageChunk.__add__),\n * all string attributes are concatenated. Chunks are only merged if their\n * values of `index` are equal and not None.\n *\n * @example\n * ```ts\n * const leftChunks = [\n * {\n * name: \"foo\",\n * args: '{\"a\":',\n * index: 0\n * }\n * ];\n *\n * const leftAIMessageChunk = new AIMessageChunk({\n * content: \"\",\n * tool_call_chunks: leftChunks\n * });\n *\n * const rightChunks = [\n * {\n * name: undefined,\n * args: '1}',\n * index: 0\n * }\n * ];\n *\n * const rightAIMessageChunk = new AIMessageChunk({\n * content: \"\",\n * tool_call_chunks: rightChunks\n * });\n *\n * const result = leftAIMessageChunk.concat(rightAIMessageChunk);\n * // result.tool_call_chunks is equal to:\n * // [\n * // {\n * // name: \"foo\",\n * // args: '{\"a\":1}'\n * // index: 0\n * // }\n * // ]\n * ```\n */\nexport interface ToolCallChunk<TName extends string = string> {\n readonly type?: \"tool_call_chunk\";\n /**\n * If provided, a substring of an identifier for the tool call\n */\n id?: string;\n /**\n * If provided, a substring of the name of the tool to be called\n */\n name?: TName;\n /**\n * If provided, a JSON substring of the arguments to the tool call\n */\n args?: string;\n /**\n * If provided, the index of the tool call in a sequence\n */\n index?: number;\n}\nexport interface InvalidToolCall<TName extends string = string> {\n readonly type?: \"invalid_tool_call\";\n /**\n * If provided, an identifier associated with the tool call\n */\n id?: string;\n /**\n /**\n * The name of the tool being called\n */\n name?: TName;\n /**\n * The arguments to the tool call\n */\n args?: string;\n /**\n * An error message associated with the tool call\n */\n error?: string;\n /**\n * Index of block in aggregate response\n */\n index?: string | number;\n}\nexport declare function defaultToolCallParser(rawToolCalls: Record<string, any>[]): [ToolCall[], InvalidToolCall[]];\n/**\n * @deprecated Use {@link ToolMessage.isInstance} instead\n */\nexport declare function isToolMessage(x: unknown): x is ToolMessage;\n/**\n * @deprecated Use {@link To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,EAAAA,MAAAA,CAAAA,GArIOF,iBAqIPE,EAAAA,YAAAA,EAAAA,MAAAA,EAAAA,IAAAA,CAAAA,EAAAA,MAAAA;EAAyBK,WAAAA,CAAAA,MAAAA,EApI7DP,iBAoI6DO,CApI3CN,UAoI2CM,CAAAA;EAAYI,OAAAA,UAAAA,CAAAA,OAAAA,EAAAA,OAAAA,CAAAA,EAAAA,OAAAA,IAnI7CN,WAmI6CM;EAAe,IAAA,gBAAA,CAAA,CAAA,EAlIpFT,MAkIoF,CAAA,MAAA,EAAA,OAAA,CAAA;AAIhH;AAIA;;;;cApIqBI,oCAAoCP,mBAAmBA,0BAA0BH,iBAAiBK;;;;;;;;;;;;;;;;sBAgB/FD,kBAAkBC;;gBAExBK,iBAAiBL;0BACPC;;UAEXK,sDAAsDL,sBAAsBA;;;;;;;;;QASnFM;;;;QAIAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA+COC;;;;;;;;;SASNF;;;;;;;;;;UAUMG;;;;;;;;;;SAUNH;;;;;;;;;;;;;;iBAcaI,qBAAAA,eAAoCV,yBAAyBK,YAAYI;;;;iBAIzEE,aAAAA,mBAAgCR;;;;iBAIhCS,kBAAAA,IAAsBlB,wBAAwBU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vectorstores.d.cts","names":["EmbeddingsInterface","DocumentInterface","BaseRetriever","BaseRetrieverInterface","BaseRetrieverInput","Serializable","CallbackManagerForRetrieverRun","Callbacks","AddDocumentOptions","Record","MaxMarginalRelevanceSearchOptions","FilterType","VectorStoreRetrieverMMRSearchKwargs","VectorStoreRetrieverInput","V","VectorStoreInterface","VectorStoreRetrieverInterface","Promise","VectorStoreRetriever","Partial","VectorStore","SaveableVectorStore"],"sources":["../src/vectorstores.d.ts"],"sourcesContent":["import type { EmbeddingsInterface } from \"./embeddings.js\";\nimport type { DocumentInterface } from \"./documents/document.js\";\nimport { BaseRetriever, BaseRetrieverInterface, type BaseRetrieverInput } from \"./retrievers/index.js\";\nimport { Serializable } from \"./load/serializable.js\";\nimport { CallbackManagerForRetrieverRun, Callbacks } from \"./callbacks/manager.js\";\n/**\n * Type for options when adding a document to the VectorStore.\n */\ntype AddDocumentOptions = Record<string, any>;\n/**\n * Options for configuring a maximal marginal relevance (MMR) search.\n *\n * MMR search optimizes for both similarity to the query and diversity\n * among the results, balancing the retrieval of relevant documents\n * with variation in the content returned.\n *\n * Fields:\n *\n * - `fetchK` (optional): The initial number of documents to retrieve from the\n * vector store before applying the MMR algorithm. This larger set provides a\n * pool of documents from which the algorithm can select the most diverse\n * results based on relevance to the query.\n *\n * - `filter` (optional): A filter of type `FilterType` to refine the search\n * results, allowing additional conditions to target specific subsets\n * of documents.\n *\n * - `k`: The number of documents to return in the final results. This is the\n * primary count of documents that are most relevant to the query.\n *\n * - `lambda` (optional): A value between 0 and 1 that determines the balance\n * between relevance and diversity:\n * - A `lambda` of 0 emphasizes diversity, maximizing content variation.\n * - A `lambda` of 1 emphasizes similarity to the query, focusing on relevance.\n * Values between 0 and 1 provide a mix of relevance and diversity.\n *\n * @template FilterType - The type used for filtering results, as defined\n * by the vector store.\n */\nexport type MaxMarginalRelevanceSearchOptions<FilterType> = {\n k: number;\n fetchK?: number;\n lambda?: number;\n filter?: FilterType;\n};\n/**\n * Options for configuring a maximal marginal relevance (MMR) search\n * when using the `VectorStoreRetriever`.\n *\n * These parameters control how the MMR algorithm balances relevance to the\n * query and diversity among the retrieved documents.\n *\n * Fields:\n * - `fetchK` (optional): Specifies the initial number of documents to fetch\n * before applying the MMR algorithm. This larger set provides a pool of\n * documents from which the algorithm can select the most diverse results\n * based on relevance to the query.\n *\n * - `lambda` (optional): A value between 0 and 1 that determines the balance\n * between relevance and diversity:\n * - A `lambda` of 0 maximizes diversity among the results, prioritizing varied content.\n * - A `lambda` of 1 maximizes similarity to the query, prioritizing relevance.\n * Values between 0 and 1 provide a mix of relevance and diversity.\n */\nexport type VectorStoreRetrieverMMRSearchKwargs = {\n fetchK?: number;\n lambda?: number;\n};\n/**\n * Input configuration options for creating a `VectorStoreRetriever` instance.\n *\n * This type combines properties from `BaseRetrieverInput` with specific settings\n * for the `VectorStoreRetriever`, including options for similarity or maximal\n * marginal relevance (MMR) search types.\n *\n * Fields:\n *\n * - `callbacks` (optional): An array of callback functions that handle various\n * events during retrieval, such as logging, error handling, or progress updates.\n *\n * - `tags` (optional): An array of strings used to add contextual tags to\n * retrieval operations, allowing for easier categorization and tracking.\n *\n * - `metadata` (optional): A record of key-value pairs to store additional\n * contextual information for retrieval operations, which can be useful\n * for logging or auditing purposes.\n *\n * - `verbose` (optional): A boolean flag that, if set to `true`, enables\n * detailed logging and output during the retrieval process. Defaults to `false`.\n *\n * - `vectorStore`: The `VectorStore` instance implementing `VectorStoreInterface`\n * that will be used for document storage and retrieval.\n *\n * - `k` (optional): Specifies the number of documents to retrieve per search\n * query. Defaults to 4 if not specified.\n *\n * - `filter` (optional): A filter of type `FilterType` (defined by the vector store)\n * to refine the set of documents returned, allowing for targeted search results.\n *\n * - `searchType`: Determines the type of search to perform:\n * - `\"similarity\"`: Executes a similarity search, retrieving documents based purely\n * on vector similarity to the query.\n * - `\"mmr\"`: Executes a maximal marginal relevance (MMR) search, balancing similarity\n * and diversity in the search results.\n *\n * - `searchKwargs` (optional): Used only if `searchType` is `\"mmr\"`, this object\n * provides additional options for MMR search, including:\n * - `fetchK`: Specifies the number of documents to initially fetch before applying\n * the MMR algorithm, providing a pool from which the most diverse results are selected.\n * - `lambda`: A diversity parameter, where 0 emphasizes diversity and 1 emphasizes\n * relevance to the query. Values between 0 and 1 provide a balance of relevance and diversity.\n *\n * @template V - The type of vector store implementing `VectorStoreInterface`.\n */\nexport type VectorStoreRetrieverInput<V extends VectorStoreInterface> = BaseRetrieverInput & ({\n vectorStore: V;\n k?: number;\n filter?: V[\"FilterType\"];\n searchType?: \"similarity\";\n} | {\n vectorStore: V;\n k?: number;\n filter?: V[\"FilterType\"];\n searchType: \"mmr\";\n searchKwargs?: VectorStoreRetrieverMMRSearchKwargs;\n});\n/**\n * Interface for a retriever that uses a vector store to store and retrieve\n * document embeddings. This retriever interface allows for adding documents\n * to the underlying vector store and conducting retrieval operations.\n *\n * `VectorStoreRetrieverInterface` extends `BaseRetrieverInterface` to provide\n * document retrieval capabilities based on vector similarity.\n *\n * @interface VectorStoreRetrieverInterface\n * @extends BaseRetrieverInterface\n */\nexport interface VectorStoreRetrieverInterface<V extends VectorStoreInterface = VectorStoreInterface> extends BaseRetrieverInterface {\n vectorStore: V;\n /**\n * Adds an array of documents to the vector store.\n *\n * This method embeds the provided documents and stores them within the\n * vector store. Additional options can be specified for custom behavior\n * during the addition process.\n *\n * @param documents - An array of documents to embed and add to the vector store.\n * @param options - Optional settings to customize document addition.\n * @returns A promise that resolves to an array of document IDs or `void`,\n * depending on the implementation.\n */\n addDocuments(documents: DocumentInterface[], options?: AddDocumentOptions): Promise<string[] | void>;\n}\n/**\n * Class for retrieving documents from a `VectorStore` based on vector similarity\n * or maximal marginal relevance (MMR).\n *\n * `VectorStoreRetriever` extends `BaseRetriever`, implementing methods for\n * adding documents to the underlying vector store and performing document\n * retrieval with optional configurations.\n *\n * @class VectorStoreRetriever\n * @extends BaseRetriever\n * @implements VectorStoreRetrieverInterface\n * @template V - Type of vector store implementing `VectorStoreInterface`.\n */\nexport declare class VectorStoreRetriever<V extends VectorStoreInterface = VectorStoreInterface> extends BaseRetriever implements VectorStoreRetrieverInterface {\n static lc_name(): string;\n get lc_namespace(): string[];\n /**\n * The instance of `VectorStore` used for storing and retrieving document embeddings.\n * This vector store must implement the `VectorStoreInterface` to be compatible\n * with the retriever’s operations.\n */\n vectorStore: V;\n /**\n * Specifies the number of documents to retrieve for each search query.\n * Defaults to 4 if not specified, providing a basic result count for similarity or MMR searches.\n */\n k: number;\n /**\n * Determines the type of search operation to perform on the vector store.\n *\n * - `\"similarity\"` (default): Conducts a similarity search based purely on vector similarity\n * to the query.\n * - `\"mmr\"`: Executes a maximal marginal relevance (MMR) search, balancing relevance and\n * diversity in the retrieved results.\n */\n searchType: string;\n /**\n * Additional options specific to maximal marginal relevance (MMR) search, applicable\n * only if `searchType` is set to `\"mmr\"`.\n *\n * Includes:\n * - `fetchK`: The initial number of documents fetched before applying the MMR algorithm,\n * allowing for a larger selection from which to choose the most diverse results.\n * - `lambda`: A parameter between 0 and 1 to adjust the relevance-diversity balance,\n * where 0 prioritizes diversity and 1 prioritizes relevance.\n */\n searchKwargs?: VectorStoreRetrieverMMRSearchKwargs;\n /**\n * Optional filter applied to search results, defined by the `FilterType` of the vector store.\n * Allows for refined, targeted results by restricting the returned documents based\n * on specified filter criteria.\n */\n filter?: V[\"FilterType\"];\n /**\n * Returns the type of vector store, as defined by the `vectorStore` instance.\n *\n * @returns {string} The vector store type.\n */\n _vectorstoreType(): string;\n /**\n * Initializes a new instance of `VectorStoreRetriever` with the specified configuration.\n *\n * This constructor configures the retriever to interact with a given `VectorStore`\n * and supports different retrieval strategies, including similarity search and maximal\n * marginal relevance (MMR) search. Various options allow customization of the number\n * of documents retrieved per query, filtering based on conditions, and fine-tuning\n * MMR-specific parameters.\n *\n * @param fields - Configuration options for setting up the retriever:\n *\n * - `vectorStore` (required): The `VectorStore` instance implementing `VectorStoreInterface`\n * that will be used to store and retrieve document embeddings. This is the core component\n * of the retriever, enabling vector-based similarity and MMR searches.\n *\n * - `k` (optional): Specifies the number of documents to retrieve per search query. If not\n * provided, defaults to 4. This count determines the number of most relevant documents returned\n * for each search operation, balancing performance with comprehensiveness.\n *\n * - `searchType` (optional): Defines the search approach used by the retriever, allowing for\n * flexibility between two methods:\n * - `\"similarity\"` (default): A similarity-based search, retrieving documents with high vector\n * similarity to the query. This type prioritizes relevance and is often used when diversity\n * among results is less critical.\n * - `\"mmr\"`: Maximal Marginal Relevance search, which combines relevance with diversity. MMR\n * is useful for scenarios where varied content is essential, as it selects results that\n * both match the query and introduce content diversity.\n *\n * - `filter` (optional): A filter of type `FilterType`, defined by the vector store, that allows\n * for refined and targeted search results. This filter applies specified conditions to limit\n * which documents are eligible for retrieval, offering control over the scope of results.\n *\n * - `searchKwargs` (optional, applicable only if `searchType` is `\"mmr\"`): Additional settings\n * for configuring MMR-specific behavior. These parameters allow further tuning of the MMR\n * search process:\n * - `fetchK`: The initial number of documents fetched from the vector store before the MMR\n * algorithm is applied. Fetching a larger set enables the algorithm to select a more\n * diverse subset of documents.\n * - `lambda`: A parameter controlling the relevance-diversity balance, where 0 emphasizes\n * diversity and 1 prioritizes relevance. Intermediate values provide a blend of the two,\n * allowing customization based on the importance of content variety relative to query relevance.\n */\n constructor(fields: VectorStoreRetrieverInput<V>);\n /**\n * Retrieves relevant documents based on the specified query, using either\n * similarity or maximal marginal relevance (MMR) search.\n *\n * If `searchType` is set to `\"mmr\"`, performs an MMR search to balance\n * similarity and diversity among results. If `searchType` is `\"similarity\"`,\n * retrieves results purely based on similarity to the query.\n *\n * @param query - The query string used to find relevant documents.\n * @param runManager - Optional callback manager for tracking retrieval progress.\n * @returns A promise that resolves to an array of `DocumentInterface` instances\n * representing the most relevant documents to the query.\n * @throws {Error} Throws an error if MMR search is requested but not supported\n * by the vector store.\n * @protected\n */\n _getRelevantDocuments(query: string, runManager?: CallbackManagerForRetrieverRun): Promise<DocumentInterface[]>;\n /**\n * Adds an array of documents to the vector store, embedding them as part of\n * the storage process.\n *\n * This method delegates document embedding and storage to the `addDocuments`\n * method of the underlying vector store.\n *\n * @param documents - An array of documents to embed and add to the vector store.\n * @param options - Optional settings to customize document addition.\n * @returns A promise that resolves to an array of document IDs or `void`,\n * depending on the vector store's implementation.\n */\n addDocuments(documents: DocumentInterface[], options?: AddDocumentOptions): Promise<string[] | void>;\n}\n/**\n * Interface defining the structure and operations of a vector store, which\n * facilitates the storage, retrieval, and similarity search of document vectors.\n *\n * `VectorStoreInterface` provides methods for adding, deleting, and searching\n * documents based on vector embeddings, including support for similarity\n * search with optional filtering and relevance-based retrieval.\n *\n * @extends Serializable\n */\nexport interface VectorStoreInterface extends Serializable {\n /**\n * Defines the filter type used in search and delete operations. Can be an\n * object for structured conditions or a string for simpler filtering.\n */\n FilterType: object | string;\n /**\n * Instance of `EmbeddingsInterface` used to generate vector embeddings for\n * documents, enabling vector-based search operations.\n */\n embeddings: EmbeddingsInterface;\n /**\n * Returns a string identifying the type of vector store implementation,\n * useful for distinguishing between different vector storage backends.\n *\n * @returns {string} A string indicating the vector store type.\n */\n _vectorstoreType(): string;\n /**\n * Adds precomputed vectors and their corresponding documents to the vector store.\n *\n * @param vectors - An array of vectors, with each vector representing a document.\n * @param documents - An array of `DocumentInterface` instances corresponding to each vector.\n * @param options - Optional configurations for adding documents, potentially covering indexing or metadata handling.\n * @returns A promise that resolves to an array of document IDs or void, depending on implementation.\n */\n addVectors(vectors: number[][], documents: DocumentInterface[], options?: AddDocumentOptions): Promise<string[] | void>;\n /**\n * Adds an array of documents to the vector store.\n *\n * @param documents - An array of documents to be embedded and stored in the vector store.\n * @param options - Optional configurations for embedding and storage operations.\n * @returns A promise that resolves to an array of document IDs or void, depending on implementation.\n */\n addDocuments(documents: DocumentInterface[], options?: AddDocumentOptions): Promise<string[] | void>;\n /**\n * Deletes documents from the vector store based on the specified parameters.\n *\n * @param _params - A flexible object containing key-value pairs that define\n * the conditions for selecting documents to delete.\n * @returns A promise that resolves once the deletion operation is complete.\n */\n delete(_params?: Record<string, any>): Promise<void>;\n /**\n * Searches for documents similar to a given vector query and returns them\n * with similarity scores.\n *\n * @param query - A vector representing the query for similarity search.\n * @param k - The number of similar documents to return.\n * @param filter - Optional filter based on `FilterType` to restrict results.\n * @returns A promise that resolves to an array of tuples, each containing a\n * `DocumentInterface` and its corresponding similarity score.\n */\n similaritySearchVectorWithScore(query: number[], k: number, filter?: this[\"FilterType\"]): Promise<[DocumentInterface, number][]>;\n /**\n * Searches for documents similar to a text query, embedding the query\n * and retrieving documents based on vector similarity.\n *\n * @param query - The text query to search for.\n * @param k - Optional number of similar documents to return.\n * @param filter - Optional filter based on `FilterType` to restrict results.\n * @param callbacks - Optional callbacks for tracking progress or events\n * during the search process.\n * @returns A promise that resolves to an array of `DocumentInterface`\n * instances representing similar documents.\n */\n similaritySearch(query: string, k?: number, filter?: this[\"FilterType\"], callbacks?: Callbacks): Promise<DocumentInterface[]>;\n /**\n * Searches for documents similar to a text query and includes similarity\n * scores in the result.\n *\n * @param query - The text query to search for.\n * @param k - Optional number of similar documents to return.\n * @param filter - Optional filter based on `FilterType` to restrict results.\n * @param callbacks - Optional callbacks for tracking progress or events\n * during the search process.\n * @returns A promise that resolves to an array of tuples, each containing\n * a `DocumentInterface` and its similarity score.\n */\n similaritySearchWithScore(query: string, k?: number, filter?: this[\"FilterType\"], callbacks?: Callbacks): Promise<[DocumentInterface, number][]>;\n /**\n * Return documents selected using the maximal marginal relevance.\n * Maximal marginal relevance optimizes for similarity to the query AND diversity\n * among selected documents.\n *\n * @param {string} query - Text to look up documents similar to.\n * @param {number} options.k - Number of documents to return.\n * @param {number} options.fetchK - Number of documents to fetch before passing to the MMR algorithm.\n * @param {number} options.lambda - Number between 0 and 1 that determines the degree of diversity among the results,\n * where 0 corresponds to maximum diversity and 1 to minimum diversity.\n * @param {this[\"FilterType\"]} options.filter - Optional filter\n * @param _callbacks\n *\n * @returns {Promise<DocumentInterface[]>} - List of documents selected by maximal marginal relevance.\n */\n maxMarginalRelevanceSearch?(query: string, options: MaxMarginalRelevanceSearchOptions<this[\"FilterType\"]>, callbacks: Callbacks | undefined): Promise<DocumentInterface[]>;\n /**\n * Converts the vector store into a retriever, making it suitable for use in\n * retrieval-based workflows and allowing additional configuration.\n *\n * @param kOrFields - Optional parameter for specifying either the number of\n * documents to retrieve or partial retriever configurations.\n * @param filter - Optional filter based on `FilterType` for retrieval restriction.\n * @param callbacks - Optional callbacks for tracking retrieval events or progress.\n * @param tags - General-purpose tags to add contextual information to the retriever.\n * @param metadata - General-purpose metadata providing additional context\n * for retrieval.\n * @param verbose - If `true`, enables detailed logging during retrieval.\n * @returns An instance of `VectorStoreRetriever` configured with the specified options.\n */\n asRetriever(kOrFields?: number | Partial<VectorStoreRetrieverInput<this>>, filter?: this[\"FilterType\"], callbacks?: Callbacks, tags?: string[], metadata?: Record<string, unknown>, verbose?: boolean): VectorStoreRetriever<this>;\n}\n/**\n * Abstract class representing a vector storage system for performing\n * similarity searches on embedded documents.\n *\n * `VectorStore` provides methods for adding precomputed vectors or documents,\n * removing documents based on criteria, and performing similarity searches\n * with optional scoring. Subclasses are responsible for implementing specific\n * storage mechanisms and the exact behavior of certain abstract methods.\n *\n * @abstract\n * @extends Serializable\n * @implements VectorStoreInterface\n */\nexport declare abstract class VectorStore extends Serializable implements VectorStoreInterface {\n FilterType: object | string;\n /**\n * Namespace within LangChain to uniquely identify this vector store's\n * location, based on the vector store type.\n *\n * @internal\n */\n lc_namespace: string[];\n /**\n * Embeddings interface for generating vector embeddings from text queries,\n * enabling vector-based similarity searches.\n */\n embeddings: EmbeddingsInterface;\n /**\n * Initializes a new vector store with embeddings and database configuration.\n *\n * @param embeddings - Instance of `EmbeddingsInterface` used to embed queries.\n * @param dbConfig - Configuration settings for the database or storage system.\n */\n constructor(embeddings: EmbeddingsInterface, dbConfig: Record<string, any>);\n /**\n * Returns a string representing the type of vector store, which subclasses\n * must implement to identify their specific vector storage type.\n *\n * @returns {string} A string indicating the vector store type.\n * @abstract\n */\n abstract _vectorstoreType(): string;\n /**\n * Adds precomputed vectors and corresponding documents to the vector store.\n *\n * @param vectors - An array of vectors representing each document.\n * @param documents - Array of documents associated with each vector.\n * @param options - Optional configuration for adding vectors, such as indexing.\n * @returns A promise resolving to an array of document IDs or void, based on implementation.\n * @abstract\n */\n abstract addVectors(vectors: number[][], documents: DocumentInterface[], options?: AddDocumentOptions): Promise<string[] | void>;\n /**\n * Adds documents to the vector store, embedding them first through the\n * `embeddings` instance.\n *\n * @param documents - Array of documents to embed and add.\n * @param options - Optional configuration for embedding and storing documents.\n * @returns A promise resolving to an array of document IDs or void, based on implementation.\n * @abstract\n */\n abstract addDocuments(documents: DocumentInterface[], options?: AddDocumentOptions): Promise<string[] | void>;\n /**\n * Deletes documents from the vector store based on the specified parameters.\n *\n * @param _params - Flexible key-value pairs defining conditions for document deletion.\n * @returns A promise that resolves once the deletion is complete.\n */\n delete(_params?: Record<string, any>): Promise<void>;\n /**\n * Performs a similarity search using a vector query and returns results\n * along with their similarity scores.\n *\n * @param query - Vector representing the search query.\n * @param k - Number of similar results to return.\n * @param filter - Optional filter based on `FilterType` to restrict results.\n * @returns A promise resolving to an array of tuples containing documents and their similarity scores.\n * @abstract\n */\n abstract similaritySearchVectorWithScore(query: number[], k: number, filter?: this[\"FilterType\"]): Promise<[DocumentInterface, number][]>;\n /**\n * Searches for documents similar to a text query by embedding the query and\n * performing a similarity search on the resulting vector.\n *\n * @param query - Text query for finding similar documents.\n * @param k - Number of similar results to return. Defaults to 4.\n * @param filter - Optional filter based on `FilterType`.\n * @param _callbacks - Optional callbacks for monitoring search progress\n * @returns A promise resolving to an array of `DocumentInterface` instances representing similar documents.\n */\n similaritySearch(query: string, k?: number, filter?: this[\"FilterType\"] | undefined, _callbacks?: Callbacks | undefined): Promise<DocumentInterface[]>;\n /**\n * Searches for documents similar to a text query by embedding the query,\n * and returns results with similarity scores.\n *\n * @param query - Text query for finding similar documents.\n * @param k - Number of similar results to return. Defaults to 4.\n * @param filter - Optional filter based on `FilterType`.\n * @param _callbacks - Optional callbacks for monitoring search progress\n * @returns A promise resolving to an array of tuples, each containing a\n * document and its similarity score.\n */\n similaritySearchWithScore(query: string, k?: number, filter?: this[\"FilterType\"] | undefined, _callbacks?: Callbacks | undefined): Promise<[DocumentInterface, number][]>;\n /**\n * Return documents selected using the maximal marginal relevance.\n * Maximal marginal relevance optimizes for similarity to the query AND diversity\n * among selected documents.\n *\n * @param {string} query - Text to look up documents similar to.\n * @param {number} options.k - Number of documents to return.\n * @param {number} options.fetchK - Number of documents to fetch before passing to the MMR algorithm.\n * @param {number} options.lambda - Number between 0 and 1 that determines the degree of diversity among the results,\n * where 0 corresponds to maximum diversity and 1 to minimum diversity.\n * @param {this[\"FilterType\"]} options.filter - Optional filter\n * @param _callbacks\n *\n * @returns {Promise<DocumentInterface[]>} - List of documents selected by maximal marginal relevance.\n */\n maxMarginalRelevanceSearch?(query: string, options: MaxMarginalRelevanceSearchOptions<this[\"FilterType\"]>, _callbacks: Callbacks | undefined): Promise<DocumentInterface[]>;\n /**\n * Creates a `VectorStore` instance from an array of text strings and optional\n * metadata, using the specified embeddings and database configuration.\n *\n * Subclasses must implement this method to define how text and metadata\n * are embedded and stored in the vector store. Throws an error if not overridden.\n *\n * @param _texts - Array of strings representing the text documents to be stored.\n * @param _metadatas - Metadata for the texts, either as an array (one for each text)\n * or a single object (applied to all texts).\n * @param _embeddings - Instance of `EmbeddingsInterface` to embed the texts.\n * @param _dbConfig - Database configuration settings.\n * @returns A promise that resolves to a new `VectorStore` instance.\n * @throws {Error} Throws an error if this method is not overridden by a subclass.\n */\n static fromTexts(_texts: string[], _metadatas: object[] | object, _embeddings: EmbeddingsInterface, _dbConfig: Record<string, any>): Promise<VectorStore>;\n /**\n * Creates a `VectorStore` instance from an array of documents, using the specified\n * embeddings and database configuration.\n *\n * Subclasses must implement this method to define how documents are embedded\n * and stored. Throws an error if not overridden.\n *\n * @param _docs - Array of `DocumentInterface` instances representing the documents to be stored.\n * @param _embeddings - Instance of `EmbeddingsInterface` to embed the documents.\n * @param _dbConfig - Database configuration settings.\n * @returns A promise that resolves to a new `VectorStore` instance.\n * @throws {Error} Throws an error if this method is not overridden by a subclass.\n */\n static fromDocuments(_docs: DocumentInterface[], _embeddings: EmbeddingsInterface, _dbConfig: Record<string, any>): Promise<VectorStore>;\n /**\n * Creates a `VectorStoreRetriever` instance with flexible configuration options.\n *\n * @param kOrFields\n * - If a number is provided, it sets the `k` parameter (number of items to retrieve).\n * - If an object is provided, it should contain various configuration options.\n * @param filter\n * - Optional filter criteria to limit the items retrieved based on the specified filter type.\n * @param callbacks\n * - Optional callbacks that may be triggered at specific stages of the retrieval process.\n * @param tags\n * - Tags to categorize or label the `VectorStoreRetriever`. Defaults to an empty array if not provided.\n * @param metadata\n * - Additional metadata as key-value pairs to add contextual information for the retrieval process.\n * @param verbose\n * - If `true`, enables detailed logging for the retrieval process. Defaults to `false`.\n *\n * @returns\n * - A configured `VectorStoreRetriever` instance based on the provided parameters.\n *\n * @example\n * Basic usage with a `k` value:\n * ```typescript\n * const retriever = myVectorStore.asRetriever(5);\n * ```\n *\n * Usage with a configuration object:\n * ```typescript\n * const retriever = myVectorStore.asRetriever({\n * k: 10,\n * filter: myFilter,\n * tags: ['example', 'test'],\n * verbose: true,\n * searchType: 'mmr',\n * searchKwargs: { alpha: 0.5 },\n * });\n * ```\n */\n asRetriever(kOrFields?: number | Partial<VectorStoreRetrieverInput<this>>, filter?: this[\"FilterType\"], callbacks?: Callbacks, tags?: string[], metadata?: Record<string, unknown>, verbose?: boolean): VectorStoreRetriever<this>;\n}\n/**\n * Abstract class extending `VectorStore` that defines a contract for saving\n * and loading vector store instances.\n *\n * The `SaveableVectorStore` class allows vector store implementations to\n * persist their data and retrieve it when needed.The format for saving and\n * loading data is left to the implementing subclass.\n *\n * Subclasses must implement the `save` method to handle their custom\n * serialization logic, while the `load` method enables reconstruction of a\n * vector store from saved data, requiring compatible embeddings through the\n * `EmbeddingsInterface`.\n *\n * @abstract\n * @extends VectorStore\n */\nexport declare abstract class SaveableVectorStore extends VectorStore {\n /**\n * Saves the current state of the vector store to the specified directory.\n *\n * This method must be implemented by subclasses to define their own\n * serialization process for persisting vector data. The implementation\n * determines the structure and format of the saved data.\n *\n * @param directory - The directory path where the vector store data\n * will be saved.\n * @abstract\n */\n abstract save(directory: string): Promise<void>;\n /**\n * Loads a vector store instance from the specified directory, using the\n * provided embeddings to ensure compatibility.\n *\n * This static method reconstructs a `SaveableVectorStore` from previously\n * saved data. Implementations should interpret the saved data format to\n * recreate the vector store instance.\n *\n * @param _directory - The directory path from which the vector store\n * data will be loaded.\n * @param _embeddings - An instance of `EmbeddingsInterface` to align\n * the embeddings with the loaded vector data.\n * @returns A promise that resolves to a `SaveableVectorStore` instance\n * constructed from the saved data.\n */\n static load(_directory: string, _embeddings: EmbeddingsInterface): Promise<SaveableVectorStore>;\n}\nexport {};\n//# sourceMappingURL=vectorstores.d.ts.map"],"mappings":";;;;;;;;;;AAImF;AAmCnF,KA/BKQ,kBAAAA,GAAqBC,MA+BdC,CAAAA,MAAAA,EAAiC,GAAA,CAAAC;AAyB7C;AAkDA;;;;;;;;AAUsD;AAatD;;;;;;;;AAAoI;AA6BpI;;;;;;;;;;;AAsH4BV,KArPhBS,iCAqPgBT,CAAAA,UAAAA,CAAAA,GAAAA;EAA+BO,CAAAA,EAAAA,MAAAA;EAAqBS,MAAAA,CAAAA,EAAAA,MAAAA;EAtHyBf,MAAAA,CAAAA,EAAAA,MAAAA;EAAyBc,MAAAA,CAAAA,EA3HrHL,UA2HqHK;AAA6B,CAAA;AAkI/J;;;;;;;;;;;;;;;;;;;AA+F0HT,KAvU9GK,mCAAAA,GAuU8GL;EAAgCN,MAAAA,CAAAA,EAAAA,MAAAA;EAARgB,MAAAA,CAAAA,EAAAA,MAAAA;CAerGJ;;;;;;AA9Ga;AA6H1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAA8F,KAnTlFA,yBAmTkF,CAAA,UAnT9CE,oBAmT8C,CAAA,GAnTtBX,kBAmTsB,GAAA,CAAA;EAgMhEiB,WAAAA,EAlfbP,CAkfaO;EAYQJ,CAAAA,CAAAA,EAAAA,MAAAA;EAgBWjB,MAAAA,CAAAA,EA5gBpCc,CA4gBoCd,CAAAA,YAAAA,CAAAA;EAA8BqB,UAAAA,CAAAA,EAAAA,YAAAA;CAARJ,GAAAA;EA5BbG,WAAAA,EA7ezCN,CA6eyCM;EAAW,CAAA,CAAA,EAAA,MAAA;WA3exDN;;iBAEMF;;;;;;;;;;;;;UAaFI,wCAAwCD,uBAAuBA,8BAA8BZ;eAC7FW;;;;;;;;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,QAAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCAuC3FD,QAAQN,2EAA2EN,uCAAuCE,6CAA6CS;;;;;;;;;;;;;;;;;;uBAkB9KG,mBAAAA,SAA4BD,WAAAA;;;;;;;;;;;;oCAYpBH;;;;;;;;;;;;;;;;+CAgBWjB,sBAAsBiB,QAAQI"}
|
|
1
|
+
{"version":3,"file":"vectorstores.d.cts","names":["EmbeddingsInterface","DocumentInterface","BaseRetriever","BaseRetrieverInterface","BaseRetrieverInput","Serializable","CallbackManagerForRetrieverRun","Callbacks","AddDocumentOptions","Record","MaxMarginalRelevanceSearchOptions","FilterType","VectorStoreRetrieverMMRSearchKwargs","VectorStoreRetrieverInput","V","VectorStoreInterface","VectorStoreRetrieverInterface","Promise","VectorStoreRetriever","Partial","VectorStore","SaveableVectorStore"],"sources":["../src/vectorstores.d.ts"],"sourcesContent":["import type { EmbeddingsInterface } from \"./embeddings.js\";\nimport type { DocumentInterface } from \"./documents/document.js\";\nimport { BaseRetriever, BaseRetrieverInterface, type BaseRetrieverInput } from \"./retrievers/index.js\";\nimport { Serializable } from \"./load/serializable.js\";\nimport { CallbackManagerForRetrieverRun, Callbacks } from \"./callbacks/manager.js\";\n/**\n * Type for options when adding a document to the VectorStore.\n */\ntype AddDocumentOptions = Record<string, any>;\n/**\n * Options for configuring a maximal marginal relevance (MMR) search.\n *\n * MMR search optimizes for both similarity to the query and diversity\n * among the results, balancing the retrieval of relevant documents\n * with variation in the content returned.\n *\n * Fields:\n *\n * - `fetchK` (optional): The initial number of documents to retrieve from the\n * vector store before applying the MMR algorithm. This larger set provides a\n * pool of documents from which the algorithm can select the most diverse\n * results based on relevance to the query.\n *\n * - `filter` (optional): A filter of type `FilterType` to refine the search\n * results, allowing additional conditions to target specific subsets\n * of documents.\n *\n * - `k`: The number of documents to return in the final results. This is the\n * primary count of documents that are most relevant to the query.\n *\n * - `lambda` (optional): A value between 0 and 1 that determines the balance\n * between relevance and diversity:\n * - A `lambda` of 0 emphasizes diversity, maximizing content variation.\n * - A `lambda` of 1 emphasizes similarity to the query, focusing on relevance.\n * Values between 0 and 1 provide a mix of relevance and diversity.\n *\n * @template FilterType - The type used for filtering results, as defined\n * by the vector store.\n */\nexport type MaxMarginalRelevanceSearchOptions<FilterType> = {\n k: number;\n fetchK?: number;\n lambda?: number;\n filter?: FilterType;\n};\n/**\n * Options for configuring a maximal marginal relevance (MMR) search\n * when using the `VectorStoreRetriever`.\n *\n * These parameters control how the MMR algorithm balances relevance to the\n * query and diversity among the retrieved documents.\n *\n * Fields:\n * - `fetchK` (optional): Specifies the initial number of documents to fetch\n * before applying the MMR algorithm. This larger set provides a pool of\n * documents from which the algorithm can select the most diverse results\n * based on relevance to the query.\n *\n * - `lambda` (optional): A value between 0 and 1 that determines the balance\n * between relevance and diversity:\n * - A `lambda` of 0 maximizes diversity among the results, prioritizing varied content.\n * - A `lambda` of 1 maximizes similarity to the query, prioritizing relevance.\n * Values between 0 and 1 provide a mix of relevance and diversity.\n */\nexport type VectorStoreRetrieverMMRSearchKwargs = {\n fetchK?: number;\n lambda?: number;\n};\n/**\n * Input configuration options for creating a `VectorStoreRetriever` instance.\n *\n * This type combines properties from `BaseRetrieverInput` with specific settings\n * for the `VectorStoreRetriever`, including options for similarity or maximal\n * marginal relevance (MMR) search types.\n *\n * Fields:\n *\n * - `callbacks` (optional): An array of callback functions that handle various\n * events during retrieval, such as logging, error handling, or progress updates.\n *\n * - `tags` (optional): An array of strings used to add contextual tags to\n * retrieval operations, allowing for easier categorization and tracking.\n *\n * - `metadata` (optional): A record of key-value pairs to store additional\n * contextual information for retrieval operations, which can be useful\n * for logging or auditing purposes.\n *\n * - `verbose` (optional): A boolean flag that, if set to `true`, enables\n * detailed logging and output during the retrieval process. Defaults to `false`.\n *\n * - `vectorStore`: The `VectorStore` instance implementing `VectorStoreInterface`\n * that will be used for document storage and retrieval.\n *\n * - `k` (optional): Specifies the number of documents to retrieve per search\n * query. Defaults to 4 if not specified.\n *\n * - `filter` (optional): A filter of type `FilterType` (defined by the vector store)\n * to refine the set of documents returned, allowing for targeted search results.\n *\n * - `searchType`: Determines the type of search to perform:\n * - `\"similarity\"`: Executes a similarity search, retrieving documents based purely\n * on vector similarity to the query.\n * - `\"mmr\"`: Executes a maximal marginal relevance (MMR) search, balancing similarity\n * and diversity in the search results.\n *\n * - `searchKwargs` (optional): Used only if `searchType` is `\"mmr\"`, this object\n * provides additional options for MMR search, including:\n * - `fetchK`: Specifies the number of documents to initially fetch before applying\n * the MMR algorithm, providing a pool from which the most diverse results are selected.\n * - `lambda`: A diversity parameter, where 0 emphasizes diversity and 1 emphasizes\n * relevance to the query. Values between 0 and 1 provide a balance of relevance and diversity.\n *\n * @template V - The type of vector store implementing `VectorStoreInterface`.\n */\nexport type VectorStoreRetrieverInput<V extends VectorStoreInterface> = BaseRetrieverInput & ({\n vectorStore: V;\n k?: number;\n filter?: V[\"FilterType\"];\n searchType?: \"similarity\";\n} | {\n vectorStore: V;\n k?: number;\n filter?: V[\"FilterType\"];\n searchType: \"mmr\";\n searchKwargs?: VectorStoreRetrieverMMRSearchKwargs;\n});\n/**\n * Interface for a retriever that uses a vector store to store and retrieve\n * document embeddings. This retriever interface allows for adding documents\n * to the underlying vector store and conducting retrieval operations.\n *\n * `VectorStoreRetrieverInterface` extends `BaseRetrieverInterface` to provide\n * document retrieval capabilities based on vector similarity.\n *\n * @interface VectorStoreRetrieverInterface\n * @extends BaseRetrieverInterface\n */\nexport interface VectorStoreRetrieverInterface<V extends VectorStoreInterface = VectorStoreInterface> extends BaseRetrieverInterface {\n vectorStore: V;\n /**\n * Adds an array of documents to the vector store.\n *\n * This method embeds the provided documents and stores them within the\n * vector store. Additional options can be specified for custom behavior\n * during the addition process.\n *\n * @param documents - An array of documents to embed and add to the vector store.\n * @param options - Optional settings to customize document addition.\n * @returns A promise that resolves to an array of document IDs or `void`,\n * depending on the implementation.\n */\n addDocuments(documents: DocumentInterface[], options?: AddDocumentOptions): Promise<string[] | void>;\n}\n/**\n * Class for retrieving documents from a `VectorStore` based on vector similarity\n * or maximal marginal relevance (MMR).\n *\n * `VectorStoreRetriever` extends `BaseRetriever`, implementing methods for\n * adding documents to the underlying vector store and performing document\n * retrieval with optional configurations.\n *\n * @class VectorStoreRetriever\n * @extends BaseRetriever\n * @implements VectorStoreRetrieverInterface\n * @template V - Type of vector store implementing `VectorStoreInterface`.\n */\nexport declare class VectorStoreRetriever<V extends VectorStoreInterface = VectorStoreInterface> extends BaseRetriever implements VectorStoreRetrieverInterface {\n static lc_name(): string;\n get lc_namespace(): string[];\n /**\n * The instance of `VectorStore` used for storing and retrieving document embeddings.\n * This vector store must implement the `VectorStoreInterface` to be compatible\n * with the retriever’s operations.\n */\n vectorStore: V;\n /**\n * Specifies the number of documents to retrieve for each search query.\n * Defaults to 4 if not specified, providing a basic result count for similarity or MMR searches.\n */\n k: number;\n /**\n * Determines the type of search operation to perform on the vector store.\n *\n * - `\"similarity\"` (default): Conducts a similarity search based purely on vector similarity\n * to the query.\n * - `\"mmr\"`: Executes a maximal marginal relevance (MMR) search, balancing relevance and\n * diversity in the retrieved results.\n */\n searchType: string;\n /**\n * Additional options specific to maximal marginal relevance (MMR) search, applicable\n * only if `searchType` is set to `\"mmr\"`.\n *\n * Includes:\n * - `fetchK`: The initial number of documents fetched before applying the MMR algorithm,\n * allowing for a larger selection from which to choose the most diverse results.\n * - `lambda`: A parameter between 0 and 1 to adjust the relevance-diversity balance,\n * where 0 prioritizes diversity and 1 prioritizes relevance.\n */\n searchKwargs?: VectorStoreRetrieverMMRSearchKwargs;\n /**\n * Optional filter applied to search results, defined by the `FilterType` of the vector store.\n * Allows for refined, targeted results by restricting the returned documents based\n * on specified filter criteria.\n */\n filter?: V[\"FilterType\"];\n /**\n * Returns the type of vector store, as defined by the `vectorStore` instance.\n *\n * @returns {string} The vector store type.\n */\n _vectorstoreType(): string;\n /**\n * Initializes a new instance of `VectorStoreRetriever` with the specified configuration.\n *\n * This constructor configures the retriever to interact with a given `VectorStore`\n * and supports different retrieval strategies, including similarity search and maximal\n * marginal relevance (MMR) search. Various options allow customization of the number\n * of documents retrieved per query, filtering based on conditions, and fine-tuning\n * MMR-specific parameters.\n *\n * @param fields - Configuration options for setting up the retriever:\n *\n * - `vectorStore` (required): The `VectorStore` instance implementing `VectorStoreInterface`\n * that will be used to store and retrieve document embeddings. This is the core component\n * of the retriever, enabling vector-based similarity and MMR searches.\n *\n * - `k` (optional): Specifies the number of documents to retrieve per search query. If not\n * provided, defaults to 4. This count determines the number of most relevant documents returned\n * for each search operation, balancing performance with comprehensiveness.\n *\n * - `searchType` (optional): Defines the search approach used by the retriever, allowing for\n * flexibility between two methods:\n * - `\"similarity\"` (default): A similarity-based search, retrieving documents with high vector\n * similarity to the query. This type prioritizes relevance and is often used when diversity\n * among results is less critical.\n * - `\"mmr\"`: Maximal Marginal Relevance search, which combines relevance with diversity. MMR\n * is useful for scenarios where varied content is essential, as it selects results that\n * both match the query and introduce content diversity.\n *\n * - `filter` (optional): A filter of type `FilterType`, defined by the vector store, that allows\n * for refined and targeted search results. This filter applies specified conditions to limit\n * which documents are eligible for retrieval, offering control over the scope of results.\n *\n * - `searchKwargs` (optional, applicable only if `searchType` is `\"mmr\"`): Additional settings\n * for configuring MMR-specific behavior. These parameters allow further tuning of the MMR\n * search process:\n * - `fetchK`: The initial number of documents fetched from the vector store before the MMR\n * algorithm is applied. Fetching a larger set enables the algorithm to select a more\n * diverse subset of documents.\n * - `lambda`: A parameter controlling the relevance-diversity balance, where 0 emphasizes\n * diversity and 1 prioritizes relevance. Intermediate values provide a blend of the two,\n * allowing customization based on the importance of content variety relative to query relevance.\n */\n constructor(fields: VectorStoreRetrieverInput<V>);\n /**\n * Retrieves relevant documents based on the specified query, using either\n * similarity or maximal marginal relevance (MMR) search.\n *\n * If `searchType` is set to `\"mmr\"`, performs an MMR search to balance\n * similarity and diversity among results. If `searchType` is `\"similarity\"`,\n * retrieves results purely based on similarity to the query.\n *\n * @param query - The query string used to find relevant documents.\n * @param runManager - Optional callback manager for tracking retrieval progress.\n * @returns A promise that resolves to an array of `DocumentInterface` instances\n * representing the most relevant documents to the query.\n * @throws {Error} Throws an error if MMR search is requested but not supported\n * by the vector store.\n * @protected\n */\n _getRelevantDocuments(query: string, runManager?: CallbackManagerForRetrieverRun): Promise<DocumentInterface[]>;\n /**\n * Adds an array of documents to the vector store, embedding them as part of\n * the storage process.\n *\n * This method delegates document embedding and storage to the `addDocuments`\n * method of the underlying vector store.\n *\n * @param documents - An array of documents to embed and add to the vector store.\n * @param options - Optional settings to customize document addition.\n * @returns A promise that resolves to an array of document IDs or `void`,\n * depending on the vector store's implementation.\n */\n addDocuments(documents: DocumentInterface[], options?: AddDocumentOptions): Promise<string[] | void>;\n}\n/**\n * Interface defining the structure and operations of a vector store, which\n * facilitates the storage, retrieval, and similarity search of document vectors.\n *\n * `VectorStoreInterface` provides methods for adding, deleting, and searching\n * documents based on vector embeddings, including support for similarity\n * search with optional filtering and relevance-based retrieval.\n *\n * @extends Serializable\n */\nexport interface VectorStoreInterface extends Serializable {\n /**\n * Defines the filter type used in search and delete operations. Can be an\n * object for structured conditions or a string for simpler filtering.\n */\n FilterType: object | string;\n /**\n * Instance of `EmbeddingsInterface` used to generate vector embeddings for\n * documents, enabling vector-based search operations.\n */\n embeddings: EmbeddingsInterface;\n /**\n * Returns a string identifying the type of vector store implementation,\n * useful for distinguishing between different vector storage backends.\n *\n * @returns {string} A string indicating the vector store type.\n */\n _vectorstoreType(): string;\n /**\n * Adds precomputed vectors and their corresponding documents to the vector store.\n *\n * @param vectors - An array of vectors, with each vector representing a document.\n * @param documents - An array of `DocumentInterface` instances corresponding to each vector.\n * @param options - Optional configurations for adding documents, potentially covering indexing or metadata handling.\n * @returns A promise that resolves to an array of document IDs or void, depending on implementation.\n */\n addVectors(vectors: number[][], documents: DocumentInterface[], options?: AddDocumentOptions): Promise<string[] | void>;\n /**\n * Adds an array of documents to the vector store.\n *\n * @param documents - An array of documents to be embedded and stored in the vector store.\n * @param options - Optional configurations for embedding and storage operations.\n * @returns A promise that resolves to an array of document IDs or void, depending on implementation.\n */\n addDocuments(documents: DocumentInterface[], options?: AddDocumentOptions): Promise<string[] | void>;\n /**\n * Deletes documents from the vector store based on the specified parameters.\n *\n * @param _params - A flexible object containing key-value pairs that define\n * the conditions for selecting documents to delete.\n * @returns A promise that resolves once the deletion operation is complete.\n */\n delete(_params?: Record<string, any>): Promise<void>;\n /**\n * Searches for documents similar to a given vector query and returns them\n * with similarity scores.\n *\n * @param query - A vector representing the query for similarity search.\n * @param k - The number of similar documents to return.\n * @param filter - Optional filter based on `FilterType` to restrict results.\n * @returns A promise that resolves to an array of tuples, each containing a\n * `DocumentInterface` and its corresponding similarity score.\n */\n similaritySearchVectorWithScore(query: number[], k: number, filter?: this[\"FilterType\"]): Promise<[DocumentInterface, number][]>;\n /**\n * Searches for documents similar to a text query, embedding the query\n * and retrieving documents based on vector similarity.\n *\n * @param query - The text query to search for.\n * @param k - Optional number of similar documents to return.\n * @param filter - Optional filter based on `FilterType` to restrict results.\n * @param callbacks - Optional callbacks for tracking progress or events\n * during the search process.\n * @returns A promise that resolves to an array of `DocumentInterface`\n * instances representing similar documents.\n */\n similaritySearch(query: string, k?: number, filter?: this[\"FilterType\"], callbacks?: Callbacks): Promise<DocumentInterface[]>;\n /**\n * Searches for documents similar to a text query and includes similarity\n * scores in the result.\n *\n * @param query - The text query to search for.\n * @param k - Optional number of similar documents to return.\n * @param filter - Optional filter based on `FilterType` to restrict results.\n * @param callbacks - Optional callbacks for tracking progress or events\n * during the search process.\n * @returns A promise that resolves to an array of tuples, each containing\n * a `DocumentInterface` and its similarity score.\n */\n similaritySearchWithScore(query: string, k?: number, filter?: this[\"FilterType\"], callbacks?: Callbacks): Promise<[DocumentInterface, number][]>;\n /**\n * Return documents selected using the maximal marginal relevance.\n * Maximal marginal relevance optimizes for similarity to the query AND diversity\n * among selected documents.\n *\n * @param {string} query - Text to look up documents similar to.\n * @param {number} options.k - Number of documents to return.\n * @param {number} options.fetchK - Number of documents to fetch before passing to the MMR algorithm.\n * @param {number} options.lambda - Number between 0 and 1 that determines the degree of diversity among the results,\n * where 0 corresponds to maximum diversity and 1 to minimum diversity.\n * @param {this[\"FilterType\"]} options.filter - Optional filter\n * @param _callbacks\n *\n * @returns {Promise<DocumentInterface[]>} - List of documents selected by maximal marginal relevance.\n */\n maxMarginalRelevanceSearch?(query: string, options: MaxMarginalRelevanceSearchOptions<this[\"FilterType\"]>, callbacks: Callbacks | undefined): Promise<DocumentInterface[]>;\n /**\n * Converts the vector store into a retriever, making it suitable for use in\n * retrieval-based workflows and allowing additional configuration.\n *\n * @param kOrFields - Optional parameter for specifying either the number of\n * documents to retrieve or partial retriever configurations.\n * @param filter - Optional filter based on `FilterType` for retrieval restriction.\n * @param callbacks - Optional callbacks for tracking retrieval events or progress.\n * @param tags - General-purpose tags to add contextual information to the retriever.\n * @param metadata - General-purpose metadata providing additional context\n * for retrieval.\n * @param verbose - If `true`, enables detailed logging during retrieval.\n * @returns An instance of `VectorStoreRetriever` configured with the specified options.\n */\n asRetriever(kOrFields?: number | Partial<VectorStoreRetrieverInput<this>>, filter?: this[\"FilterType\"], callbacks?: Callbacks, tags?: string[], metadata?: Record<string, unknown>, verbose?: boolean): VectorStoreRetriever<this>;\n}\n/**\n * Abstract class representing a vector storage system for performing\n * similarity searches on embedded documents.\n *\n * `VectorStore` provides methods for adding precomputed vectors or documents,\n * removing documents based on criteria, and performing similarity searches\n * with optional scoring. Subclasses are responsible for implementing specific\n * storage mechanisms and the exact behavior of certain abstract methods.\n *\n * @abstract\n * @extends Serializable\n * @implements VectorStoreInterface\n */\nexport declare abstract class VectorStore extends Serializable implements VectorStoreInterface {\n FilterType: object | string;\n /**\n * Namespace within LangChain to uniquely identify this vector store's\n * location, based on the vector store type.\n *\n * @internal\n */\n lc_namespace: string[];\n /**\n * Embeddings interface for generating vector embeddings from text queries,\n * enabling vector-based similarity searches.\n */\n embeddings: EmbeddingsInterface;\n /**\n * Initializes a new vector store with embeddings and database configuration.\n *\n * @param embeddings - Instance of `EmbeddingsInterface` used to embed queries.\n * @param dbConfig - Configuration settings for the database or storage system.\n */\n constructor(embeddings: EmbeddingsInterface, dbConfig: Record<string, any>);\n /**\n * Returns a string representing the type of vector store, which subclasses\n * must implement to identify their specific vector storage type.\n *\n * @returns {string} A string indicating the vector store type.\n * @abstract\n */\n abstract _vectorstoreType(): string;\n /**\n * Adds precomputed vectors and corresponding documents to the vector store.\n *\n * @param vectors - An array of vectors representing each document.\n * @param documents - Array of documents associated with each vector.\n * @param options - Optional configuration for adding vectors, such as indexing.\n * @returns A promise resolving to an array of document IDs or void, based on implementation.\n * @abstract\n */\n abstract addVectors(vectors: number[][], documents: DocumentInterface[], options?: AddDocumentOptions): Promise<string[] | void>;\n /**\n * Adds documents to the vector store, embedding them first through the\n * `embeddings` instance.\n *\n * @param documents - Array of documents to embed and add.\n * @param options - Optional configuration for embedding and storing documents.\n * @returns A promise resolving to an array of document IDs or void, based on implementation.\n * @abstract\n */\n abstract addDocuments(documents: DocumentInterface[], options?: AddDocumentOptions): Promise<string[] | void>;\n /**\n * Deletes documents from the vector store based on the specified parameters.\n *\n * @param _params - Flexible key-value pairs defining conditions for document deletion.\n * @returns A promise that resolves once the deletion is complete.\n */\n delete(_params?: Record<string, any>): Promise<void>;\n /**\n * Performs a similarity search using a vector query and returns results\n * along with their similarity scores.\n *\n * @param query - Vector representing the search query.\n * @param k - Number of similar results to return.\n * @param filter - Optional filter based on `FilterType` to restrict results.\n * @returns A promise resolving to an array of tuples containing documents and their similarity scores.\n * @abstract\n */\n abstract similaritySearchVectorWithScore(query: number[], k: number, filter?: this[\"FilterType\"]): Promise<[DocumentInterface, number][]>;\n /**\n * Searches for documents similar to a text query by embedding the query and\n * performing a similarity search on the resulting vector.\n *\n * @param query - Text query for finding similar documents.\n * @param k - Number of similar results to return. Defaults to 4.\n * @param filter - Optional filter based on `FilterType`.\n * @param _callbacks - Optional callbacks for monitoring search progress\n * @returns A promise resolving to an array of `DocumentInterface` instances representing similar documents.\n */\n similaritySearch(query: string, k?: number, filter?: this[\"FilterType\"] | undefined, _callbacks?: Callbacks | undefined): Promise<DocumentInterface[]>;\n /**\n * Searches for documents similar to a text query by embedding the query,\n * and returns results with similarity scores.\n *\n * @param query - Text query for finding similar documents.\n * @param k - Number of similar results to return. Defaults to 4.\n * @param filter - Optional filter based on `FilterType`.\n * @param _callbacks - Optional callbacks for monitoring search progress\n * @returns A promise resolving to an array of tuples, each containing a\n * document and its similarity score.\n */\n similaritySearchWithScore(query: string, k?: number, filter?: this[\"FilterType\"] | undefined, _callbacks?: Callbacks | undefined): Promise<[DocumentInterface, number][]>;\n /**\n * Return documents selected using the maximal marginal relevance.\n * Maximal marginal relevance optimizes for similarity to the query AND diversity\n * among selected documents.\n *\n * @param {string} query - Text to look up documents similar to.\n * @param {number} options.k - Number of documents to return.\n * @param {number} options.fetchK - Number of documents to fetch before passing to the MMR algorithm.\n * @param {number} options.lambda - Number between 0 and 1 that determines the degree of diversity among the results,\n * where 0 corresponds to maximum diversity and 1 to minimum diversity.\n * @param {this[\"FilterType\"]} options.filter - Optional filter\n * @param _callbacks\n *\n * @returns {Promise<DocumentInterface[]>} - List of documents selected by maximal marginal relevance.\n */\n maxMarginalRelevanceSearch?(query: string, options: MaxMarginalRelevanceSearchOptions<this[\"FilterType\"]>, _callbacks: Callbacks | undefined): Promise<DocumentInterface[]>;\n /**\n * Creates a `VectorStore` instance from an array of text strings and optional\n * metadata, using the specified embeddings and database configuration.\n *\n * Subclasses must implement this method to define how text and metadata\n * are embedded and stored in the vector store. Throws an error if not overridden.\n *\n * @param _texts - Array of strings representing the text documents to be stored.\n * @param _metadatas - Metadata for the texts, either as an array (one for each text)\n * or a single object (applied to all texts).\n * @param _embeddings - Instance of `EmbeddingsInterface` to embed the texts.\n * @param _dbConfig - Database configuration settings.\n * @returns A promise that resolves to a new `VectorStore` instance.\n * @throws {Error} Throws an error if this method is not overridden by a subclass.\n */\n static fromTexts(_texts: string[], _metadatas: object[] | object, _embeddings: EmbeddingsInterface, _dbConfig: Record<string, any>): Promise<VectorStore>;\n /**\n * Creates a `VectorStore` instance from an array of documents, using the specified\n * embeddings and database configuration.\n *\n * Subclasses must implement this method to define how documents are embedded\n * and stored. Throws an error if not overridden.\n *\n * @param _docs - Array of `DocumentInterface` instances representing the documents to be stored.\n * @param _embeddings - Instance of `EmbeddingsInterface` to embed the documents.\n * @param _dbConfig - Database configuration settings.\n * @returns A promise that resolves to a new `VectorStore` instance.\n * @throws {Error} Throws an error if this method is not overridden by a subclass.\n */\n static fromDocuments(_docs: DocumentInterface[], _embeddings: EmbeddingsInterface, _dbConfig: Record<string, any>): Promise<VectorStore>;\n /**\n * Creates a `VectorStoreRetriever` instance with flexible configuration options.\n *\n * @param kOrFields\n * - If a number is provided, it sets the `k` parameter (number of items to retrieve).\n * - If an object is provided, it should contain various configuration options.\n * @param filter\n * - Optional filter criteria to limit the items retrieved based on the specified filter type.\n * @param callbacks\n * - Optional callbacks that may be triggered at specific stages of the retrieval process.\n * @param tags\n * - Tags to categorize or label the `VectorStoreRetriever`. Defaults to an empty array if not provided.\n * @param metadata\n * - Additional metadata as key-value pairs to add contextual information for the retrieval process.\n * @param verbose\n * - If `true`, enables detailed logging for the retrieval process. Defaults to `false`.\n *\n * @returns\n * - A configured `VectorStoreRetriever` instance based on the provided parameters.\n *\n * @example\n * Basic usage with a `k` value:\n * ```typescript\n * const retriever = myVectorStore.asRetriever(5);\n * ```\n *\n * Usage with a configuration object:\n * ```typescript\n * const retriever = myVectorStore.asRetriever({\n * k: 10,\n * filter: myFilter,\n * tags: ['example', 'test'],\n * verbose: true,\n * searchType: 'mmr',\n * searchKwargs: { alpha: 0.5 },\n * });\n * ```\n */\n asRetriever(kOrFields?: number | Partial<VectorStoreRetrieverInput<this>>, filter?: this[\"FilterType\"], callbacks?: Callbacks, tags?: string[], metadata?: Record<string, unknown>, verbose?: boolean): VectorStoreRetriever<this>;\n}\n/**\n * Abstract class extending `VectorStore` that defines a contract for saving\n * and loading vector store instances.\n *\n * The `SaveableVectorStore` class allows vector store implementations to\n * persist their data and retrieve it when needed.The format for saving and\n * loading data is left to the implementing subclass.\n *\n * Subclasses must implement the `save` method to handle their custom\n * serialization logic, while the `load` method enables reconstruction of a\n * vector store from saved data, requiring compatible embeddings through the\n * `EmbeddingsInterface`.\n *\n * @abstract\n * @extends VectorStore\n */\nexport declare abstract class SaveableVectorStore extends VectorStore {\n /**\n * Saves the current state of the vector store to the specified directory.\n *\n * This method must be implemented by subclasses to define their own\n * serialization process for persisting vector data. The implementation\n * determines the structure and format of the saved data.\n *\n * @param directory - The directory path where the vector store data\n * will be saved.\n * @abstract\n */\n abstract save(directory: string): Promise<void>;\n /**\n * Loads a vector store instance from the specified directory, using the\n * provided embeddings to ensure compatibility.\n *\n * This static method reconstructs a `SaveableVectorStore` from previously\n * saved data. Implementations should interpret the saved data format to\n * recreate the vector store instance.\n *\n * @param _directory - The directory path from which the vector store\n * data will be loaded.\n * @param _embeddings - An instance of `EmbeddingsInterface` to align\n * the embeddings with the loaded vector data.\n * @returns A promise that resolves to a `SaveableVectorStore` instance\n * constructed from the saved data.\n */\n static load(_directory: string, _embeddings: EmbeddingsInterface): Promise<SaveableVectorStore>;\n}\nexport {};\n//# sourceMappingURL=vectorstores.d.ts.map"],"mappings":";;;;;;;;;;AAImF;AAmCnF,KA/BKQ,kBAAAA,GAAqBC,MA+BdC,CAAAA,MAAAA,EAAiC,GAAA,CAAA;AAyB7C;AAkDA;;;;;;;;AAUsD;AAatD;;;;;;;;AAAoI;AA6BpI;;;;;;;;;;;AAsH4BT,KArPhBS,iCAqPgBT,CAAAA,UAAAA,CAAAA,GAAAA;EAA+BO,CAAAA,EAAAA,MAAAA;EAAqBS,MAAAA,CAAAA,EAAAA,MAAAA;EAtHyBf,MAAAA,CAAAA,EAAAA,MAAAA;EAAyBc,MAAAA,CAAAA,EA3HrHL,UA2HqHK;AAA6B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