@langchain/classic 1.0.6-dev-1765431816670 → 1.0.6-dev-1765432861398
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/openai_tools/index.d.ts +2 -2
- package/dist/agents/openai_tools/index.d.ts.map +1 -1
- package/dist/agents/react/index.d.ts +2 -2
- package/dist/agents/react/index.d.ts.map +1 -1
- package/dist/agents/structured_chat/index.d.ts +2 -2
- package/dist/agents/structured_chat/index.d.ts.map +1 -1
- package/dist/agents/tool_calling/index.d.ts +2 -2
- package/dist/agents/tool_calling/index.d.ts.map +1 -1
- package/dist/agents/toolkits/conversational_retrieval/token_buffer_memory.d.cts +2 -2
- package/dist/agents/toolkits/conversational_retrieval/token_buffer_memory.d.cts.map +1 -1
- package/dist/evaluation/agents/trajectory.d.cts +2 -2
- package/dist/evaluation/agents/trajectory.d.cts.map +1 -1
- package/dist/evaluation/agents/trajectory.d.ts +2 -2
- package/dist/evaluation/agents/trajectory.d.ts.map +1 -1
- package/dist/evaluation/comparison/pairwise.d.cts +3 -3
- package/dist/evaluation/comparison/pairwise.d.cts.map +1 -1
- package/dist/evaluation/comparison/pairwise.d.ts +3 -3
- package/dist/evaluation/comparison/pairwise.d.ts.map +1 -1
- package/dist/evaluation/criteria/criteria.d.cts +3 -3
- package/dist/evaluation/criteria/criteria.d.cts.map +1 -1
- package/dist/evaluation/criteria/criteria.d.ts +3 -3
- package/dist/evaluation/criteria/criteria.d.ts.map +1 -1
- package/dist/experimental/autogpt/prompt.d.cts +2 -2
- package/dist/experimental/autogpt/prompt.d.cts.map +1 -1
- package/dist/experimental/prompts/custom_format.d.cts.map +1 -1
- package/dist/experimental/prompts/handlebars.d.cts.map +1 -1
- package/dist/experimental/prompts/handlebars.d.ts.map +1 -1
- package/dist/load/import_map.cjs +2 -2
- package/dist/load/import_map.cjs.map +1 -1
- package/dist/load/import_map.js +2 -2
- package/dist/load/import_map.js.map +1 -1
- package/dist/retrievers/matryoshka_retriever.d.ts.map +1 -1
- package/package.json +14 -14
|
@@ -6,7 +6,7 @@ import { StructuredToolInterface } from "@langchain/core/tools";
|
|
|
6
6
|
import { ToolDefinition } from "@langchain/core/language_models/base";
|
|
7
7
|
import { OpenAIClient } from "@langchain/openai";
|
|
8
8
|
import { BaseChatModel, BaseChatModelCallOptions } from "@langchain/core/language_models/chat_models";
|
|
9
|
-
import * as
|
|
9
|
+
import * as _langchain_core_agents0 from "@langchain/core/agents";
|
|
10
10
|
|
|
11
11
|
//#region src/agents/openai_tools/index.d.ts
|
|
12
12
|
/**
|
|
@@ -94,7 +94,7 @@ declare function createOpenAIToolsAgent({
|
|
|
94
94
|
streamRunnable
|
|
95
95
|
}: CreateOpenAIToolsAgentParams): Promise<AgentRunnableSequence<{
|
|
96
96
|
steps: ToolsAgentStep[];
|
|
97
|
-
},
|
|
97
|
+
}, _langchain_core_agents0.AgentFinish | _langchain_core_agents0.AgentAction[]>>;
|
|
98
98
|
//#endregion
|
|
99
99
|
export { CreateOpenAIToolsAgentParams, createOpenAIToolsAgent };
|
|
100
100
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":["StructuredToolInterface","BaseChatModel","BaseChatModelCallOptions","ChatPromptTemplate","OpenAIClient","ToolDefinition","OpenAIToolsAgentOutputParser","ToolsAgentStep","AgentRunnableSequence","CreateOpenAIToolsAgentParams","ChatCompletionTool","createOpenAIToolsAgent","llm","tools","prompt","streamRunnable","
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["StructuredToolInterface","BaseChatModel","BaseChatModelCallOptions","ChatPromptTemplate","OpenAIClient","ToolDefinition","OpenAIToolsAgentOutputParser","ToolsAgentStep","AgentRunnableSequence","CreateOpenAIToolsAgentParams","ChatCompletionTool","createOpenAIToolsAgent","llm","tools","prompt","streamRunnable","_langchain_core_agents0","AgentFinish","AgentAction","Promise"],"sources":["../../../src/agents/openai_tools/index.d.ts"],"sourcesContent":["import type { StructuredToolInterface } from \"@langchain/core/tools\";\nimport type { BaseChatModel, BaseChatModelCallOptions } from \"@langchain/core/language_models/chat_models\";\nimport { ChatPromptTemplate } from \"@langchain/core/prompts\";\nimport { OpenAIClient } from \"@langchain/openai\";\nimport { ToolDefinition } from \"@langchain/core/language_models/base\";\nimport { OpenAIToolsAgentOutputParser, type ToolsAgentStep } from \"./output_parser.js\";\nimport { AgentRunnableSequence } from \"../agent.js\";\nexport { OpenAIToolsAgentOutputParser, type ToolsAgentStep };\n/**\n * Params used by the createOpenAIToolsAgent function.\n */\nexport type CreateOpenAIToolsAgentParams = {\n /**\n * LLM to use as the agent. Should work with OpenAI tool calling,\n * so must either be an OpenAI model that supports that or a wrapper of\n * a different model that adds in equivalent support.\n */\n llm: BaseChatModel<BaseChatModelCallOptions & {\n tools?: StructuredToolInterface[] | OpenAIClient.ChatCompletionTool[] | any[];\n }>;\n /** Tools this agent has access to. */\n tools: StructuredToolInterface[] | ToolDefinition[];\n /** The prompt to use, must have an input key of `agent_scratchpad`. */\n prompt: ChatPromptTemplate;\n /**\n * Whether to invoke the underlying model in streaming mode,\n * allowing streaming of intermediate steps. Defaults to true.\n */\n streamRunnable?: boolean;\n};\n/**\n * Create an agent that uses OpenAI-style tool calling.\n * @param params Params required to create the agent. Includes an LLM, tools, and prompt.\n * @returns A runnable sequence representing an agent. It takes as input all the same input\n * variables as the prompt passed in does. It returns as output either an\n * AgentAction or AgentFinish.\n *\n * @example\n * ```typescript\n * import { AgentExecutor, createOpenAIToolsAgent } from \"langchain/agents\";\n * import { pull } from \"langchain/hub\";\n * import type { ChatPromptTemplate } from \"@langchain/core/prompts\";\n * import { AIMessage, HumanMessage } from \"@langchain/core/messages\";\n *\n * import { ChatOpenAI } from \"@langchain/openai\";\n *\n * // Define the tools the agent will have access to.\n * const tools = [...];\n *\n * // Get the prompt to use - you can modify this!\n * // If you want to see the prompt in full, you can at:\n * // https://smith.langchain.com/hub/hwchase17/openai-tools-agent\n * const prompt = await pull<ChatPromptTemplate>(\n * \"hwchase17/openai-tools-agent\"\n * );\n *\n * const llm = new ChatOpenAI({\n * temperature: 0,\n * model: \"gpt-3.5-turbo-1106\",\n * });\n *\n * const agent = await createOpenAIToolsAgent({\n * llm,\n * tools,\n * prompt,\n * });\n *\n * const agentExecutor = new AgentExecutor({\n * agent,\n * tools,\n * });\n *\n * const result = await agentExecutor.invoke({\n * input: \"what is LangChain?\",\n * });\n *\n * // With chat history\n * const result2 = await agentExecutor.invoke({\n * input: \"what's my name?\",\n * chat_history: [\n * new HumanMessage(\"hi! my name is cob\"),\n * new AIMessage(\"Hello Cob! How can I assist you today?\"),\n * ],\n * });\n * ```\n */\nexport declare function createOpenAIToolsAgent({ llm, tools, prompt, streamRunnable }: CreateOpenAIToolsAgentParams): Promise<AgentRunnableSequence<{\n steps: ToolsAgentStep[];\n}, import(\"@langchain/core/agents\").AgentFinish | import(\"@langchain/core/agents\").AgentAction[]>>;\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;;;;;;;;;AAWYS,KAAAA,4BAAAA,GAA4B;EAMjBP;;;;;EAIgBG,GAAAA,EAJ9BJ,aAI8BI,CAJhBH,wBAIgBG,GAAAA;IAE3BF,KAAAA,CAAAA,EALIH,uBAKJG,EAAAA,GALgCC,YAAAA,CAAaM,kBAK7CP,EAAAA,GAAAA,GAAAA,EAAAA;EAAkB,CAAA,CAAA;EA+DNQ;EAAyBC,KAAAA,EAjEtCZ,uBAiEsCY,EAAAA,GAjEVP,cAiEUO,EAAAA;EAAKC;EAAOC,MAAAA,EA/DjDX,kBA+DiDW;EAAQC;;;;EAEtBC,cAAAA,CAAAA,EAAAA,OAAoCE;CAF2CV;;AAAD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAArGG,sBAAAA;;;;;GAA+DF,+BAA+BU,QAAQX;SACnHD;GAAcS,uBAAAA,CACWC,WAAAA,GAAWD,uBAAAA,CAAoCE,WAAAA"}
|
|
@@ -2,7 +2,7 @@ import { AgentRunnableSequence } from "../agent.js";
|
|
|
2
2
|
import { BasePromptTemplate } from "@langchain/core/prompts";
|
|
3
3
|
import { ToolInterface } from "@langchain/core/tools";
|
|
4
4
|
import { BaseLanguageModelInterface } from "@langchain/core/language_models/base";
|
|
5
|
-
import * as
|
|
5
|
+
import * as _langchain_core_agents5 from "@langchain/core/agents";
|
|
6
6
|
import { AgentStep } from "@langchain/core/agents";
|
|
7
7
|
|
|
8
8
|
//#region src/agents/react/index.d.ts
|
|
@@ -75,7 +75,7 @@ declare function createReactAgent({
|
|
|
75
75
|
streamRunnable
|
|
76
76
|
}: CreateReactAgentParams): Promise<AgentRunnableSequence<{
|
|
77
77
|
steps: AgentStep[];
|
|
78
|
-
},
|
|
78
|
+
}, _langchain_core_agents5.AgentAction | _langchain_core_agents5.AgentFinish>>;
|
|
79
79
|
//#endregion
|
|
80
80
|
export { CreateReactAgentParams, createReactAgent };
|
|
81
81
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":["ToolInterface","BasePromptTemplate","BaseLanguageModelInterface","AgentStep","AgentRunnableSequence","CreateReactAgentParams","createReactAgent","llm","tools","prompt","streamRunnable","
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["ToolInterface","BasePromptTemplate","BaseLanguageModelInterface","AgentStep","AgentRunnableSequence","CreateReactAgentParams","createReactAgent","llm","tools","prompt","streamRunnable","_langchain_core_agents5","AgentAction","AgentFinish","Promise"],"sources":["../../../src/agents/react/index.d.ts"],"sourcesContent":["import type { ToolInterface } from \"@langchain/core/tools\";\nimport { BasePromptTemplate } from \"@langchain/core/prompts\";\nimport type { BaseLanguageModelInterface } from \"@langchain/core/language_models/base\";\nimport { AgentStep } from \"@langchain/core/agents\";\nimport { AgentRunnableSequence } from \"../agent.js\";\n/**\n * Params used by the createXmlAgent function.\n */\nexport type CreateReactAgentParams = {\n /** LLM to use for the agent. */\n llm: BaseLanguageModelInterface;\n /** Tools this agent has access to. */\n tools: ToolInterface[];\n /**\n * The prompt to use. Must have input keys for\n * `tools`, `tool_names`, and `agent_scratchpad`.\n */\n prompt: BasePromptTemplate;\n /**\n * Whether to invoke the underlying model in streaming mode,\n * allowing streaming of intermediate steps. Defaults to true.\n */\n streamRunnable?: boolean;\n};\n/**\n * Create an agent that uses ReAct prompting.\n * @param params Params required to create the agent. Includes an LLM, tools, and prompt.\n * @returns A runnable sequence representing an agent. It takes as input all the same input\n * variables as the prompt passed in does. It returns as output either an\n * AgentAction or AgentFinish.\n *\n * @example\n * ```typescript\n * import { AgentExecutor, createReactAgent } from \"langchain/agents\";\n * import { pull } from \"langchain/hub\";\n * import type { PromptTemplate } from \"@langchain/core/prompts\";\n *\n * import { OpenAI } from \"@langchain/openai\";\n *\n * // Define the tools the agent will have access to.\n * const tools = [...];\n *\n * // Get the prompt to use - you can modify this!\n * // If you want to see the prompt in full, you can at:\n * // https://smith.langchain.com/hub/hwchase17/react\n * const prompt = await pull<PromptTemplate>(\"hwchase17/react\");\n *\n * const llm = new OpenAI({\n * temperature: 0,\n * });\n *\n * const agent = await createReactAgent({\n * llm,\n * tools,\n * prompt,\n * });\n *\n * const agentExecutor = new AgentExecutor({\n * agent,\n * tools,\n * });\n *\n * const result = await agentExecutor.invoke({\n * input: \"what is LangChain?\",\n * });\n * ```\n */\nexport declare function createReactAgent({ llm, tools, prompt, streamRunnable }: CreateReactAgentParams): Promise<AgentRunnableSequence<{\n steps: AgentStep[];\n}, import(\"@langchain/core/agents\").AgentAction | import(\"@langchain/core/agents\").AgentFinish>>;\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;;;;;;AAQYK,KAAAA,sBAAAA,GAAsB;EAEzBH;EAEEF,GAAAA,EAFFE,0BAEEF;EAKCC;EAAkB,KAAA,EALnBD,aAKmB,EAAA;EAkDNM;;;;EAAuCI,MAAAA,EAlDnDT,kBAkDmDS;EAAkBL;;;;EAAiCD,cAAAA,CAAAA,EAAAA,OAAAA;CAARU;AAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAzFR,gBAAAA;;;;;GAAyDD,yBAAyBS,QAAQV;SACvGD;GAASQ,uBAAAA,CACgBC,WAAAA,GAAWD,uBAAAA,CAAoCE"}
|
|
@@ -5,7 +5,7 @@ import { StructuredChatOutputParserWithRetries } from "./outputParser.js";
|
|
|
5
5
|
import { BaseMessagePromptTemplate, BasePromptTemplate, ChatPromptTemplate } from "@langchain/core/prompts";
|
|
6
6
|
import { StructuredToolInterface } from "@langchain/core/tools";
|
|
7
7
|
import { BaseLanguageModelInterface, ToolDefinition } from "@langchain/core/language_models/base";
|
|
8
|
-
import * as
|
|
8
|
+
import * as _langchain_core_agents1 from "@langchain/core/agents";
|
|
9
9
|
import { AgentStep } from "@langchain/core/agents";
|
|
10
10
|
|
|
11
11
|
//#region src/agents/structured_chat/index.d.ts
|
|
@@ -176,7 +176,7 @@ declare function createStructuredChatAgent({
|
|
|
176
176
|
streamRunnable
|
|
177
177
|
}: CreateStructuredChatAgentParams): Promise<AgentRunnableSequence<{
|
|
178
178
|
steps: AgentStep[];
|
|
179
|
-
},
|
|
179
|
+
}, _langchain_core_agents1.AgentAction | _langchain_core_agents1.AgentFinish>>;
|
|
180
180
|
//#endregion
|
|
181
181
|
export { CreateStructuredChatAgentParams, StructuredChatAgent, StructuredChatAgentInput, StructuredChatCreatePromptArgs, createStructuredChatAgent };
|
|
182
182
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":["StructuredToolInterface","BaseLanguageModelInterface","ToolDefinition","BasePromptTemplate","BaseMessagePromptTemplate","ChatPromptTemplate","AgentStep","Optional","Agent","AgentArgs","AgentRunnableSequence","OutputParserArgs","AgentInput","StructuredChatOutputParserWithRetries","StructuredChatCreatePromptArgs","StructuredChatAgentInput","StructuredChatAgent","Promise","CreateStructuredChatAgentParams","createStructuredChatAgent","llm","tools","prompt","streamRunnable","
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["StructuredToolInterface","BaseLanguageModelInterface","ToolDefinition","BasePromptTemplate","BaseMessagePromptTemplate","ChatPromptTemplate","AgentStep","Optional","Agent","AgentArgs","AgentRunnableSequence","OutputParserArgs","AgentInput","StructuredChatOutputParserWithRetries","StructuredChatCreatePromptArgs","StructuredChatAgentInput","StructuredChatAgent","Promise","CreateStructuredChatAgentParams","createStructuredChatAgent","llm","tools","prompt","streamRunnable","_langchain_core_agents1","AgentAction","AgentFinish"],"sources":["../../../src/agents/structured_chat/index.d.ts"],"sourcesContent":["import type { StructuredToolInterface } from \"@langchain/core/tools\";\nimport { type BaseLanguageModelInterface, type ToolDefinition } from \"@langchain/core/language_models/base\";\nimport type { BasePromptTemplate } from \"@langchain/core/prompts\";\nimport { BaseMessagePromptTemplate, ChatPromptTemplate } from \"@langchain/core/prompts\";\nimport { AgentStep } from \"@langchain/core/agents\";\nimport { Optional } from \"../../types/type-utils.js\";\nimport { Agent, AgentArgs, AgentRunnableSequence, OutputParserArgs } from \"../agent.js\";\nimport { AgentInput } from \"../types.js\";\nimport { StructuredChatOutputParserWithRetries } from \"./outputParser.js\";\n/**\n * Interface for arguments used to create a prompt for a\n * StructuredChatAgent.\n */\nexport interface StructuredChatCreatePromptArgs {\n /** String to put after the list of tools. */\n suffix?: string;\n /** String to put before the list of tools. */\n prefix?: string;\n /** String to use directly as the human message template. */\n humanMessageTemplate?: string;\n /** List of input variables the final prompt will expect. */\n inputVariables?: string[];\n /** List of historical prompts from memory. */\n memoryPrompts?: BaseMessagePromptTemplate[];\n}\n/**\n * Type for input data for creating a StructuredChatAgent, with the\n * 'outputParser' property made optional.\n */\nexport type StructuredChatAgentInput = Optional<AgentInput, \"outputParser\">;\n/**\n * Agent that interoperates with Structured Tools using React logic.\n * @augments Agent\n */\nexport declare class StructuredChatAgent extends Agent {\n static lc_name(): string;\n lc_namespace: string[];\n constructor(input: StructuredChatAgentInput);\n _agentType(): \"structured-chat-zero-shot-react-description\";\n observationPrefix(): string;\n llmPrefix(): string;\n _stop(): string[];\n /**\n * Validates that all provided tools have a description. Throws an error\n * if any tool lacks a description.\n * @param tools Array of StructuredTool instances to validate.\n */\n static validateTools(tools: StructuredToolInterface[]): void;\n /**\n * Returns a default output parser for the StructuredChatAgent. If an LLM\n * is provided, it creates an output parser with retry logic from the LLM.\n * @param fields Optional fields to customize the output parser. Can include an LLM and a list of tool names.\n * @returns An instance of StructuredChatOutputParserWithRetries.\n */\n static getDefaultOutputParser(fields?: OutputParserArgs & {\n toolNames: string[];\n }): StructuredChatOutputParserWithRetries;\n /**\n * Constructs the agent's scratchpad from a list of steps. If the agent's\n * scratchpad is not empty, it prepends a message indicating that the\n * agent has not seen any previous work.\n * @param steps Array of AgentStep instances to construct the scratchpad from.\n * @returns A Promise that resolves to a string representing the agent's scratchpad.\n */\n constructScratchPad(steps: AgentStep[]): Promise<string>;\n /**\n * Creates a string representation of the schemas of the provided tools.\n * @param tools Array of StructuredTool instances to create the schemas string from.\n * @returns A string representing the schemas of the provided tools.\n */\n static createToolSchemasString(tools: StructuredToolInterface[]): string;\n /**\n * Create prompt in the style of the agent.\n *\n * @param tools - List of tools the agent will have access to, used to format the prompt.\n * @param args - Arguments to create the prompt with.\n * @param args.suffix - String to put after the list of tools.\n * @param args.prefix - String to put before the list of tools.\n * @param args.inputVariables List of input variables the final prompt will expect.\n * @param args.memoryPrompts List of historical prompts from memory.\n */\n static createPrompt(tools: StructuredToolInterface[], args?: StructuredChatCreatePromptArgs): ChatPromptTemplate<any, any>;\n /**\n * Creates a StructuredChatAgent from an LLM and a list of tools.\n * Validates the tools, creates a prompt, and sets up an LLM chain for the\n * agent.\n * @param llm BaseLanguageModel instance to create the agent from.\n * @param tools Array of StructuredTool instances to create the agent from.\n * @param args Optional arguments to customize the creation of the agent. Can include arguments for creating the prompt and AgentArgs.\n * @returns A new instance of StructuredChatAgent.\n */\n static fromLLMAndTools(llm: BaseLanguageModelInterface, tools: StructuredToolInterface[], args?: StructuredChatCreatePromptArgs & AgentArgs): StructuredChatAgent;\n}\n/**\n * Params used by the createStructuredChatAgent function.\n */\nexport type CreateStructuredChatAgentParams = {\n /** LLM to use as the agent. */\n llm: BaseLanguageModelInterface;\n /** Tools this agent has access to. */\n tools: (StructuredToolInterface | ToolDefinition)[];\n /**\n * The prompt to use. Must have input keys for\n * `tools`, `tool_names`, and `agent_scratchpad`.\n */\n prompt: BasePromptTemplate;\n /**\n * Whether to invoke the underlying model in streaming mode,\n * allowing streaming of intermediate steps. Defaults to true.\n */\n streamRunnable?: boolean;\n};\n/**\n * Create an agent aimed at supporting tools with multiple inputs.\n * @param params Params required to create the agent. Includes an LLM, tools, and prompt.\n * @returns A runnable sequence representing an agent. It takes as input all the same input\n * variables as the prompt passed in does. It returns as output either an\n * AgentAction or AgentFinish.\n *\n * @example\n * ```typescript\n * import { AgentExecutor, createStructuredChatAgent } from \"langchain/agents\";\n * import { pull } from \"langchain/hub\";\n * import type { ChatPromptTemplate } from \"@langchain/core/prompts\";\n * import { AIMessage, HumanMessage } from \"@langchain/core/messages\";\n *\n * import { ChatOpenAI } from \"@langchain/openai\";\n *\n * // Define the tools the agent will have access to.\n * const tools = [...];\n *\n * // Get the prompt to use - you can modify this!\n * // If you want to see the prompt in full, you can at:\n * // https://smith.langchain.com/hub/hwchase17/structured-chat-agent\n * const prompt = await pull<ChatPromptTemplate>(\n * \"hwchase17/structured-chat-agent\"\n * );\n *\n * const llm = new ChatOpenAI({\n * temperature: 0,\n * model: \"gpt-3.5-turbo-1106\",\n * });\n *\n * const agent = await createStructuredChatAgent({\n * llm,\n * tools,\n * prompt,\n * });\n *\n * const agentExecutor = new AgentExecutor({\n * agent,\n * tools,\n * });\n *\n * const result = await agentExecutor.invoke({\n * input: \"what is LangChain?\",\n * });\n *\n * // With chat history\n * const result2 = await agentExecutor.invoke({\n * input: \"what's my name?\",\n * chat_history: [\n * new HumanMessage(\"hi! my name is cob\"),\n * new AIMessage(\"Hello Cob! How can I assist you today?\"),\n * ],\n * });\n * ```\n */\nexport declare function createStructuredChatAgent({ llm, tools, prompt, streamRunnable }: CreateStructuredChatAgentParams): Promise<AgentRunnableSequence<{\n steps: AgentStep[];\n}, import(\"@langchain/core/agents\").AgentAction | import(\"@langchain/core/agents\").AgentFinish>>;\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;;;;;;;;;AAaA;AAgBA;AAKqBgB,UArBJF,8BAAAA,CAqBuB;EAGjBC;EAUSf,MAAAA,CAAAA,EAAAA,MAAAA;EAOWW;EAEnCE,MAAAA,CAAAA,EAAAA,MAAAA;EAQuBP;EAAcW,oBAAAA,CAAAA,EAAAA,MAAAA;EAMHjB;EAWXA,cAAAA,CAAAA,EAAAA,MAAAA,EAAAA;EAAkCc;EAAiCT,aAAAA,CAAAA,EA1D9ED,yBA0D8EC,EAAAA;;;;;;AA/CjDG,KALrCO,wBAAAA,GAA2BR,QAKUC,CALDI,UAKCJ,EAAAA,cAAAA,CAAAA;AAAK;AA8DtD;;;AAIsCN,cAlEjBc,mBAAAA,SAA4BR,KAAAA,CAkEXN;EAK1BC,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAkB,YAAA,EAAA,MAAA,EAAA;EA+DNgB,WAAAA,CAAAA,KAAAA,EAnIDJ,wBAmI0B;EAAGK,UAAAA,CAAAA,CAAAA,EAAAA,6CAAAA;EAAKC,iBAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAOC,SAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAQC,KAAAA,CAAAA,CAAAA,EAAAA,MAAAA,EAAAA;EAAkBL;;;;;EAAkCD,OAAAA,aAAAA,CAAAA,KAAAA,EAzH5FjB,uBAyH4FiB,EAAAA,CAAAA,EAAAA,IAAAA;EAAO;;;;;;yCAlHxFN;;MAEnCE;;;;;;;;6BAQuBP,cAAcW;;;;;;wCAMHjB;;;;;;;;;;;6BAWXA,kCAAkCc,iCAAiCT;;;;;;;;;;8BAUlEJ,mCAAmCD,kCAAkCc,iCAAiCL,YAAYO;;;;;KAKtIE,+BAAAA;;OAEHjB;;UAEGD,0BAA0BE;;;;;UAK1BC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+DYgB,yBAAAA;;;;;GAAkED,kCAAkCD,QAAQP;SACzHJ;GAASkB,uBAAAA,CACgBC,WAAAA,GAAWD,uBAAAA,CAAoCE"}
|
|
@@ -3,7 +3,7 @@ import { AgentRunnableSequence } from "../agent.js";
|
|
|
3
3
|
import { ChatPromptTemplate } from "@langchain/core/prompts";
|
|
4
4
|
import { StructuredToolInterface } from "@langchain/core/tools";
|
|
5
5
|
import { LanguageModelLike, ToolDefinition } from "@langchain/core/language_models/base";
|
|
6
|
-
import * as
|
|
6
|
+
import * as _langchain_core_agents3 from "@langchain/core/agents";
|
|
7
7
|
|
|
8
8
|
//#region src/agents/tool_calling/index.d.ts
|
|
9
9
|
/**
|
|
@@ -83,7 +83,7 @@ declare function createToolCallingAgent({
|
|
|
83
83
|
streamRunnable
|
|
84
84
|
}: CreateToolCallingAgentParams): AgentRunnableSequence<{
|
|
85
85
|
steps: ToolsAgentStep[];
|
|
86
|
-
},
|
|
86
|
+
}, _langchain_core_agents3.AgentFinish | _langchain_core_agents3.AgentAction[]>;
|
|
87
87
|
//#endregion
|
|
88
88
|
export { CreateToolCallingAgentParams, createToolCallingAgent };
|
|
89
89
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":["ChatPromptTemplate","StructuredToolInterface","LanguageModelLike","ToolDefinition","AgentRunnableSequence","ToolsAgentStep","CreateToolCallingAgentParams","createToolCallingAgent","llm","tools","prompt","streamRunnable","
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["ChatPromptTemplate","StructuredToolInterface","LanguageModelLike","ToolDefinition","AgentRunnableSequence","ToolsAgentStep","CreateToolCallingAgentParams","createToolCallingAgent","llm","tools","prompt","streamRunnable","_langchain_core_agents3","AgentFinish","AgentAction"],"sources":["../../../src/agents/tool_calling/index.d.ts"],"sourcesContent":["import { ChatPromptTemplate } from \"@langchain/core/prompts\";\nimport { StructuredToolInterface } from \"@langchain/core/tools\";\nimport { LanguageModelLike, ToolDefinition } from \"@langchain/core/language_models/base\";\nimport { AgentRunnableSequence } from \"../agent.js\";\nimport { ToolsAgentStep } from \"./output_parser.js\";\n/**\n * Params used by the createOpenAIToolsAgent function.\n */\nexport type CreateToolCallingAgentParams = {\n /**\n * LLM to use as the agent. Should work with OpenAI tool calling,\n * so must either be an OpenAI model that supports that or a wrapper of\n * a different model that adds in equivalent support.\n */\n llm: LanguageModelLike;\n /** Tools this agent has access to. */\n tools: StructuredToolInterface[] | ToolDefinition[];\n /** The prompt to use, must have an input key of `agent_scratchpad`. */\n prompt: ChatPromptTemplate;\n /**\n * Whether to invoke the underlying model in streaming mode,\n * allowing streaming of intermediate steps. Defaults to true.\n */\n streamRunnable?: boolean;\n};\n/**\n * Create an agent that uses tools.\n * @param params Params required to create the agent. Includes an LLM, tools, and prompt.\n * @returns A runnable sequence representing an agent. It takes as input all the same input\n * variables as the prompt passed in does. It returns as output either an\n * AgentAction or AgentFinish.\n * @example\n * ```typescript\n * import { ChatAnthropic } from \"@langchain/anthropic\";\n * import { ChatPromptTemplate, MessagesPlaceholder } from \"@langchain/core/prompts\";\n * import { AgentExecutor, createToolCallingAgent } from \"langchain/agents\";\n *\n * const prompt = ChatPromptTemplate.fromMessages(\n * [\n * [\"system\", \"You are a helpful assistant\"],\n * [\"placeholder\", \"{chat_history}\"],\n * [\"human\", \"{input}\"],\n * [\"placeholder\", \"{agent_scratchpad}\"],\n * ]\n * );\n *\n *\n * const llm = new ChatAnthropic({\n * modelName: \"claude-3-opus-20240229\",\n * temperature: 0,\n * });\n *\n * // Define the tools the agent will have access to.\n * const tools = [...];\n *\n * const agent = createToolCallingAgent({ llm, tools, prompt });\n *\n * const agentExecutor = new AgentExecutor({ agent, tools });\n *\n * const result = await agentExecutor.invoke({input: \"what is LangChain?\"});\n *\n * // Using with chat history\n * import { AIMessage, HumanMessage } from \"@langchain/core/messages\";\n *\n * const result2 = await agentExecutor.invoke(\n * {\n * input: \"what's my name?\",\n * chat_history: [\n * new HumanMessage({content: \"hi! my name is bob\"}),\n * new AIMessage({content: \"Hello Bob! How can I assist you today?\"}),\n * ],\n * }\n * );\n * ```\n */\nexport declare function createToolCallingAgent({ llm, tools, prompt, streamRunnable }: CreateToolCallingAgentParams): AgentRunnableSequence<{\n steps: ToolsAgentStep[];\n}, import(\"@langchain/core/agents\").AgentFinish | import(\"@langchain/core/agents\").AgentAction[]>;\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;;;;;;AAQYM,KAAAA,4BAAAA,GAA4B;EAM/BJ;;;;AAIqB;EAyDNK,GAAAA,EA7DfL,iBA6DeK;EAAyBC;EAAKC,KAAAA,EA3D3CR,uBA2D2CQ,EAAAA,GA3DfN,cA2DeM,EAAAA;EAAOC;EAAQC,MAAAA,EAzDzDX,kBAyDyDW;EAAkBL;;;;EAA+BF,cAAAA,CAAAA,EAAAA,OAAAA;AAAqB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAnHG,sBAAAA;;;;;GAA+DD,+BAA+BF;SAC3GC;GAAcO,uBAAAA,CACWC,WAAAA,GAAWD,uBAAAA,CAAoCE,WAAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseChatMemory, BaseChatMemoryInput } from "../../../memory/chat_memory.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _langchain_core_messages0 from "@langchain/core/messages";
|
|
3
3
|
import { InputValues, MemoryVariables, OutputValues } from "@langchain/core/memory";
|
|
4
4
|
import { ChatOpenAI } from "@langchain/openai";
|
|
5
5
|
|
|
@@ -37,7 +37,7 @@ declare class OpenAIAgentTokenBufferMemory extends BaseChatMemory {
|
|
|
37
37
|
* Retrieves the messages from the chat history.
|
|
38
38
|
* @returns Promise that resolves with the messages from the chat history.
|
|
39
39
|
*/
|
|
40
|
-
getMessages(): Promise<
|
|
40
|
+
getMessages(): Promise<_langchain_core_messages0.BaseMessage<_langchain_core_messages0.MessageStructure, _langchain_core_messages0.MessageType>[]>;
|
|
41
41
|
/**
|
|
42
42
|
* Loads memory variables from the input values.
|
|
43
43
|
* @param _values Input values.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token_buffer_memory.d.cts","names":["ChatOpenAI","InputValues","MemoryVariables","OutputValues","BaseChatMemory","BaseChatMemoryInput","OpenAIAgentTokenBufferMemoryFields","OpenAIAgentTokenBufferMemory","
|
|
1
|
+
{"version":3,"file":"token_buffer_memory.d.cts","names":["ChatOpenAI","InputValues","MemoryVariables","OutputValues","BaseChatMemory","BaseChatMemoryInput","OpenAIAgentTokenBufferMemoryFields","OpenAIAgentTokenBufferMemory","_langchain_core_messages0","MessageStructure","MessageType","BaseMessage","Promise"],"sources":["../../../../src/agents/toolkits/conversational_retrieval/token_buffer_memory.d.ts"],"sourcesContent":["import { ChatOpenAI } from \"@langchain/openai\";\nimport { InputValues, MemoryVariables, OutputValues } from \"@langchain/core/memory\";\nimport { BaseChatMemory, BaseChatMemoryInput } from \"../../../memory/chat_memory.js\";\n/**\n * Type definition for the fields required to initialize an instance of\n * OpenAIAgentTokenBufferMemory.\n */\nexport type OpenAIAgentTokenBufferMemoryFields = BaseChatMemoryInput & {\n llm: ChatOpenAI;\n humanPrefix?: string;\n aiPrefix?: string;\n memoryKey?: string;\n maxTokenLimit?: number;\n returnMessages?: boolean;\n outputKey?: string;\n intermediateStepsKey?: string;\n};\n/**\n * Memory used to save agent output and intermediate steps.\n */\nexport declare class OpenAIAgentTokenBufferMemory extends BaseChatMemory {\n humanPrefix: string;\n aiPrefix: string;\n llm: ChatOpenAI;\n memoryKey: string;\n maxTokenLimit: number;\n returnMessages: boolean;\n outputKey: string;\n intermediateStepsKey: string;\n constructor(fields: OpenAIAgentTokenBufferMemoryFields);\n get memoryKeys(): string[];\n /**\n * Retrieves the messages from the chat history.\n * @returns Promise that resolves with the messages from the chat history.\n */\n getMessages(): Promise<import(\"@langchain/core/messages\").BaseMessage<import(\"@langchain/core/messages\").MessageStructure, import(\"@langchain/core/messages\").MessageType>[]>;\n /**\n * Loads memory variables from the input values.\n * @param _values Input values.\n * @returns Promise that resolves with the loaded memory variables.\n */\n loadMemoryVariables(_values: InputValues): Promise<MemoryVariables>;\n /**\n * Saves the context of the chat, including user input, AI output, and\n * intermediate steps. Prunes the chat history if the total token count\n * exceeds the maximum limit.\n * @param inputValues Input values.\n * @param outputValues Output values.\n * @returns Promise that resolves when the context has been saved.\n */\n saveContext(inputValues: InputValues, outputValues: OutputValues): Promise<void>;\n}\n//# sourceMappingURL=token_buffer_memory.d.ts.map"],"mappings":";;;;;;;;;;AAOA;AAaqBO,KAbTD,kCAAAA,GAAqCD,mBAaA,GAAA;EAGxCL,GAAAA,EAfAA,UAeAA;EAMeM,WAAAA,CAAAA,EAAAA,MAAAA;EAAkCE,QAAAA,CAAAA,EAAAA,MAAAA;EAMmEA,SAAAA,CAAAA,EAAAA,MAAAA;EAAgDA,aAAAA,CAAAA,EAAAA,MAAAA;EAA1JI,cAAAA,CAAAA,EAAAA,OAAAA;EAMcX,SAAAA,CAAAA,EAAAA,MAAAA;EAAsBC,oBAAAA,CAAAA,EAAAA,MAAAA;CAARU;;;;AArBWR,cAArCG,4BAAAA,SAAqCH,cAAAA,CAAAA;EAAc,WAAA,EAAA,MAAA;;OAG/DJ;;;;;;sBAMeM;;;;;;iBAMLM,QAA0JJ,yBAAAA,CAA/GG,YANJH,yBAAAA,CAMmDC,gBAAAA,EAAgBD,yBAAAA,CAAqCE,WAAAA;;;;;;+BAMjIT,cAAcW,QAAQV;;;;;;;;;2BAS1BD,2BAA2BE,eAAeS"}
|
|
@@ -4,7 +4,7 @@ import { ChatGeneration, Generation } from "@langchain/core/outputs";
|
|
|
4
4
|
import { BaseLLMOutputParser } from "@langchain/core/output_parsers";
|
|
5
5
|
import { ChainValues } from "@langchain/core/utils/types";
|
|
6
6
|
import { BasePromptTemplate } from "@langchain/core/prompts";
|
|
7
|
-
import * as
|
|
7
|
+
import * as _langchain_core_prompt_values3 from "@langchain/core/prompt_values";
|
|
8
8
|
import { BaseCallbackConfig, Callbacks } from "@langchain/core/callbacks/manager";
|
|
9
9
|
import { StructuredToolInterface } from "@langchain/core/tools";
|
|
10
10
|
import { BaseChatModel } from "@langchain/core/language_models/chat_models";
|
|
@@ -31,7 +31,7 @@ declare class TrajectoryEvalChain extends AgentTrajectoryEvaluator {
|
|
|
31
31
|
requiresInput: boolean;
|
|
32
32
|
requiresReference: boolean;
|
|
33
33
|
outputParser: TrajectoryOutputParser;
|
|
34
|
-
static resolveTrajectoryPrompt(prompt?: BasePromptTemplate | undefined, agentTools?: StructuredToolInterface[]): BasePromptTemplate<any,
|
|
34
|
+
static resolveTrajectoryPrompt(prompt?: BasePromptTemplate | undefined, agentTools?: StructuredToolInterface[]): BasePromptTemplate<any, _langchain_core_prompt_values3.BasePromptValueInterface, any>;
|
|
35
35
|
/**
|
|
36
36
|
* Get the description of the agent tools.
|
|
37
37
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trajectory.d.cts","names":["StructuredToolInterface","BaseLLMOutputParser","AgentStep","ChainValues","ChatGeneration","Generation","BasePromptTemplate","Callbacks","BaseCallbackConfig","BaseChatModel","AgentTrajectoryEvaluator","EvalOutputType","LLMEvalChainInput","LLMTrajectoryEvaluatorArgs","ExtractLLMCallOptions","TrajectoryOutputParser","Promise","TrajectoryEvalChain","
|
|
1
|
+
{"version":3,"file":"trajectory.d.cts","names":["StructuredToolInterface","BaseLLMOutputParser","AgentStep","ChainValues","ChatGeneration","Generation","BasePromptTemplate","Callbacks","BaseCallbackConfig","BaseChatModel","AgentTrajectoryEvaluator","EvalOutputType","LLMEvalChainInput","LLMTrajectoryEvaluatorArgs","ExtractLLMCallOptions","TrajectoryOutputParser","Promise","TrajectoryEvalChain","_langchain_core_prompt_values3","BasePromptValueInterface","Omit","Partial"],"sources":["../../../src/evaluation/agents/trajectory.d.ts"],"sourcesContent":["import type { StructuredToolInterface } from \"@langchain/core/tools\";\nimport { BaseLLMOutputParser } from \"@langchain/core/output_parsers\";\nimport { AgentStep } from \"@langchain/core/agents\";\nimport { ChainValues } from \"@langchain/core/utils/types\";\nimport { ChatGeneration, Generation } from \"@langchain/core/outputs\";\nimport { BasePromptTemplate } from \"@langchain/core/prompts\";\nimport { Callbacks, BaseCallbackConfig } from \"@langchain/core/callbacks/manager\";\nimport { BaseChatModel } from \"@langchain/core/language_models/chat_models\";\nimport { AgentTrajectoryEvaluator, EvalOutputType, LLMEvalChainInput, LLMTrajectoryEvaluatorArgs, type ExtractLLMCallOptions } from \"../base.js\";\n/**\n * A parser for the output of the TrajectoryEvalChain.\n */\nexport declare class TrajectoryOutputParser extends BaseLLMOutputParser<EvalOutputType> {\n static lc_name(): string;\n lc_namespace: string[];\n parseResult(generations: Generation[] | ChatGeneration[], _callbacks: Callbacks | undefined): Promise<EvalOutputType>;\n}\n/**\n * A chain for evaluating ReAct style agents.\n *\n * This chain is used to evaluate ReAct style agents by reasoning about\n * the sequence of actions taken and their outcomes.\n */\nexport declare class TrajectoryEvalChain extends AgentTrajectoryEvaluator {\n static lc_name(): string;\n criterionName?: string;\n evaluationName?: string;\n requiresInput: boolean;\n requiresReference: boolean;\n outputParser: TrajectoryOutputParser;\n static resolveTrajectoryPrompt(prompt?: BasePromptTemplate | undefined, agentTools?: StructuredToolInterface[]): BasePromptTemplate<any, import(\"@langchain/core/prompt_values\").BasePromptValueInterface, any>;\n /**\n * Get the description of the agent tools.\n *\n * @returns The description of the agent tools.\n */\n static toolsDescription(agentTools: StructuredToolInterface[]): string;\n /**\n * Create a new TrajectoryEvalChain.\n * @param llm\n * @param agentTools - The tools used by the agent.\n * @param chainOptions - The options for the chain.\n */\n static fromLLM(llm: BaseChatModel, agentTools?: StructuredToolInterface[], chainOptions?: Partial<Omit<LLMEvalChainInput, \"llm\">>): Promise<TrajectoryEvalChain>;\n _prepareOutput(result: ChainValues): any;\n /**\n * Get the agent trajectory as a formatted string.\n *\n * @param steps - The agent trajectory.\n * @returns The formatted agent trajectory.\n */\n getAgentTrajectory(steps: AgentStep[]): string;\n formatReference(reference?: string): string;\n _evaluateAgentTrajectory(args: LLMTrajectoryEvaluatorArgs, callOptions: ExtractLLMCallOptions<this[\"llm\"]>, config?: Callbacks | BaseCallbackConfig): Promise<ChainValues>;\n}\n//# sourceMappingURL=trajectory.d.ts.map"],"mappings":";;;;;;;;;;;;;;;AAYqBe,cAAAA,sBAAAA,SAA+Bd,mBAAT,CAA6BU,cAA7B,CAAA,CAAA;EAA6BA,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAG3CN,YAAAA,EAAAA,MAAAA,EAAAA;EAAeD,WAAAA,CAAAA,WAAAA,EAAfC,UAAeD,EAAAA,GAAAA,cAAAA,EAAAA,EAAAA,UAAAA,EAA8BG,SAA9BH,GAAAA,SAAAA,CAAAA,EAAsDY,OAAtDZ,CAA8DO,cAA9DP,CAAAA;;;;;AAH2B;AAWvE;;AAO4CE,cAPvBW,mBAAAA,SAA4BP,wBAAAA,CAOLJ;EAA6CN,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAuBkB,aAAAA,CAAAA,EAAAA,MAAAA;EAAKZ,cAAAA,CAAAA,EAAAA,MAAAA;EAM7EN,aAAAA,EAAAA,OAAAA;EAOhBS,iBAAAA,EAAAA,OAAAA;EAA4BT,YAAAA,EAdlCe,sBAckCf;EAAuDY,OAAAA,uBAAAA,CAAAA,MAAAA,CAAAA,EAb/DN,kBAa+DM,GAAAA,SAAAA,EAAAA,UAAAA,CAAAA,EAblBZ,uBAakBY,EAAAA,CAAAA,EAbUN,kBAaVM,CAAAA,GAAAA,EAbKM,8BAAAA,CAAqEC,wBAAAA,EAa1EP,GAAAA,CAAAA;EAALQ;;;;;EAQxElB,OAAAA,gBAAAA,CAAAA,UAAAA,EAfUF,uBAeVE,EAAAA,CAAAA,EAAAA,MAAAA;EAEKW;;;;;;EA9BcH,OAAAA,OAAAA,CAAAA,GAAAA,EAoBzBD,aApByBC,EAAAA,UAAAA,CAAAA,EAoBGV,uBApBHU,EAAAA,EAAAA,YAAAA,CAAAA,EAoB6CW,OApB7CX,CAoBqDU,IApBrDV,CAoB0DE,iBApB1DF,EAAAA,KAAAA,CAAAA,CAAAA,CAAAA,EAoBuFM,OApBvFN,CAoB+FO,mBApB/FP,CAAAA;EAAwB,cAAA,CAAA,MAAA,EAqB9CP,WArB8C,CAAA,EAAA,GAAA;;;;;;;4BA4B3CD;;iCAEKW,yCAAyCC,6CAA6CP,YAAYC,qBAAqBQ,QAAQb"}
|
|
@@ -6,7 +6,7 @@ import { BaseCallbackConfig, Callbacks } from "@langchain/core/callbacks/manager
|
|
|
6
6
|
import { BaseLLMOutputParser } from "@langchain/core/output_parsers";
|
|
7
7
|
import { ChainValues } from "@langchain/core/utils/types";
|
|
8
8
|
import { BaseChatModel } from "@langchain/core/language_models/chat_models";
|
|
9
|
-
import * as
|
|
9
|
+
import * as _langchain_core_prompt_values5 from "@langchain/core/prompt_values";
|
|
10
10
|
import { AgentStep } from "@langchain/core/agents";
|
|
11
11
|
|
|
12
12
|
//#region src/evaluation/agents/trajectory.d.ts
|
|
@@ -31,7 +31,7 @@ declare class TrajectoryEvalChain extends AgentTrajectoryEvaluator {
|
|
|
31
31
|
requiresInput: boolean;
|
|
32
32
|
requiresReference: boolean;
|
|
33
33
|
outputParser: TrajectoryOutputParser;
|
|
34
|
-
static resolveTrajectoryPrompt(prompt?: BasePromptTemplate | undefined, agentTools?: StructuredToolInterface[]): BasePromptTemplate<any,
|
|
34
|
+
static resolveTrajectoryPrompt(prompt?: BasePromptTemplate | undefined, agentTools?: StructuredToolInterface[]): BasePromptTemplate<any, _langchain_core_prompt_values5.BasePromptValueInterface, any>;
|
|
35
35
|
/**
|
|
36
36
|
* Get the description of the agent tools.
|
|
37
37
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trajectory.d.ts","names":["StructuredToolInterface","BaseLLMOutputParser","AgentStep","ChainValues","ChatGeneration","Generation","BasePromptTemplate","Callbacks","BaseCallbackConfig","BaseChatModel","AgentTrajectoryEvaluator","EvalOutputType","LLMEvalChainInput","LLMTrajectoryEvaluatorArgs","ExtractLLMCallOptions","TrajectoryOutputParser","Promise","TrajectoryEvalChain","
|
|
1
|
+
{"version":3,"file":"trajectory.d.ts","names":["StructuredToolInterface","BaseLLMOutputParser","AgentStep","ChainValues","ChatGeneration","Generation","BasePromptTemplate","Callbacks","BaseCallbackConfig","BaseChatModel","AgentTrajectoryEvaluator","EvalOutputType","LLMEvalChainInput","LLMTrajectoryEvaluatorArgs","ExtractLLMCallOptions","TrajectoryOutputParser","Promise","TrajectoryEvalChain","_langchain_core_prompt_values5","BasePromptValueInterface","Omit","Partial"],"sources":["../../../src/evaluation/agents/trajectory.d.ts"],"sourcesContent":["import type { StructuredToolInterface } from \"@langchain/core/tools\";\nimport { BaseLLMOutputParser } from \"@langchain/core/output_parsers\";\nimport { AgentStep } from \"@langchain/core/agents\";\nimport { ChainValues } from \"@langchain/core/utils/types\";\nimport { ChatGeneration, Generation } from \"@langchain/core/outputs\";\nimport { BasePromptTemplate } from \"@langchain/core/prompts\";\nimport { Callbacks, BaseCallbackConfig } from \"@langchain/core/callbacks/manager\";\nimport { BaseChatModel } from \"@langchain/core/language_models/chat_models\";\nimport { AgentTrajectoryEvaluator, EvalOutputType, LLMEvalChainInput, LLMTrajectoryEvaluatorArgs, type ExtractLLMCallOptions } from \"../base.js\";\n/**\n * A parser for the output of the TrajectoryEvalChain.\n */\nexport declare class TrajectoryOutputParser extends BaseLLMOutputParser<EvalOutputType> {\n static lc_name(): string;\n lc_namespace: string[];\n parseResult(generations: Generation[] | ChatGeneration[], _callbacks: Callbacks | undefined): Promise<EvalOutputType>;\n}\n/**\n * A chain for evaluating ReAct style agents.\n *\n * This chain is used to evaluate ReAct style agents by reasoning about\n * the sequence of actions taken and their outcomes.\n */\nexport declare class TrajectoryEvalChain extends AgentTrajectoryEvaluator {\n static lc_name(): string;\n criterionName?: string;\n evaluationName?: string;\n requiresInput: boolean;\n requiresReference: boolean;\n outputParser: TrajectoryOutputParser;\n static resolveTrajectoryPrompt(prompt?: BasePromptTemplate | undefined, agentTools?: StructuredToolInterface[]): BasePromptTemplate<any, import(\"@langchain/core/prompt_values\").BasePromptValueInterface, any>;\n /**\n * Get the description of the agent tools.\n *\n * @returns The description of the agent tools.\n */\n static toolsDescription(agentTools: StructuredToolInterface[]): string;\n /**\n * Create a new TrajectoryEvalChain.\n * @param llm\n * @param agentTools - The tools used by the agent.\n * @param chainOptions - The options for the chain.\n */\n static fromLLM(llm: BaseChatModel, agentTools?: StructuredToolInterface[], chainOptions?: Partial<Omit<LLMEvalChainInput, \"llm\">>): Promise<TrajectoryEvalChain>;\n _prepareOutput(result: ChainValues): any;\n /**\n * Get the agent trajectory as a formatted string.\n *\n * @param steps - The agent trajectory.\n * @returns The formatted agent trajectory.\n */\n getAgentTrajectory(steps: AgentStep[]): string;\n formatReference(reference?: string): string;\n _evaluateAgentTrajectory(args: LLMTrajectoryEvaluatorArgs, callOptions: ExtractLLMCallOptions<this[\"llm\"]>, config?: Callbacks | BaseCallbackConfig): Promise<ChainValues>;\n}\n//# sourceMappingURL=trajectory.d.ts.map"],"mappings":";;;;;;;;;;;;;;;AAYqBe,cAAAA,sBAAAA,SAA+Bd,mBAAT,CAA6BU,cAA7B,CAAA,CAAA;EAA6BA,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAG3CN,YAAAA,EAAAA,MAAAA,EAAAA;EAAeD,WAAAA,CAAAA,WAAAA,EAAfC,UAAeD,EAAAA,GAAAA,cAAAA,EAAAA,EAAAA,UAAAA,EAA8BG,SAA9BH,GAAAA,SAAAA,CAAAA,EAAsDY,OAAtDZ,CAA8DO,cAA9DP,CAAAA;;;;;AAH2B;AAWvE;;AAO4CE,cAPvBW,mBAAAA,SAA4BP,wBAAAA,CAOLJ;EAA6CN,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAuBkB,aAAAA,CAAAA,EAAAA,MAAAA;EAAKZ,cAAAA,CAAAA,EAAAA,MAAAA;EAM7EN,aAAAA,EAAAA,OAAAA;EAOhBS,iBAAAA,EAAAA,OAAAA;EAA4BT,YAAAA,EAdlCe,sBAckCf;EAAuDY,OAAAA,uBAAAA,CAAAA,MAAAA,CAAAA,EAb/DN,kBAa+DM,GAAAA,SAAAA,EAAAA,UAAAA,CAAAA,EAblBZ,uBAakBY,EAAAA,CAAAA,EAbUN,kBAaVM,CAAAA,GAAAA,EAbKM,8BAAAA,CAAqEC,wBAAAA,EAa1EP,GAAAA,CAAAA;EAALQ;;;;;EAQxElB,OAAAA,gBAAAA,CAAAA,UAAAA,EAfUF,uBAeVE,EAAAA,CAAAA,EAAAA,MAAAA;EAEKW;;;;;;EA9BcH,OAAAA,OAAAA,CAAAA,GAAAA,EAoBzBD,aApByBC,EAAAA,UAAAA,CAAAA,EAoBGV,uBApBHU,EAAAA,EAAAA,YAAAA,CAAAA,EAoB6CW,OApB7CX,CAoBqDU,IApBrDV,CAoB0DE,iBApB1DF,EAAAA,KAAAA,CAAAA,CAAAA,CAAAA,EAoBuFM,OApBvFN,CAoB+FO,mBApB/FP,CAAAA;EAAwB,cAAA,CAAA,MAAA,EAqB9CP,WArB8C,CAAA,EAAA,GAAA;;;;;;;4BA4B3CD;;iCAEKW,yCAAyCC,6CAA6CP,YAAYC,qBAAqBQ,QAAQb"}
|
|
@@ -5,7 +5,7 @@ import { BaseLLMOutputParser } from "@langchain/core/output_parsers";
|
|
|
5
5
|
import { ChainValues } from "@langchain/core/utils/types";
|
|
6
6
|
import { BasePromptTemplate } from "@langchain/core/prompts";
|
|
7
7
|
import { BaseLanguageModelInterface } from "@langchain/core/language_models/base";
|
|
8
|
-
import * as
|
|
8
|
+
import * as _langchain_core_prompt_values1 from "@langchain/core/prompt_values";
|
|
9
9
|
import { BaseCallbackConfig, Callbacks } from "@langchain/core/callbacks/manager";
|
|
10
10
|
|
|
11
11
|
//#region src/evaluation/comparison/pairwise.d.ts
|
|
@@ -30,7 +30,7 @@ declare class PairwiseStringEvalChain extends LLMPairwiseStringEvaluator {
|
|
|
30
30
|
skipReferenceWarning: string;
|
|
31
31
|
outputParser: PairwiseStringResultOutputParser;
|
|
32
32
|
static resolvePairwiseCriteria(criteria?: CriteriaLike): Record<string, string>;
|
|
33
|
-
static resolvePairwisePrompt(prompt?: BasePromptTemplate): BasePromptTemplate<any,
|
|
33
|
+
static resolvePairwisePrompt(prompt?: BasePromptTemplate): BasePromptTemplate<any, _langchain_core_prompt_values1.BasePromptValueInterface, any>;
|
|
34
34
|
/**
|
|
35
35
|
* Create a new instance of the PairwiseStringEvalChain.
|
|
36
36
|
* @param llm
|
|
@@ -49,7 +49,7 @@ declare class PairwiseStringEvalChain extends LLMPairwiseStringEvaluator {
|
|
|
49
49
|
declare class LabeledPairwiseStringEvalChain extends PairwiseStringEvalChain {
|
|
50
50
|
static lc_name(): string;
|
|
51
51
|
requiresReference: boolean;
|
|
52
|
-
static resolvePairwisePrompt(prompt?: BasePromptTemplate): BasePromptTemplate<any,
|
|
52
|
+
static resolvePairwisePrompt(prompt?: BasePromptTemplate): BasePromptTemplate<any, _langchain_core_prompt_values1.BasePromptValueInterface, any>;
|
|
53
53
|
}
|
|
54
54
|
//#endregion
|
|
55
55
|
export { LabeledPairwiseStringEvalChain, PairwiseStringEvalChain, PairwiseStringResultOutputParser };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pairwise.d.cts","names":["BaseLanguageModelInterface","BaseLLMOutputParser","ChainValues","ChatGeneration","Generation","BasePromptTemplate","Callbacks","BaseCallbackConfig","EvalOutputType","LLMEvalChainInput","LLMPairwiseStringEvaluator","LLMPairwiseStringEvaluatorArgs","ExtractLLMCallOptions","CriteriaLike","PairwiseStringResultOutputParser","Promise","PairwiseStringEvalChain","Record","
|
|
1
|
+
{"version":3,"file":"pairwise.d.cts","names":["BaseLanguageModelInterface","BaseLLMOutputParser","ChainValues","ChatGeneration","Generation","BasePromptTemplate","Callbacks","BaseCallbackConfig","EvalOutputType","LLMEvalChainInput","LLMPairwiseStringEvaluator","LLMPairwiseStringEvaluatorArgs","ExtractLLMCallOptions","CriteriaLike","PairwiseStringResultOutputParser","Promise","PairwiseStringEvalChain","Record","_langchain_core_prompt_values1","BasePromptValueInterface","Omit","Partial","LabeledPairwiseStringEvalChain"],"sources":["../../../src/evaluation/comparison/pairwise.d.ts"],"sourcesContent":["import type { BaseLanguageModelInterface } from \"@langchain/core/language_models/base\";\nimport { BaseLLMOutputParser } from \"@langchain/core/output_parsers\";\nimport { ChainValues } from \"@langchain/core/utils/types\";\nimport { ChatGeneration, Generation } from \"@langchain/core/outputs\";\nimport { BasePromptTemplate } from \"@langchain/core/prompts\";\nimport { Callbacks, BaseCallbackConfig } from \"@langchain/core/callbacks/manager\";\nimport { EvalOutputType, LLMEvalChainInput, LLMPairwiseStringEvaluator, LLMPairwiseStringEvaluatorArgs, type ExtractLLMCallOptions } from \"../base.js\";\nimport { CriteriaLike } from \"../criteria/criteria.js\";\n/**\n * A parser for the output of the PairwiseStringEvalChain.\n */\nexport declare class PairwiseStringResultOutputParser extends BaseLLMOutputParser<EvalOutputType> {\n static lc_name(): string;\n lc_namespace: string[];\n parseResult(generations: Generation[] | ChatGeneration[], _callbacks: Callbacks | undefined): Promise<EvalOutputType>;\n}\n/**\n * A chain for comparing two outputs, such as the outputs\n * of two models, prompts, or outputs of a single model on similar inputs.\n */\nexport declare class PairwiseStringEvalChain extends LLMPairwiseStringEvaluator {\n static lc_name(): string;\n criterionName?: string;\n evaluationName?: string;\n requiresInput: boolean;\n requiresReference: boolean;\n skipReferenceWarning: string;\n outputParser: PairwiseStringResultOutputParser;\n static resolvePairwiseCriteria(criteria?: CriteriaLike): Record<string, string>;\n static resolvePairwisePrompt(prompt?: BasePromptTemplate): BasePromptTemplate<any, import(\"@langchain/core/prompt_values\").BasePromptValueInterface, any>;\n /**\n * Create a new instance of the PairwiseStringEvalChain.\n * @param llm\n * @param criteria The criteria to use for evaluation.\n * @param chainOptions Options to pass to the chain.\n */\n static fromLLM(llm: BaseLanguageModelInterface, criteria?: CriteriaLike, chainOptions?: Partial<Omit<LLMEvalChainInput, \"llm\">>): Promise<PairwiseStringEvalChain>;\n _prepareOutput(result: ChainValues): any;\n _evaluateStringPairs(args: LLMPairwiseStringEvaluatorArgs, callOptions: ExtractLLMCallOptions<this[\"llm\"]>, config?: Callbacks | BaseCallbackConfig): Promise<ChainValues>;\n}\n/**\n * A chain for comparing two outputs, such as the outputs\n * of two models, prompts, or outputs of a single model on similar inputs,\n * with labeled preferences.\n */\nexport declare class LabeledPairwiseStringEvalChain extends PairwiseStringEvalChain {\n static lc_name(): string;\n requiresReference: boolean;\n static resolvePairwisePrompt(prompt?: BasePromptTemplate): BasePromptTemplate<any, import(\"@langchain/core/prompt_values\").BasePromptValueInterface, any>;\n}\n//# sourceMappingURL=pairwise.d.ts.map"],"mappings":";;;;;;;;;;;;;;AAWqBc,cAAAA,gCAAAA,SAAyCb,mBAAT,CAA6BO,cAA7B,CAAA,CAAA;EAA6BA,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAGrDJ,YAAAA,EAAAA,MAAAA,EAAAA;EAAeD,WAAAA,CAAAA,WAAAA,EAAfC,UAAeD,EAAAA,GAAAA,cAAAA,EAAAA,EAAAA,UAAAA,EAA8BG,SAA9BH,GAAAA,SAAAA,CAAAA,EAAsDY,OAAtDZ,CAA8DK,cAA9DL,CAAAA;;;;;AAHqC;AAS5Da,cAAAA,uBAAAA,SAAgCN,0BAAAA,CAAT;EAO1BI,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAC4BD,aAAAA,CAAAA,EAAAA,MAAAA;EAAeI,cAAAA,CAAAA,EAAAA,MAAAA;EACnBZ,aAAAA,EAAAA,OAAAA;EAAkBa,iBAAAA,EAAAA,OAAAA;EAAGb,oBAAAA,EAAAA,MAAAA;EAOvCL,YAAAA,EATNc,gCASMd;EAAuCa,OAAAA,uBAAAA,CAAAA,QAAAA,CAAAA,EARjBA,YAQiBA,CAAAA,EARFI,MAQEJ,CAAAA,MAAAA,EAAAA,MAAAA,CAAAA;EAA0CJ,OAAAA,qBAAAA,CAAAA,MAAAA,CAAAA,EAP/DJ,kBAO+DI,CAAAA,EAP1CJ,kBAO0CI,CAAAA,GAAAA,EAP7CS,8BAAAA,CAAmEC,wBAAAA,EAOtBV,GAAAA,CAAAA;EAALW;;;;;;EAExBR,OAAAA,OAAAA,CAAAA,GAAAA,EAFpDZ,0BAEoDY,EAAAA,QAAAA,CAAAA,EAFbC,YAEaD,EAAAA,YAAAA,CAAAA,EAFgBS,OAEhBT,CAFwBQ,IAExBR,CAF6BH,iBAE7BG,EAAAA,KAAAA,CAAAA,CAAAA,CAAAA,EAF0DG,OAE1DH,CAFkEI,uBAElEJ,CAAAA;EAA6CN,cAAAA,CAAAA,MAAAA,EAD9FJ,WAC8FI,CAAAA,EAAAA,GAAAA;EAAYC,oBAAAA,CAAAA,IAAAA,EAAtGI,8BAAsGJ,EAAAA,WAAAA,EAAzDK,qBAAyDL,CAAAA,IAAAA,CAAAA,KAAAA,CAAAA,CAAAA,EAAAA,MAAAA,CAAAA,EAAZD,SAAYC,GAAAA,kBAAAA,CAAAA,EAAqBQ,OAArBR,CAA6BL,WAA7BK,CAAAA;;;;AAlBtD;AAyB/E;;AAG4DW,cAHvCI,8BAAAA,SAAuCN,uBAAAA,CAGmEG;EAAhEd,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAHHW,iBAAAA,EAAAA,OAAAA;EAAuB,OAAA,qBAAA,CAAA,MAAA,CAAA,EAGzCX,kBAHyC,CAAA,EAGpBA,kBAHoB,CAAA,GAAA,EAGvBa,8BAAAA,CAAmEC,wBAAAA,EAH5C,GAAA,CAAA"}
|
|
@@ -6,7 +6,7 @@ import { ChatGeneration, Generation } from "@langchain/core/outputs";
|
|
|
6
6
|
import { BaseCallbackConfig, Callbacks } from "@langchain/core/callbacks/manager";
|
|
7
7
|
import { BaseLLMOutputParser } from "@langchain/core/output_parsers";
|
|
8
8
|
import { ChainValues } from "@langchain/core/utils/types";
|
|
9
|
-
import * as
|
|
9
|
+
import * as _langchain_core_prompt_values1 from "@langchain/core/prompt_values";
|
|
10
10
|
|
|
11
11
|
//#region src/evaluation/comparison/pairwise.d.ts
|
|
12
12
|
/**
|
|
@@ -30,7 +30,7 @@ declare class PairwiseStringEvalChain extends LLMPairwiseStringEvaluator {
|
|
|
30
30
|
skipReferenceWarning: string;
|
|
31
31
|
outputParser: PairwiseStringResultOutputParser;
|
|
32
32
|
static resolvePairwiseCriteria(criteria?: CriteriaLike): Record<string, string>;
|
|
33
|
-
static resolvePairwisePrompt(prompt?: BasePromptTemplate): BasePromptTemplate<any,
|
|
33
|
+
static resolvePairwisePrompt(prompt?: BasePromptTemplate): BasePromptTemplate<any, _langchain_core_prompt_values1.BasePromptValueInterface, any>;
|
|
34
34
|
/**
|
|
35
35
|
* Create a new instance of the PairwiseStringEvalChain.
|
|
36
36
|
* @param llm
|
|
@@ -49,7 +49,7 @@ declare class PairwiseStringEvalChain extends LLMPairwiseStringEvaluator {
|
|
|
49
49
|
declare class LabeledPairwiseStringEvalChain extends PairwiseStringEvalChain {
|
|
50
50
|
static lc_name(): string;
|
|
51
51
|
requiresReference: boolean;
|
|
52
|
-
static resolvePairwisePrompt(prompt?: BasePromptTemplate): BasePromptTemplate<any,
|
|
52
|
+
static resolvePairwisePrompt(prompt?: BasePromptTemplate): BasePromptTemplate<any, _langchain_core_prompt_values1.BasePromptValueInterface, any>;
|
|
53
53
|
}
|
|
54
54
|
//#endregion
|
|
55
55
|
export { LabeledPairwiseStringEvalChain, PairwiseStringEvalChain, PairwiseStringResultOutputParser };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pairwise.d.ts","names":["BaseLanguageModelInterface","BaseLLMOutputParser","ChainValues","ChatGeneration","Generation","BasePromptTemplate","Callbacks","BaseCallbackConfig","EvalOutputType","LLMEvalChainInput","LLMPairwiseStringEvaluator","LLMPairwiseStringEvaluatorArgs","ExtractLLMCallOptions","CriteriaLike","PairwiseStringResultOutputParser","Promise","PairwiseStringEvalChain","Record","
|
|
1
|
+
{"version":3,"file":"pairwise.d.ts","names":["BaseLanguageModelInterface","BaseLLMOutputParser","ChainValues","ChatGeneration","Generation","BasePromptTemplate","Callbacks","BaseCallbackConfig","EvalOutputType","LLMEvalChainInput","LLMPairwiseStringEvaluator","LLMPairwiseStringEvaluatorArgs","ExtractLLMCallOptions","CriteriaLike","PairwiseStringResultOutputParser","Promise","PairwiseStringEvalChain","Record","_langchain_core_prompt_values1","BasePromptValueInterface","Omit","Partial","LabeledPairwiseStringEvalChain"],"sources":["../../../src/evaluation/comparison/pairwise.d.ts"],"sourcesContent":["import type { BaseLanguageModelInterface } from \"@langchain/core/language_models/base\";\nimport { BaseLLMOutputParser } from \"@langchain/core/output_parsers\";\nimport { ChainValues } from \"@langchain/core/utils/types\";\nimport { ChatGeneration, Generation } from \"@langchain/core/outputs\";\nimport { BasePromptTemplate } from \"@langchain/core/prompts\";\nimport { Callbacks, BaseCallbackConfig } from \"@langchain/core/callbacks/manager\";\nimport { EvalOutputType, LLMEvalChainInput, LLMPairwiseStringEvaluator, LLMPairwiseStringEvaluatorArgs, type ExtractLLMCallOptions } from \"../base.js\";\nimport { CriteriaLike } from \"../criteria/criteria.js\";\n/**\n * A parser for the output of the PairwiseStringEvalChain.\n */\nexport declare class PairwiseStringResultOutputParser extends BaseLLMOutputParser<EvalOutputType> {\n static lc_name(): string;\n lc_namespace: string[];\n parseResult(generations: Generation[] | ChatGeneration[], _callbacks: Callbacks | undefined): Promise<EvalOutputType>;\n}\n/**\n * A chain for comparing two outputs, such as the outputs\n * of two models, prompts, or outputs of a single model on similar inputs.\n */\nexport declare class PairwiseStringEvalChain extends LLMPairwiseStringEvaluator {\n static lc_name(): string;\n criterionName?: string;\n evaluationName?: string;\n requiresInput: boolean;\n requiresReference: boolean;\n skipReferenceWarning: string;\n outputParser: PairwiseStringResultOutputParser;\n static resolvePairwiseCriteria(criteria?: CriteriaLike): Record<string, string>;\n static resolvePairwisePrompt(prompt?: BasePromptTemplate): BasePromptTemplate<any, import(\"@langchain/core/prompt_values\").BasePromptValueInterface, any>;\n /**\n * Create a new instance of the PairwiseStringEvalChain.\n * @param llm\n * @param criteria The criteria to use for evaluation.\n * @param chainOptions Options to pass to the chain.\n */\n static fromLLM(llm: BaseLanguageModelInterface, criteria?: CriteriaLike, chainOptions?: Partial<Omit<LLMEvalChainInput, \"llm\">>): Promise<PairwiseStringEvalChain>;\n _prepareOutput(result: ChainValues): any;\n _evaluateStringPairs(args: LLMPairwiseStringEvaluatorArgs, callOptions: ExtractLLMCallOptions<this[\"llm\"]>, config?: Callbacks | BaseCallbackConfig): Promise<ChainValues>;\n}\n/**\n * A chain for comparing two outputs, such as the outputs\n * of two models, prompts, or outputs of a single model on similar inputs,\n * with labeled preferences.\n */\nexport declare class LabeledPairwiseStringEvalChain extends PairwiseStringEvalChain {\n static lc_name(): string;\n requiresReference: boolean;\n static resolvePairwisePrompt(prompt?: BasePromptTemplate): BasePromptTemplate<any, import(\"@langchain/core/prompt_values\").BasePromptValueInterface, any>;\n}\n//# sourceMappingURL=pairwise.d.ts.map"],"mappings":";;;;;;;;;;;;;;AAWqBc,cAAAA,gCAAAA,SAAyCb,mBAAT,CAA6BO,cAA7B,CAAA,CAAA;EAA6BA,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAGrDJ,YAAAA,EAAAA,MAAAA,EAAAA;EAAeD,WAAAA,CAAAA,WAAAA,EAAfC,UAAeD,EAAAA,GAAAA,cAAAA,EAAAA,EAAAA,UAAAA,EAA8BG,SAA9BH,GAAAA,SAAAA,CAAAA,EAAsDY,OAAtDZ,CAA8DK,cAA9DL,CAAAA;;;;;AAHqC;AAS5Da,cAAAA,uBAAAA,SAAgCN,0BAAAA,CAAT;EAO1BI,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAC4BD,aAAAA,CAAAA,EAAAA,MAAAA;EAAeI,cAAAA,CAAAA,EAAAA,MAAAA;EACnBZ,aAAAA,EAAAA,OAAAA;EAAkBa,iBAAAA,EAAAA,OAAAA;EAAGb,oBAAAA,EAAAA,MAAAA;EAOvCL,YAAAA,EATNc,gCASMd;EAAuCa,OAAAA,uBAAAA,CAAAA,QAAAA,CAAAA,EARjBA,YAQiBA,CAAAA,EARFI,MAQEJ,CAAAA,MAAAA,EAAAA,MAAAA,CAAAA;EAA0CJ,OAAAA,qBAAAA,CAAAA,MAAAA,CAAAA,EAP/DJ,kBAO+DI,CAAAA,EAP1CJ,kBAO0CI,CAAAA,GAAAA,EAP7CS,8BAAAA,CAAmEC,wBAAAA,EAOtBV,GAAAA,CAAAA;EAALW;;;;;;EAExBR,OAAAA,OAAAA,CAAAA,GAAAA,EAFpDZ,0BAEoDY,EAAAA,QAAAA,CAAAA,EAFbC,YAEaD,EAAAA,YAAAA,CAAAA,EAFgBS,OAEhBT,CAFwBQ,IAExBR,CAF6BH,iBAE7BG,EAAAA,KAAAA,CAAAA,CAAAA,CAAAA,EAF0DG,OAE1DH,CAFkEI,uBAElEJ,CAAAA;EAA6CN,cAAAA,CAAAA,MAAAA,EAD9FJ,WAC8FI,CAAAA,EAAAA,GAAAA;EAAYC,oBAAAA,CAAAA,IAAAA,EAAtGI,8BAAsGJ,EAAAA,WAAAA,EAAzDK,qBAAyDL,CAAAA,IAAAA,CAAAA,KAAAA,CAAAA,CAAAA,EAAAA,MAAAA,CAAAA,EAAZD,SAAYC,GAAAA,kBAAAA,CAAAA,EAAqBQ,OAArBR,CAA6BL,WAA7BK,CAAAA;;;;AAlBtD;AAyB/E;;AAG4DW,cAHvCI,8BAAAA,SAAuCN,uBAAAA,CAGmEG;EAAhEd,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAHHW,iBAAAA,EAAAA,OAAAA;EAAuB,OAAA,qBAAA,CAAA,MAAA,CAAA,EAGzCX,kBAHyC,CAAA,EAGpBA,kBAHoB,CAAA,GAAA,EAGvBa,8BAAAA,CAAmEC,wBAAAA,EAH5C,GAAA,CAAA"}
|
|
@@ -5,7 +5,7 @@ import { BaseLLMOutputParser } from "@langchain/core/output_parsers";
|
|
|
5
5
|
import { ChainValues } from "@langchain/core/utils/types";
|
|
6
6
|
import { BasePromptTemplate } from "@langchain/core/prompts";
|
|
7
7
|
import { BaseLanguageModelInterface } from "@langchain/core/language_models/base";
|
|
8
|
-
import * as
|
|
8
|
+
import * as _langchain_core_prompt_values4 from "@langchain/core/prompt_values";
|
|
9
9
|
import { BaseCallbackConfig, Callbacks } from "@langchain/core/callbacks/manager";
|
|
10
10
|
|
|
11
11
|
//#region src/evaluation/criteria/criteria.d.ts
|
|
@@ -50,7 +50,7 @@ declare class CriteriaEvalChain extends LLMStringEvaluator {
|
|
|
50
50
|
* Resolve the prompt to use for the evaluation.
|
|
51
51
|
* @param prompt
|
|
52
52
|
*/
|
|
53
|
-
static resolvePrompt(prompt?: BasePromptTemplate): BasePromptTemplate<any,
|
|
53
|
+
static resolvePrompt(prompt?: BasePromptTemplate): BasePromptTemplate<any, _langchain_core_prompt_values4.BasePromptValueInterface, any>;
|
|
54
54
|
/**
|
|
55
55
|
* Create a new instance of the CriteriaEvalChain.
|
|
56
56
|
* @param llm
|
|
@@ -76,7 +76,7 @@ declare class CriteriaEvalChain extends LLMStringEvaluator {
|
|
|
76
76
|
declare class LabeledCriteriaEvalChain extends CriteriaEvalChain {
|
|
77
77
|
static lc_name(): string;
|
|
78
78
|
requiresReference: boolean;
|
|
79
|
-
static resolvePrompt(prompt?: BasePromptTemplate): BasePromptTemplate<any,
|
|
79
|
+
static resolvePrompt(prompt?: BasePromptTemplate): BasePromptTemplate<any, _langchain_core_prompt_values4.BasePromptValueInterface, any>;
|
|
80
80
|
}
|
|
81
81
|
//#endregion
|
|
82
82
|
export { Criteria, CriteriaEvalChain, CriteriaEvalInput, CriteriaLike, CriteriaResultOutputParser, LabeledCriteriaEvalChain };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"criteria.d.cts","names":["BaseLanguageModelInterface","BaseLLMOutputParser","ChainValues","ChatGeneration","Generation","BasePromptTemplate","Callbacks","BaseCallbackConfig","EvalOutputType","LLMEvalChainInput","LLMStringEvaluator","StringEvaluatorArgs","ExtractLLMCallOptions","ConstitutionalPrinciple","Criteria","CriteriaLike","CriteriaResultOutputParser","Promise","CriteriaEvalInput","CriteriaEvalChain","Record","
|
|
1
|
+
{"version":3,"file":"criteria.d.cts","names":["BaseLanguageModelInterface","BaseLLMOutputParser","ChainValues","ChatGeneration","Generation","BasePromptTemplate","Callbacks","BaseCallbackConfig","EvalOutputType","LLMEvalChainInput","LLMStringEvaluator","StringEvaluatorArgs","ExtractLLMCallOptions","ConstitutionalPrinciple","Criteria","CriteriaLike","CriteriaResultOutputParser","Promise","CriteriaEvalInput","CriteriaEvalChain","Record","_langchain_core_prompt_values4","BasePromptValueInterface","Omit","Partial","input","prediction","reference","LabeledCriteriaEvalChain"],"sources":["../../../src/evaluation/criteria/criteria.d.ts"],"sourcesContent":["import type { BaseLanguageModelInterface } from \"@langchain/core/language_models/base\";\nimport { BaseLLMOutputParser } from \"@langchain/core/output_parsers\";\nimport { ChainValues } from \"@langchain/core/utils/types\";\nimport { ChatGeneration, Generation } from \"@langchain/core/outputs\";\nimport { BasePromptTemplate } from \"@langchain/core/prompts\";\nimport { Callbacks, BaseCallbackConfig } from \"@langchain/core/callbacks/manager\";\nimport { EvalOutputType, LLMEvalChainInput, LLMStringEvaluator, StringEvaluatorArgs, type ExtractLLMCallOptions } from \"../base.js\";\nimport { ConstitutionalPrinciple } from \"../../chains/constitutional_ai/constitutional_principle.js\";\n/**\n * A Criteria to evaluate.\n */\nexport type Criteria = \"conciseness\" | \"relevance\" | \"correctness\" | \"coherence\" | \"harmfulness\" | \"maliciousness\" | \"helpfulness\" | \"controversiality\" | \"misogyny\" | \"criminality\" | \"insensitivity\" | \"depth\" | \"creativity\" | \"detail\";\nexport type CriteriaLike = {\n [key: string]: string;\n} | Criteria | ConstitutionalPrinciple;\n/**\n * A parser for the output of the CriteriaEvalChain.\n */\nexport declare class CriteriaResultOutputParser extends BaseLLMOutputParser<EvalOutputType> {\n lc_namespace: string[];\n parseResult(generations: Generation[] | ChatGeneration[], _callbacks: Callbacks | undefined): Promise<EvalOutputType>;\n}\nexport interface CriteriaEvalInput {\n input?: string;\n output: string;\n reference?: string;\n}\nexport declare class CriteriaEvalChain extends LLMStringEvaluator {\n static lc_name(): string;\n criterionName?: string;\n evaluationName?: string;\n requiresInput: boolean;\n requiresReference: boolean;\n skipReferenceWarning: string;\n outputParser: BaseLLMOutputParser<EvalOutputType>;\n /**\n * Resolve the criteria to evaluate.\n * @param criteria The criteria to evaluate the runs against. It can be:\n * - a mapping of a criterion name to its description\n * - a single criterion name present in one of the default criteria\n * - a single `ConstitutionalPrinciple` instance\n *\n * @return A dictionary mapping criterion names to descriptions.\n */\n static resolveCriteria(criteria?: CriteriaLike): Record<string, string>;\n /**\n * Resolve the prompt to use for the evaluation.\n * @param prompt\n */\n static resolvePrompt(prompt?: BasePromptTemplate): BasePromptTemplate<any, import(\"@langchain/core/prompt_values\").BasePromptValueInterface, any>;\n /**\n * Create a new instance of the CriteriaEvalChain.\n * @param llm\n * @param criteria\n * @param chainOptions Options to pass to the constructor of the LLMChain.\n */\n static fromLLM(llm: BaseLanguageModelInterface, criteria?: CriteriaLike, chainOptions?: Partial<Omit<LLMEvalChainInput, \"llm\">>): Promise<CriteriaEvalChain>;\n getEvalInput({ input, prediction, reference }: StringEvaluatorArgs): CriteriaEvalInput;\n /**\n * Prepare the output of the evaluation.\n * @param result\n */\n _prepareOutput(result: ChainValues): any;\n _evaluateStrings(args: StringEvaluatorArgs & ExtractLLMCallOptions<this[\"llm\"]>, config?: Callbacks | BaseCallbackConfig): Promise<ChainValues>;\n}\n/**\n * Criteria evaluation chain that requires references.\n */\nexport declare class LabeledCriteriaEvalChain extends CriteriaEvalChain {\n static lc_name(): string;\n requiresReference: boolean;\n static resolvePrompt(prompt?: BasePromptTemplate): BasePromptTemplate<any, import(\"@langchain/core/prompt_values\").BasePromptValueInterface, any>;\n}\n//# sourceMappingURL=criteria.d.ts.map"],"mappings":";;;;;;;;;;;;;;AAWYc,KAAAA,QAAAA,GAAQ,aAAA,GAAA,WAAA,GAAA,aAAA,GAAA,WAAA,GAAA,aAAA,GAAA,eAAA,GAAA,aAAA,GAAA,kBAAA,GAAA,UAAA,GAAA,aAAA,GAAA,eAAA,GAAA,OAAA,GAAA,YAAA,GAAA,QAAA;AACRC,KAAAA,YAAAA,GAAY;EAMHC,CAAAA,GAAAA,EAAAA,MAAAA,CAAAA,EAAAA,MAAAA;CAAuDR,GAJxEM,QAIwEN,GAJ7DK,uBAI6DL;;;;AAE8BA,cAFrFQ,0BAAAA,SAAmCf,mBAEkDO,CAF9BA,cAE8BA,CAAAA,CAAAA;EAARS,YAAAA,EAAAA,MAAAA,EAAAA;EAF1ChB,WAAAA,CAAAA,WAAAA,EAE3BG,UAF2BH,EAAAA,GAEZE,cAFYF,EAAAA,EAAAA,UAAAA,EAEkBK,SAFlBL,GAAAA,SAAAA,CAAAA,EAE0CgB,OAF1ChB,CAEkDO,cAFlDP,CAAAA;AAAmB;AAI1DiB,UAAAA,iBAAAA,CAAiB;EAKbC,KAAAA,CAAAA,EAAAA,MAAAA;EAOiBX,MAAAA,EAAAA,MAAAA;EAApBP,SAAAA,CAAAA,EAAAA,MAAAA;;AAUmCmB,cAjBhCD,iBAAAA,SAA0BT,kBAAAA,CAiBMU;EAKnBf,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAkBgB,aAAAA,CAAAA,EAAAA,MAAAA;EAAGhB,cAAAA,CAAAA,EAAAA,MAAAA;EAO/BL,aAAAA,EAAAA,OAAAA;EAAuCe,iBAAAA,EAAAA,OAAAA;EAA0CN,oBAAAA,EAAAA,MAAAA;EAALc,YAAAA,EAtBlFtB,mBAsBkFsB,CAtB9Df,cAsB8De,CAAAA;EAARC;;;;;;;;;EAOjEb,OAAAA,eAAAA,CAAAA,QAAAA,CAAAA,EAnBWI,YAmBXJ,CAAAA,EAnB0BS,MAmB1BT,CAAAA,MAAAA,EAAAA,MAAAA,CAAAA;EAAsBC;;;;EAA8EK,OAAAA,aAAAA,CAAAA,MAAAA,CAAAA,EAd7FZ,kBAc6FY,CAAAA,EAdxEZ,kBAcwEY,CAAAA,GAAAA,EAd3EI,8BAAAA,CAAmEC,wBAAAA,EAcQL,GAAAA,CAAAA;EApChFP;AAAkB;AAyCjE;;;;EAAsDS,OAAAA,OAAAA,CAAAA,GAAAA,EAZ9BnB,0BAY8BmB,EAAAA,QAAAA,CAAAA,EAZSJ,YAYTI,EAAAA,YAAAA,CAAAA,EAZsCK,OAYtCL,CAZ8CI,IAY9CJ,CAZmDV,iBAYnDU,EAAAA,KAAAA,CAAAA,CAAAA,CAAAA,EAZgFF,OAYhFE,CAZwFA,iBAYxFA,CAAAA;EAAiB,YAAA,CAAA;IAAA,KAAA;IAAA,UAAA;IAAA;EAAA,CAAA,EAXpBR,mBAWoB,CAAA,EAXEO,iBAWF;;;;;yBAN5ChB;yBACAS,sBAAsBC,6CAA6CN,YAAYC,qBAAqBU,QAAQf;;;;;cAKlH0B,wBAAAA,SAAiCT,iBAAAA;;;gCAGpBd,qBAAqBA,wBAAHgB,8BAAAA,CAAmEC,wBAAAA"}
|
|
@@ -6,7 +6,7 @@ import { ChatGeneration, Generation } from "@langchain/core/outputs";
|
|
|
6
6
|
import { BaseCallbackConfig, Callbacks } from "@langchain/core/callbacks/manager";
|
|
7
7
|
import { BaseLLMOutputParser } from "@langchain/core/output_parsers";
|
|
8
8
|
import { ChainValues } from "@langchain/core/utils/types";
|
|
9
|
-
import * as
|
|
9
|
+
import * as _langchain_core_prompt_values3 from "@langchain/core/prompt_values";
|
|
10
10
|
|
|
11
11
|
//#region src/evaluation/criteria/criteria.d.ts
|
|
12
12
|
/**
|
|
@@ -50,7 +50,7 @@ declare class CriteriaEvalChain extends LLMStringEvaluator {
|
|
|
50
50
|
* Resolve the prompt to use for the evaluation.
|
|
51
51
|
* @param prompt
|
|
52
52
|
*/
|
|
53
|
-
static resolvePrompt(prompt?: BasePromptTemplate): BasePromptTemplate<any,
|
|
53
|
+
static resolvePrompt(prompt?: BasePromptTemplate): BasePromptTemplate<any, _langchain_core_prompt_values3.BasePromptValueInterface, any>;
|
|
54
54
|
/**
|
|
55
55
|
* Create a new instance of the CriteriaEvalChain.
|
|
56
56
|
* @param llm
|
|
@@ -76,7 +76,7 @@ declare class CriteriaEvalChain extends LLMStringEvaluator {
|
|
|
76
76
|
declare class LabeledCriteriaEvalChain extends CriteriaEvalChain {
|
|
77
77
|
static lc_name(): string;
|
|
78
78
|
requiresReference: boolean;
|
|
79
|
-
static resolvePrompt(prompt?: BasePromptTemplate): BasePromptTemplate<any,
|
|
79
|
+
static resolvePrompt(prompt?: BasePromptTemplate): BasePromptTemplate<any, _langchain_core_prompt_values3.BasePromptValueInterface, any>;
|
|
80
80
|
}
|
|
81
81
|
//#endregion
|
|
82
82
|
export { Criteria, CriteriaEvalChain, CriteriaEvalInput, CriteriaLike, CriteriaResultOutputParser, LabeledCriteriaEvalChain };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"criteria.d.ts","names":["BaseLanguageModelInterface","BaseLLMOutputParser","ChainValues","ChatGeneration","Generation","BasePromptTemplate","Callbacks","BaseCallbackConfig","EvalOutputType","LLMEvalChainInput","LLMStringEvaluator","StringEvaluatorArgs","ExtractLLMCallOptions","ConstitutionalPrinciple","Criteria","CriteriaLike","CriteriaResultOutputParser","Promise","CriteriaEvalInput","CriteriaEvalChain","Record","
|
|
1
|
+
{"version":3,"file":"criteria.d.ts","names":["BaseLanguageModelInterface","BaseLLMOutputParser","ChainValues","ChatGeneration","Generation","BasePromptTemplate","Callbacks","BaseCallbackConfig","EvalOutputType","LLMEvalChainInput","LLMStringEvaluator","StringEvaluatorArgs","ExtractLLMCallOptions","ConstitutionalPrinciple","Criteria","CriteriaLike","CriteriaResultOutputParser","Promise","CriteriaEvalInput","CriteriaEvalChain","Record","_langchain_core_prompt_values3","BasePromptValueInterface","Omit","Partial","input","prediction","reference","LabeledCriteriaEvalChain"],"sources":["../../../src/evaluation/criteria/criteria.d.ts"],"sourcesContent":["import type { BaseLanguageModelInterface } from \"@langchain/core/language_models/base\";\nimport { BaseLLMOutputParser } from \"@langchain/core/output_parsers\";\nimport { ChainValues } from \"@langchain/core/utils/types\";\nimport { ChatGeneration, Generation } from \"@langchain/core/outputs\";\nimport { BasePromptTemplate } from \"@langchain/core/prompts\";\nimport { Callbacks, BaseCallbackConfig } from \"@langchain/core/callbacks/manager\";\nimport { EvalOutputType, LLMEvalChainInput, LLMStringEvaluator, StringEvaluatorArgs, type ExtractLLMCallOptions } from \"../base.js\";\nimport { ConstitutionalPrinciple } from \"../../chains/constitutional_ai/constitutional_principle.js\";\n/**\n * A Criteria to evaluate.\n */\nexport type Criteria = \"conciseness\" | \"relevance\" | \"correctness\" | \"coherence\" | \"harmfulness\" | \"maliciousness\" | \"helpfulness\" | \"controversiality\" | \"misogyny\" | \"criminality\" | \"insensitivity\" | \"depth\" | \"creativity\" | \"detail\";\nexport type CriteriaLike = {\n [key: string]: string;\n} | Criteria | ConstitutionalPrinciple;\n/**\n * A parser for the output of the CriteriaEvalChain.\n */\nexport declare class CriteriaResultOutputParser extends BaseLLMOutputParser<EvalOutputType> {\n lc_namespace: string[];\n parseResult(generations: Generation[] | ChatGeneration[], _callbacks: Callbacks | undefined): Promise<EvalOutputType>;\n}\nexport interface CriteriaEvalInput {\n input?: string;\n output: string;\n reference?: string;\n}\nexport declare class CriteriaEvalChain extends LLMStringEvaluator {\n static lc_name(): string;\n criterionName?: string;\n evaluationName?: string;\n requiresInput: boolean;\n requiresReference: boolean;\n skipReferenceWarning: string;\n outputParser: BaseLLMOutputParser<EvalOutputType>;\n /**\n * Resolve the criteria to evaluate.\n * @param criteria The criteria to evaluate the runs against. It can be:\n * - a mapping of a criterion name to its description\n * - a single criterion name present in one of the default criteria\n * - a single `ConstitutionalPrinciple` instance\n *\n * @return A dictionary mapping criterion names to descriptions.\n */\n static resolveCriteria(criteria?: CriteriaLike): Record<string, string>;\n /**\n * Resolve the prompt to use for the evaluation.\n * @param prompt\n */\n static resolvePrompt(prompt?: BasePromptTemplate): BasePromptTemplate<any, import(\"@langchain/core/prompt_values\").BasePromptValueInterface, any>;\n /**\n * Create a new instance of the CriteriaEvalChain.\n * @param llm\n * @param criteria\n * @param chainOptions Options to pass to the constructor of the LLMChain.\n */\n static fromLLM(llm: BaseLanguageModelInterface, criteria?: CriteriaLike, chainOptions?: Partial<Omit<LLMEvalChainInput, \"llm\">>): Promise<CriteriaEvalChain>;\n getEvalInput({ input, prediction, reference }: StringEvaluatorArgs): CriteriaEvalInput;\n /**\n * Prepare the output of the evaluation.\n * @param result\n */\n _prepareOutput(result: ChainValues): any;\n _evaluateStrings(args: StringEvaluatorArgs & ExtractLLMCallOptions<this[\"llm\"]>, config?: Callbacks | BaseCallbackConfig): Promise<ChainValues>;\n}\n/**\n * Criteria evaluation chain that requires references.\n */\nexport declare class LabeledCriteriaEvalChain extends CriteriaEvalChain {\n static lc_name(): string;\n requiresReference: boolean;\n static resolvePrompt(prompt?: BasePromptTemplate): BasePromptTemplate<any, import(\"@langchain/core/prompt_values\").BasePromptValueInterface, any>;\n}\n//# sourceMappingURL=criteria.d.ts.map"],"mappings":";;;;;;;;;;;;;;AAWYc,KAAAA,QAAAA,GAAQ,aAAA,GAAA,WAAA,GAAA,aAAA,GAAA,WAAA,GAAA,aAAA,GAAA,eAAA,GAAA,aAAA,GAAA,kBAAA,GAAA,UAAA,GAAA,aAAA,GAAA,eAAA,GAAA,OAAA,GAAA,YAAA,GAAA,QAAA;AACRC,KAAAA,YAAAA,GAAY;EAMHC,CAAAA,GAAAA,EAAAA,MAAAA,CAAAA,EAAAA,MAAAA;CAAuDR,GAJxEM,QAIwEN,GAJ7DK,uBAI6DL;;;;AAE8BA,cAFrFQ,0BAAAA,SAAmCf,mBAEkDO,CAF9BA,cAE8BA,CAAAA,CAAAA;EAARS,YAAAA,EAAAA,MAAAA,EAAAA;EAF1ChB,WAAAA,CAAAA,WAAAA,EAE3BG,UAF2BH,EAAAA,GAEZE,cAFYF,EAAAA,EAAAA,UAAAA,EAEkBK,SAFlBL,GAAAA,SAAAA,CAAAA,EAE0CgB,OAF1ChB,CAEkDO,cAFlDP,CAAAA;AAAmB;AAI1DiB,UAAAA,iBAAAA,CAAiB;EAKbC,KAAAA,CAAAA,EAAAA,MAAAA;EAOiBX,MAAAA,EAAAA,MAAAA;EAApBP,SAAAA,CAAAA,EAAAA,MAAAA;;AAUmCmB,cAjBhCD,iBAAAA,SAA0BT,kBAAAA,CAiBMU;EAKnBf,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAkBgB,aAAAA,CAAAA,EAAAA,MAAAA;EAAGhB,cAAAA,CAAAA,EAAAA,MAAAA;EAO/BL,aAAAA,EAAAA,OAAAA;EAAuCe,iBAAAA,EAAAA,OAAAA;EAA0CN,oBAAAA,EAAAA,MAAAA;EAALc,YAAAA,EAtBlFtB,mBAsBkFsB,CAtB9Df,cAsB8De,CAAAA;EAARC;;;;;;;;;EAOjEb,OAAAA,eAAAA,CAAAA,QAAAA,CAAAA,EAnBWI,YAmBXJ,CAAAA,EAnB0BS,MAmB1BT,CAAAA,MAAAA,EAAAA,MAAAA,CAAAA;EAAsBC;;;;EAA8EK,OAAAA,aAAAA,CAAAA,MAAAA,CAAAA,EAd7FZ,kBAc6FY,CAAAA,EAdxEZ,kBAcwEY,CAAAA,GAAAA,EAd3EI,8BAAAA,CAAmEC,wBAAAA,EAcQL,GAAAA,CAAAA;EApChFP;AAAkB;AAyCjE;;;;EAAsDS,OAAAA,OAAAA,CAAAA,GAAAA,EAZ9BnB,0BAY8BmB,EAAAA,QAAAA,CAAAA,EAZSJ,YAYTI,EAAAA,YAAAA,CAAAA,EAZsCK,OAYtCL,CAZ8CI,IAY9CJ,CAZmDV,iBAYnDU,EAAAA,KAAAA,CAAAA,CAAAA,CAAAA,EAZgFF,OAYhFE,CAZwFA,iBAYxFA,CAAAA;EAAiB,YAAA,CAAA;IAAA,KAAA;IAAA,UAAA;IAAA;EAAA,CAAA,EAXpBR,mBAWoB,CAAA,EAXEO,iBAWF;;;;;yBAN5ChB;yBACAS,sBAAsBC,6CAA6CN,YAAYC,qBAAqBU,QAAQf;;;;;cAKlH0B,wBAAAA,SAAiCT,iBAAAA;;;gCAGpBd,qBAAqBA,wBAAHgB,8BAAAA,CAAmEC,wBAAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ObjectTool } from "./schema.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _langchain_core_messages2 from "@langchain/core/messages";
|
|
3
3
|
import { BaseMessage } from "@langchain/core/messages";
|
|
4
4
|
import { PartialValues } from "@langchain/core/utils/types";
|
|
5
5
|
import { BaseChatPromptTemplate, SerializedBasePromptTemplate } from "@langchain/core/prompts";
|
|
@@ -54,7 +54,7 @@ declare class AutoGPTPrompt extends BaseChatPromptTemplate implements AutoGPTPro
|
|
|
54
54
|
memory: VectorStoreRetrieverInterface;
|
|
55
55
|
messages: BaseMessage[];
|
|
56
56
|
user_input: string;
|
|
57
|
-
}): Promise<BaseMessage<
|
|
57
|
+
}): Promise<BaseMessage<_langchain_core_messages2.MessageStructure, _langchain_core_messages2.MessageType>[]>;
|
|
58
58
|
/**
|
|
59
59
|
* This method is not implemented in the AutoGPTPrompt class and will
|
|
60
60
|
* throw an error if called.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.d.cts","names":["VectorStoreRetrieverInterface","BaseChatPromptTemplate","SerializedBasePromptTemplate","BaseMessage","PartialValues","ObjectTool","AutoGPTPromptInput","Promise","AutoGPTPrompt","goals","memory","previousMessages","user_input","
|
|
1
|
+
{"version":3,"file":"prompt.d.cts","names":["VectorStoreRetrieverInterface","BaseChatPromptTemplate","SerializedBasePromptTemplate","BaseMessage","PartialValues","ObjectTool","AutoGPTPromptInput","Promise","AutoGPTPrompt","goals","memory","previousMessages","user_input","_langchain_core_messages2","MessageStructure","MessageType"],"sources":["../../../src/experimental/autogpt/prompt.d.ts"],"sourcesContent":["import type { VectorStoreRetrieverInterface } from \"@langchain/core/vectorstores\";\nimport { BaseChatPromptTemplate, SerializedBasePromptTemplate } from \"@langchain/core/prompts\";\nimport { BaseMessage } from \"@langchain/core/messages\";\nimport { PartialValues } from \"@langchain/core/utils/types\";\nimport { ObjectTool } from \"./schema.js\";\n/**\n * Interface for the input parameters of the AutoGPTPrompt class.\n */\nexport interface AutoGPTPromptInput {\n aiName: string;\n aiRole: string;\n tools: ObjectTool[];\n tokenCounter: (text: string) => Promise<number>;\n sendTokenLimit?: number;\n}\n/**\n * Class used to generate prompts for the AutoGPT model. It takes into\n * account the AI's name, role, tools, token counter, and send token\n * limit. The class also handles the formatting of messages and the\n * construction of the full prompt.\n */\nexport declare class AutoGPTPrompt extends BaseChatPromptTemplate implements AutoGPTPromptInput {\n aiName: string;\n aiRole: string;\n tools: ObjectTool[];\n tokenCounter: (text: string) => Promise<number>;\n sendTokenLimit: number;\n constructor(fields: AutoGPTPromptInput);\n _getPromptType(): \"autogpt\";\n /**\n * Constructs the full prompt based on the provided goals.\n * @param goals An array of goals.\n * @returns The full prompt as a string.\n */\n constructFullPrompt(goals: string[]): string;\n /**\n * Formats the messages based on the provided parameters.\n * @param goals An array of goals.\n * @param memory A VectorStoreRetriever instance.\n * @param messages An array of previous messages.\n * @param user_input The user's input.\n * @returns An array of formatted messages.\n */\n formatMessages({ goals, memory, messages: previousMessages, user_input }: {\n goals: string[];\n memory: VectorStoreRetrieverInterface;\n messages: BaseMessage[];\n user_input: string;\n }): Promise<BaseMessage<import(\"@langchain/core/messages\").MessageStructure, import(\"@langchain/core/messages\").MessageType>[]>;\n /**\n * This method is not implemented in the AutoGPTPrompt class and will\n * throw an error if called.\n * @param _values Partial values.\n * @returns Throws an error.\n */\n partial(_values: PartialValues): Promise<BaseChatPromptTemplate>;\n serialize(): SerializedBasePromptTemplate;\n}\n//# sourceMappingURL=prompt.d.ts.map"],"mappings":";;;;;;;;;;;AAQiBM,UAAAA,kBAAAA,CAAkB;EAadE,MAAAA,EAAAA,MAAAA;EAGVH,MAAAA,EAAAA,MAAAA;EACyBE,KAAAA,EAdzBF,UAcyBE,EAAAA;EAEZD,YAAAA,EAAAA,CAAAA,IAAAA,EAAAA,MAAAA,EAAAA,GAfYC,OAeZD,CAAAA,MAAAA,CAAAA;EAgBHG,cAAAA,CAAAA,EAAAA,MAAAA;;;;;;;;AAKLN,cA3BKK,aAAAA,SAAsBP,sBAAAA,YAAkCK,kBA2B7DH,CAAAA;EAARI,MAAAA,EAAAA,MAAAA;EAOaH,MAAAA,EAAAA,MAAAA;EAAwBH,KAAAA,EA/BlCI,UA+BkCJ,EAAAA;EAARM,YAAAA,EAAAA,CAAAA,IAAAA,EAAAA,MAAAA,EAAAA,GA9BDA,OA8BCA,CAAAA,MAAAA,CAAAA;EACpBL,cAAAA,EAAAA,MAAAA;EAnC0BD,WAAAA,CAAAA,MAAAA,EAMnBK,kBANmBL;EAAkCK,cAAAA,CAAAA,CAAAA,EAAAA,SAAAA;EAAkB;;;;;;;;;;;;;;;;;cAsBjDK;;;;YAE9BX;cACEG;;MAEVI,QAAQJ,YAFaU,yBAAAA,CAEkCC,gBAAAA,EAAgBD,yBAAAA,CAAqCE,WAAAA;;;;;;;mBAO/FX,gBAAgBG,QAAQN;eAC5BC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom_format.d.cts","names":["InputValues","ParsedFStringNode","PromptTemplate","PromptTemplateInput","TypedPromptInputValues","CustomFormatPromptTemplateInput","RunInput","Omit","CustomFormatPromptTemplate","PartialVariableName","Record","customParser","Symbol","Promise"],"sources":["../../../src/experimental/prompts/custom_format.d.ts"],"sourcesContent":["import type { InputValues } from \"@langchain/core/utils/types\";\nimport { type ParsedFStringNode, PromptTemplate, type PromptTemplateInput, TypedPromptInputValues } from \"@langchain/core/prompts\";\nexport type CustomFormatPromptTemplateInput<RunInput extends InputValues> = Omit<PromptTemplateInput<RunInput, string>, \"templateFormat\"> & {\n customParser: (template: string) => ParsedFStringNode[];\n templateValidator?: (template: string, inputVariables: string[]) => boolean;\n renderer: (template: string, values: InputValues) => string;\n};\nexport declare class CustomFormatPromptTemplate<RunInput extends InputValues = any, PartialVariableName extends string = any> extends PromptTemplate<RunInput, PartialVariableName> {\n static lc_name(): string;\n lc_serializable: boolean;\n templateValidator?: (template: string, inputVariables: string[]) => boolean;\n renderer: (template: string, values: InputValues) => string;\n constructor(input: CustomFormatPromptTemplateInput<RunInput>);\n /**\n * Load prompt template from a template\n */\n static fromTemplate<RunInput extends InputValues = Record<string, any>>(template: string, { customParser, ...rest }: Omit<CustomFormatPromptTemplateInput<RunInput>, \"template\" | \"inputVariables\">): CustomFormatPromptTemplate<RunInput extends Symbol ? never : RunInput, any>;\n /**\n * Formats the prompt template with the provided values.\n * @param values The values to be used to format the prompt template.\n * @returns A promise that resolves to a string which is the formatted prompt.\n */\n format(values: TypedPromptInputValues<RunInput>): Promise<string>;\n}\n//# sourceMappingURL=custom_format.d.ts.map"],"mappings":";;;;KAEYK,iDAAiDL,eAAeO,KAAKJ,oBAAoBG;sCAC7DL;EAD5BI,iBAAAA,CAAAA,EAAAA,CAAAA,QAAAA,EAAAA,MAA+B,
|
|
1
|
+
{"version":3,"file":"custom_format.d.cts","names":["InputValues","ParsedFStringNode","PromptTemplate","PromptTemplateInput","TypedPromptInputValues","CustomFormatPromptTemplateInput","RunInput","Omit","CustomFormatPromptTemplate","PartialVariableName","Record","customParser","Symbol","Promise"],"sources":["../../../src/experimental/prompts/custom_format.d.ts"],"sourcesContent":["import type { InputValues } from \"@langchain/core/utils/types\";\nimport { type ParsedFStringNode, PromptTemplate, type PromptTemplateInput, TypedPromptInputValues } from \"@langchain/core/prompts\";\nexport type CustomFormatPromptTemplateInput<RunInput extends InputValues> = Omit<PromptTemplateInput<RunInput, string>, \"templateFormat\"> & {\n customParser: (template: string) => ParsedFStringNode[];\n templateValidator?: (template: string, inputVariables: string[]) => boolean;\n renderer: (template: string, values: InputValues) => string;\n};\nexport declare class CustomFormatPromptTemplate<RunInput extends InputValues = any, PartialVariableName extends string = any> extends PromptTemplate<RunInput, PartialVariableName> {\n static lc_name(): string;\n lc_serializable: boolean;\n templateValidator?: (template: string, inputVariables: string[]) => boolean;\n renderer: (template: string, values: InputValues) => string;\n constructor(input: CustomFormatPromptTemplateInput<RunInput>);\n /**\n * Load prompt template from a template\n */\n static fromTemplate<RunInput extends InputValues = Record<string, any>>(template: string, { customParser, ...rest }: Omit<CustomFormatPromptTemplateInput<RunInput>, \"template\" | \"inputVariables\">): CustomFormatPromptTemplate<RunInput extends Symbol ? never : RunInput, any>;\n /**\n * Formats the prompt template with the provided values.\n * @param values The values to be used to format the prompt template.\n * @returns A promise that resolves to a string which is the formatted prompt.\n */\n format(values: TypedPromptInputValues<RunInput>): Promise<string>;\n}\n//# sourceMappingURL=custom_format.d.ts.map"],"mappings":";;;;KAEYK,iDAAiDL,eAAeO,KAAKJ,oBAAoBG;sCAC7DL;EAD5BI,iBAAAA,CAAAA,EAAAA,CAAAA,QAAAA,EAAAA,MAA+B,EAAA,cAAAC,EAAA,MAAA,EAAA,EAAA,GAAA,OAAA;EAAkBN,QAAAA,EAAAA,CAAAA,QAAAA,EAAAA,MAAAA,EAAAA,MAAAA,EAGpBA,WAHoBA,EAAAA,GAAAA,MAAAA;CAAwCM;AAApBH,cAK5DK,0BAL4DL,CAAAA,iBAKhBH,WALgBG,GAAAA,GAAAA,EAAAA,4BAAAA,MAAAA,GAAAA,GAAAA,CAAAA,SAKqDD,cALrDC,CAKoEG,QALpEH,EAK8EM,mBAL9EN,CAAAA,CAAAA;EAALI,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EACpCN,eAAAA,EAAAA,OAAAA;EAECD,iBAAAA,CAAAA,EAAAA,CAAAA,QAAAA,EAAAA,MAAAA,EAAAA,cAAAA,EAAAA,MAAAA,EAAAA,EAAAA,GAAAA,OAAAA;EAAW,QAAA,EAAA,CAAA,QAAA,EAAA,MAAA,EAAA,MAAA,EAMXA,WANW,EAAA,GAAA,MAAA;EAE/BQ,WAAAA,CAAAA,KAAAA,EAKEH,+BALwBI,CAKQH,QALRG,CAAAA;EAAkBT;;;EAIxBA,OAAAA,YAAAA,CAAAA,iBAKAA,WALAA,GAKcU,MALdV,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,CAAAA,CAAAA,QAAAA,EAAAA,MAAAA,EAAAA;IAAAA,YAAAA;IAAAA,GAAAA;EAAAA,CAAAA,EAKgFO,IALhFP,CAKqFK,+BALrFL,CAKqHM,QALrHN,CAAAA,EAAAA,UAAAA,GAAAA,gBAAAA,CAAAA,CAAAA,EAKiKQ,0BALjKR,CAK4LM,QAL5LN,SAK6MY,MAL7MZ,GAAAA,KAAAA,GAK8NM,QAL9NN,EAAAA,GAAAA,CAAAA;EACcM;;;;;EAIuGA,MAAAA,CAAAA,MAAAA,EAM3IF,sBAN2IE,CAMpHA,QANoHA,CAAAA,CAAAA,EAMxGO,OANwGP,CAAAA,MAAAA,CAAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlebars.d.cts","names":["InputValues","CustomFormatPromptTemplate","CustomFormatPromptTemplateInput","parseHandlebars","_langchain_core_prompts0","ParsedTemplateNode","interpolateHandlebars","HandlebarsPromptTemplateInput","RunInput","HandlebarsPromptTemplate","Record","Omit","Symbol"],"sources":["../../../src/experimental/prompts/handlebars.d.ts"],"sourcesContent":["import type { InputValues } from \"@langchain/core/utils/types\";\nimport { CustomFormatPromptTemplate, CustomFormatPromptTemplateInput } from \"./custom_format.js\";\nexport declare const parseHandlebars: (template: string) => import(\"@langchain/core/prompts\").ParsedTemplateNode[];\nexport declare const interpolateHandlebars: (template: string, values: InputValues) => string;\nexport type HandlebarsPromptTemplateInput<RunInput extends InputValues> = CustomFormatPromptTemplateInput<RunInput>;\nexport declare class HandlebarsPromptTemplate<RunInput extends InputValues = any> extends CustomFormatPromptTemplate<RunInput> {\n static lc_name(): string;\n /**\n * Load prompt template from a template\n */\n static fromTemplate<RunInput extends InputValues = Record<string, any>>(template: string, params?: Omit<HandlebarsPromptTemplateInput<RunInput>, \"template\" | \"inputVariables\" | \"customParser\" | \"templateValidator\" | \"renderer\">): CustomFormatPromptTemplate<RunInput extends Symbol ? never : RunInput, any>;\n}\n//# sourceMappingURL=handlebars.d.ts.map"],"mappings":";;;;;cAEqBG,uCAA6FC,wBAAAA,CAApBC,kBAAkB;cAC3FC,kDAAkDN;KAC3DO,+CAA+CP,eAAeE,gCAAgCM;AAFrFL,cAGAM,wBAH6FL,CAAAA,iBAGnDJ,WAH+BK,GAAkB,
|
|
1
|
+
{"version":3,"file":"handlebars.d.cts","names":["InputValues","CustomFormatPromptTemplate","CustomFormatPromptTemplateInput","parseHandlebars","_langchain_core_prompts0","ParsedTemplateNode","interpolateHandlebars","HandlebarsPromptTemplateInput","RunInput","HandlebarsPromptTemplate","Record","Omit","Symbol"],"sources":["../../../src/experimental/prompts/handlebars.d.ts"],"sourcesContent":["import type { InputValues } from \"@langchain/core/utils/types\";\nimport { CustomFormatPromptTemplate, CustomFormatPromptTemplateInput } from \"./custom_format.js\";\nexport declare const parseHandlebars: (template: string) => import(\"@langchain/core/prompts\").ParsedTemplateNode[];\nexport declare const interpolateHandlebars: (template: string, values: InputValues) => string;\nexport type HandlebarsPromptTemplateInput<RunInput extends InputValues> = CustomFormatPromptTemplateInput<RunInput>;\nexport declare class HandlebarsPromptTemplate<RunInput extends InputValues = any> extends CustomFormatPromptTemplate<RunInput> {\n static lc_name(): string;\n /**\n * Load prompt template from a template\n */\n static fromTemplate<RunInput extends InputValues = Record<string, any>>(template: string, params?: Omit<HandlebarsPromptTemplateInput<RunInput>, \"template\" | \"inputVariables\" | \"customParser\" | \"templateValidator\" | \"renderer\">): CustomFormatPromptTemplate<RunInput extends Symbol ? never : RunInput, any>;\n}\n//# sourceMappingURL=handlebars.d.ts.map"],"mappings":";;;;;cAEqBG,uCAA6FC,wBAAAA,CAApBC,kBAAkB;cAC3FC,kDAAkDN;KAC3DO,+CAA+CP,eAAeE,gCAAgCM;AAFrFL,cAGAM,wBAH6FL,CAAAA,iBAGnDJ,WAH+BK,GAAAA,GAAkB,CAAA,SAGtBJ,0BAHsB,CAGKO,QAHL,CAAA,CAAA;EAC3FF,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAwE;EACjFC;;;EAA8DL,OAAAA,YAAAA,CAAAA,iBAMjCF,WANiCE,GAMnBQ,MANmBR,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,CAAAA,CAAAA,QAAAA,EAAAA,MAAAA,EAAAA,MAAAA,CAAAA,EAM6BS,IAN7BT,CAMkCK,6BANlCL,CAMgEM,QANhEN,CAAAA,EAAAA,UAAAA,GAAAA,gBAAAA,GAAAA,cAAAA,GAAAA,mBAAAA,GAAAA,UAAAA,CAAAA,CAAAA,EAMgKD,0BANhKC,CAM2LM,QAN3LN,SAM4MU,MAN5MV,GAAAA,KAAAA,GAM6NM,QAN7NN,EAAAA,GAAAA,CAAAA;AAA+B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlebars.d.ts","names":["InputValues","CustomFormatPromptTemplate","CustomFormatPromptTemplateInput","parseHandlebars","_langchain_core_prompts0","ParsedTemplateNode","interpolateHandlebars","HandlebarsPromptTemplateInput","RunInput","HandlebarsPromptTemplate","Record","Omit","Symbol"],"sources":["../../../src/experimental/prompts/handlebars.d.ts"],"sourcesContent":["import type { InputValues } from \"@langchain/core/utils/types\";\nimport { CustomFormatPromptTemplate, CustomFormatPromptTemplateInput } from \"./custom_format.js\";\nexport declare const parseHandlebars: (template: string) => import(\"@langchain/core/prompts\").ParsedTemplateNode[];\nexport declare const interpolateHandlebars: (template: string, values: InputValues) => string;\nexport type HandlebarsPromptTemplateInput<RunInput extends InputValues> = CustomFormatPromptTemplateInput<RunInput>;\nexport declare class HandlebarsPromptTemplate<RunInput extends InputValues = any> extends CustomFormatPromptTemplate<RunInput> {\n static lc_name(): string;\n /**\n * Load prompt template from a template\n */\n static fromTemplate<RunInput extends InputValues = Record<string, any>>(template: string, params?: Omit<HandlebarsPromptTemplateInput<RunInput>, \"template\" | \"inputVariables\" | \"customParser\" | \"templateValidator\" | \"renderer\">): CustomFormatPromptTemplate<RunInput extends Symbol ? never : RunInput, any>;\n}\n//# sourceMappingURL=handlebars.d.ts.map"],"mappings":";;;;;cAEqBG,uCAA6FC,wBAAAA,CAApBC,kBAAkB;cAC3FC,kDAAkDN;KAC3DO,+CAA+CP,eAAeE,gCAAgCM;AAFrFL,cAGAM,wBAH6FL,CAAAA,iBAGnDJ,WAH+BK,GAAkB,
|
|
1
|
+
{"version":3,"file":"handlebars.d.ts","names":["InputValues","CustomFormatPromptTemplate","CustomFormatPromptTemplateInput","parseHandlebars","_langchain_core_prompts0","ParsedTemplateNode","interpolateHandlebars","HandlebarsPromptTemplateInput","RunInput","HandlebarsPromptTemplate","Record","Omit","Symbol"],"sources":["../../../src/experimental/prompts/handlebars.d.ts"],"sourcesContent":["import type { InputValues } from \"@langchain/core/utils/types\";\nimport { CustomFormatPromptTemplate, CustomFormatPromptTemplateInput } from \"./custom_format.js\";\nexport declare const parseHandlebars: (template: string) => import(\"@langchain/core/prompts\").ParsedTemplateNode[];\nexport declare const interpolateHandlebars: (template: string, values: InputValues) => string;\nexport type HandlebarsPromptTemplateInput<RunInput extends InputValues> = CustomFormatPromptTemplateInput<RunInput>;\nexport declare class HandlebarsPromptTemplate<RunInput extends InputValues = any> extends CustomFormatPromptTemplate<RunInput> {\n static lc_name(): string;\n /**\n * Load prompt template from a template\n */\n static fromTemplate<RunInput extends InputValues = Record<string, any>>(template: string, params?: Omit<HandlebarsPromptTemplateInput<RunInput>, \"template\" | \"inputVariables\" | \"customParser\" | \"templateValidator\" | \"renderer\">): CustomFormatPromptTemplate<RunInput extends Symbol ? never : RunInput, any>;\n}\n//# sourceMappingURL=handlebars.d.ts.map"],"mappings":";;;;;cAEqBG,uCAA6FC,wBAAAA,CAApBC,kBAAkB;cAC3FC,kDAAkDN;KAC3DO,+CAA+CP,eAAeE,gCAAgCM;AAFrFL,cAGAM,wBAH6FL,CAAAA,iBAGnDJ,WAH+BK,GAAAA,GAAkB,CAAA,SAGtBJ,0BAHsB,CAGKO,QAHL,CAAA,CAAA;EAC3FF,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAwE;EACjFC;;;EAA8DL,OAAAA,YAAAA,CAAAA,iBAMjCF,WANiCE,GAMnBQ,MANmBR,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,CAAAA,CAAAA,QAAAA,EAAAA,MAAAA,EAAAA,MAAAA,CAAAA,EAM6BS,IAN7BT,CAMkCK,6BANlCL,CAMgEM,QANhEN,CAAAA,EAAAA,UAAAA,GAAAA,gBAAAA,GAAAA,cAAAA,GAAAA,mBAAAA,GAAAA,UAAAA,CAAAA,CAAAA,EAMgKD,0BANhKC,CAM2LM,QAN3LN,SAM4MU,MAN5MV,GAAAA,KAAAA,GAM6NM,QAN7NN,EAAAA,GAAAA,CAAAA;AAA+B"}
|
package/dist/load/import_map.cjs
CHANGED
|
@@ -30,7 +30,7 @@ const require_storage_encoder_backed = require('../storage/encoder_backed.cjs');
|
|
|
30
30
|
const require_embeddings_cache_backed = require('../embeddings/cache_backed.cjs');
|
|
31
31
|
const require_embeddings_fake = require('../embeddings/fake.cjs');
|
|
32
32
|
const require_evaluation_index = require('../evaluation/index.cjs');
|
|
33
|
-
const
|
|
33
|
+
const require_schema_prompt_template = require('../schema/prompt_template.cjs');
|
|
34
34
|
const require_chains_graph_qa_cypher = require('../chains/graph_qa/cypher.cjs');
|
|
35
35
|
const require_load_serializable = require('./serializable.cjs');
|
|
36
36
|
const require_experimental_openai_files_index = require('../experimental/openai_files/index.cjs');
|
|
@@ -89,7 +89,7 @@ const require_tools_sql = require('../tools/sql.cjs');
|
|
|
89
89
|
const require_agents_toolkits_sql_index = require('../agents/toolkits/sql/index.cjs');
|
|
90
90
|
const require_util_math = require('../util/math.cjs');
|
|
91
91
|
const require_document_loaders_fs_buffer = require('../document_loaders/fs/buffer.cjs');
|
|
92
|
-
const
|
|
92
|
+
const require_retrievers_contextual_compression = require('../retrievers/contextual_compression.cjs');
|
|
93
93
|
const __langchain_core_output_parsers = require_rolldown_runtime.__toESM(require("@langchain/core/output_parsers"));
|
|
94
94
|
|
|
95
95
|
//#region src/load/import_map.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import_map.cjs","names":[],"sources":["../../src/load/import_map.ts"],"sourcesContent":["/** Auto-generated by import-map plugin. Do not edit manually */\n\nexport * as
|
|
1
|
+
{"version":3,"file":"import_map.cjs","names":[],"sources":["../../src/load/import_map.ts"],"sourcesContent":["/** Auto-generated by import-map plugin. Do not edit manually */\n\nexport * as schema__prompt_template from \"../schema/prompt_template.js\";\nexport * as text_splitter from \"../text_splitter.js\";\nexport * as chains__retrieval from \"../chains/retrieval.js\";\nexport * as chains__graph_qa__cypher from \"../chains/graph_qa/cypher.js\";\nexport * as load__serializable from \"../load/serializable.js\";\nexport * as experimental__openai_files from \"../experimental/openai_files/index.js\";\nexport * as memory__chat_memory from \"../memory/chat_memory.js\";\nexport * as retrievers__time_weighted from \"../retrievers/time_weighted.js\";\nexport * as retrievers__document_compressors from \"../retrievers/document_compressors/index.js\";\nexport * as experimental__openai_assistant from \"../experimental/openai_assistant/index.js\";\nexport * as stores__file__node from \"../stores/file/node.js\";\nexport * as document_transformers__openai_functions from \"../document_transformers/openai_functions.js\";\nexport * as experimental__plan_and_execute from \"../experimental/plan_and_execute/index.js\";\nexport * as retrievers__parent_document from \"../retrievers/parent_document.js\";\nexport * as output_parsers__expression from \"../output_parsers/expression.js\";\nexport * as chains__combine_documents from \"../chains/combine_documents/index.js\";\nexport * as agents from \"../agents/index.js\";\nexport * as embeddings__fake from \"../embeddings/fake.js\";\nexport * as chains__history_aware_retriever from \"../chains/history_aware_retriever.js\";\nexport * as experimental__generative_agents from \"../experimental/generative_agents/index.js\";\nexport * as document_loaders__fs__multi_file from \"../document_loaders/fs/multi_file.js\";\nexport * as tools__retriever from \"../tools/retriever.js\";\nexport * as retrievers__ensemble from \"../retrievers/ensemble.js\";\nexport * as agents__load from \"../agents/load.js\";\nexport * as callbacks from \"../callbacks/index.js\";\nexport * as retrievers__multi_vector from \"../retrievers/multi_vector.js\";\nexport * as agents__format_scratchpad__log_to_message from \"../agents/format_scratchpad/log_to_message.js\";\nexport * as agents__format_scratchpad__xml from \"../agents/format_scratchpad/xml.js\";\nexport * as agents__toolkits from \"../agents/toolkits/index.js\";\nexport * as experimental__babyagi from \"../experimental/babyagi/index.js\";\nexport * as retrievers__document_compressors__chain_extract from \"../retrievers/document_compressors/chain_extract.js\";\nexport * as stores__file__in_memory from \"../stores/file/in_memory.js\";\nexport * as retrievers__score_threshold from \"../retrievers/score_threshold.js\";\nexport * as document_loaders__fs__json from \"../document_loaders/fs/json.js\";\nexport * as schema__query_constructor from \"../schema/query_constructor.js\";\nexport * as util__time from \"../util/time.js\";\nexport * as agents__format_scratchpad__log from \"../agents/format_scratchpad/log.js\";\nexport * as chains__openai_functions from \"../chains/openai_functions/index.js\";\nexport * as retrievers__multi_query from \"../retrievers/multi_query.js\";\nexport * as tools__webbrowser from \"../tools/webbrowser.js\";\nexport * as retrievers__document_compressors__embeddings_filter from \"../retrievers/document_compressors/embeddings_filter.js\";\nexport * as storage__in_memory from \"../storage/in_memory.js\";\nexport * as chains__load from \"../chains/load.js\";\nexport * as embeddings__cache_backed from \"../embeddings/cache_backed.js\";\nexport * as retrievers__matryoshka_retriever from \"../retrievers/matryoshka_retriever.js\";\nexport * as chains__combine_documents__reduce from \"../chains/combine_documents/reduce.js\";\nexport * as retrievers__self_query from \"../retrievers/self_query/index.js\";\nexport * as chat_models__universal from \"../chat_models/universal.js\";\nexport * as smith from \"../smith/index.js\";\nexport * as memory from \"../memory/index.js\";\nexport * as document_loaders__fs__text from \"../document_loaders/fs/text.js\";\nexport * as agents__openai__output_parser from \"../agents/openai/output_parser.js\";\nexport * as storage__file_system from \"../storage/file_system.js\";\nexport * as sql_db from \"../sql_db.js\";\nexport * as tools__chain from \"../tools/chain.js\";\nexport * as agents__xml__output_parser from \"../agents/xml/output_parser.js\";\nexport * as document_loaders__fs__directory from \"../document_loaders/fs/directory.js\";\nexport * as cache__file_system from \"../cache/file_system.js\";\nexport * as retrievers__self_query__functional from \"../retrievers/self_query/functional.js\";\nexport * as experimental__prompts__handlebars from \"../experimental/prompts/handlebars.js\";\nexport * as experimental__chains__violation_of_expectations from \"../experimental/chains/violation_of_expectations/index.js\";\nexport * as stores__doc__in_memory from \"../stores/doc/in_memory.js\";\nexport * as tools__render from \"../tools/render.js\";\nexport * as indexes from \"../indexes/index.js\";\nexport * as retrievers__hyde from \"../retrievers/hyde.js\";\nexport * as experimental__autogpt from \"../experimental/autogpt/index.js\";\nexport * as agents__react__output_parser from \"../agents/react/output_parser.js\";\nexport * as document from \"../document.js\";\nexport * as output_parsers from \"../output_parsers/index.js\";\nexport * as util__document from \"../util/document.js\";\nexport * as chains__query_constructor from \"../chains/query_constructor/index.js\";\nexport * as document_loaders__base from \"../document_loaders/base.js\";\nexport * as experimental__prompts__custom_format from \"../experimental/prompts/custom_format.js\";\nexport * as stores__message__in_memory from \"../stores/message/in_memory.js\";\nexport * as vectorstores__memory from \"../vectorstores/memory.js\";\nexport * as experimental__masking from \"../experimental/masking/index.js\";\nexport * as tools from \"../tools/index.js\";\nexport * as chains__sql_db from \"../chains/sql_db/index.js\";\nexport * as index from \"../index.js\";\nexport * as storage__encoder_backed from \"../storage/encoder_backed.js\";\nexport * as stores__doc__base from \"../stores/doc/base.js\";\nexport * as chains__query_constructor__ir from \"../chains/query_constructor/ir.js\";\nexport * as agents__format_scratchpad__openai_tools from \"../agents/format_scratchpad/openai_tools.js\";\nexport * as agents__toolkits__sql from \"../agents/toolkits/sql/index.js\";\nexport * as util__math from \"../util/math.js\";\nexport * as document_loaders__fs__buffer from \"../document_loaders/fs/buffer.js\";\nexport * as tools__sql from \"../tools/sql.js\";\nexport * as chains from \"../chains/index.js\";\nexport * as agents__format_scratchpad__openai_functions from \"../agents/format_scratchpad/openai_functions.js\";\nexport * as evaluation from \"../evaluation/index.js\";\nexport * as retrievers__contextual_compression from \"../retrievers/contextual_compression.js\";\nimport { StringOutputParser } from \"@langchain/core/output_parsers\";\nconst schema__output_parser = {\n StringOutputParser,\n};\nexport { schema__output_parser };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8FA,MAAM,wBAAwB,EAC5B,uEACD"}
|
package/dist/load/import_map.js
CHANGED
|
@@ -30,7 +30,7 @@ import { encoder_backed_exports } from "../storage/encoder_backed.js";
|
|
|
30
30
|
import { cache_backed_exports } from "../embeddings/cache_backed.js";
|
|
31
31
|
import { fake_exports } from "../embeddings/fake.js";
|
|
32
32
|
import { evaluation_exports } from "../evaluation/index.js";
|
|
33
|
-
import {
|
|
33
|
+
import { prompt_template_exports } from "../schema/prompt_template.js";
|
|
34
34
|
import { cypher_exports } from "../chains/graph_qa/cypher.js";
|
|
35
35
|
import { serializable_exports } from "./serializable.js";
|
|
36
36
|
import { openai_files_exports } from "../experimental/openai_files/index.js";
|
|
@@ -89,7 +89,7 @@ import { sql_exports } from "../tools/sql.js";
|
|
|
89
89
|
import { sql_exports as sql_exports$1 } from "../agents/toolkits/sql/index.js";
|
|
90
90
|
import { math_exports } from "../util/math.js";
|
|
91
91
|
import { buffer_exports } from "../document_loaders/fs/buffer.js";
|
|
92
|
-
import {
|
|
92
|
+
import { contextual_compression_exports } from "../retrievers/contextual_compression.js";
|
|
93
93
|
import { StringOutputParser } from "@langchain/core/output_parsers";
|
|
94
94
|
|
|
95
95
|
//#region src/load/import_map.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import_map.js","names":[],"sources":["../../src/load/import_map.ts"],"sourcesContent":["/** Auto-generated by import-map plugin. Do not edit manually */\n\nexport * as
|
|
1
|
+
{"version":3,"file":"import_map.js","names":[],"sources":["../../src/load/import_map.ts"],"sourcesContent":["/** Auto-generated by import-map plugin. Do not edit manually */\n\nexport * as schema__prompt_template from \"../schema/prompt_template.js\";\nexport * as text_splitter from \"../text_splitter.js\";\nexport * as chains__retrieval from \"../chains/retrieval.js\";\nexport * as chains__graph_qa__cypher from \"../chains/graph_qa/cypher.js\";\nexport * as load__serializable from \"../load/serializable.js\";\nexport * as experimental__openai_files from \"../experimental/openai_files/index.js\";\nexport * as memory__chat_memory from \"../memory/chat_memory.js\";\nexport * as retrievers__time_weighted from \"../retrievers/time_weighted.js\";\nexport * as retrievers__document_compressors from \"../retrievers/document_compressors/index.js\";\nexport * as experimental__openai_assistant from \"../experimental/openai_assistant/index.js\";\nexport * as stores__file__node from \"../stores/file/node.js\";\nexport * as document_transformers__openai_functions from \"../document_transformers/openai_functions.js\";\nexport * as experimental__plan_and_execute from \"../experimental/plan_and_execute/index.js\";\nexport * as retrievers__parent_document from \"../retrievers/parent_document.js\";\nexport * as output_parsers__expression from \"../output_parsers/expression.js\";\nexport * as chains__combine_documents from \"../chains/combine_documents/index.js\";\nexport * as agents from \"../agents/index.js\";\nexport * as embeddings__fake from \"../embeddings/fake.js\";\nexport * as chains__history_aware_retriever from \"../chains/history_aware_retriever.js\";\nexport * as experimental__generative_agents from \"../experimental/generative_agents/index.js\";\nexport * as document_loaders__fs__multi_file from \"../document_loaders/fs/multi_file.js\";\nexport * as tools__retriever from \"../tools/retriever.js\";\nexport * as retrievers__ensemble from \"../retrievers/ensemble.js\";\nexport * as agents__load from \"../agents/load.js\";\nexport * as callbacks from \"../callbacks/index.js\";\nexport * as retrievers__multi_vector from \"../retrievers/multi_vector.js\";\nexport * as agents__format_scratchpad__log_to_message from \"../agents/format_scratchpad/log_to_message.js\";\nexport * as agents__format_scratchpad__xml from \"../agents/format_scratchpad/xml.js\";\nexport * as agents__toolkits from \"../agents/toolkits/index.js\";\nexport * as experimental__babyagi from \"../experimental/babyagi/index.js\";\nexport * as retrievers__document_compressors__chain_extract from \"../retrievers/document_compressors/chain_extract.js\";\nexport * as stores__file__in_memory from \"../stores/file/in_memory.js\";\nexport * as retrievers__score_threshold from \"../retrievers/score_threshold.js\";\nexport * as document_loaders__fs__json from \"../document_loaders/fs/json.js\";\nexport * as schema__query_constructor from \"../schema/query_constructor.js\";\nexport * as util__time from \"../util/time.js\";\nexport * as agents__format_scratchpad__log from \"../agents/format_scratchpad/log.js\";\nexport * as chains__openai_functions from \"../chains/openai_functions/index.js\";\nexport * as retrievers__multi_query from \"../retrievers/multi_query.js\";\nexport * as tools__webbrowser from \"../tools/webbrowser.js\";\nexport * as retrievers__document_compressors__embeddings_filter from \"../retrievers/document_compressors/embeddings_filter.js\";\nexport * as storage__in_memory from \"../storage/in_memory.js\";\nexport * as chains__load from \"../chains/load.js\";\nexport * as embeddings__cache_backed from \"../embeddings/cache_backed.js\";\nexport * as retrievers__matryoshka_retriever from \"../retrievers/matryoshka_retriever.js\";\nexport * as chains__combine_documents__reduce from \"../chains/combine_documents/reduce.js\";\nexport * as retrievers__self_query from \"../retrievers/self_query/index.js\";\nexport * as chat_models__universal from \"../chat_models/universal.js\";\nexport * as smith from \"../smith/index.js\";\nexport * as memory from \"../memory/index.js\";\nexport * as document_loaders__fs__text from \"../document_loaders/fs/text.js\";\nexport * as agents__openai__output_parser from \"../agents/openai/output_parser.js\";\nexport * as storage__file_system from \"../storage/file_system.js\";\nexport * as sql_db from \"../sql_db.js\";\nexport * as tools__chain from \"../tools/chain.js\";\nexport * as agents__xml__output_parser from \"../agents/xml/output_parser.js\";\nexport * as document_loaders__fs__directory from \"../document_loaders/fs/directory.js\";\nexport * as cache__file_system from \"../cache/file_system.js\";\nexport * as retrievers__self_query__functional from \"../retrievers/self_query/functional.js\";\nexport * as experimental__prompts__handlebars from \"../experimental/prompts/handlebars.js\";\nexport * as experimental__chains__violation_of_expectations from \"../experimental/chains/violation_of_expectations/index.js\";\nexport * as stores__doc__in_memory from \"../stores/doc/in_memory.js\";\nexport * as tools__render from \"../tools/render.js\";\nexport * as indexes from \"../indexes/index.js\";\nexport * as retrievers__hyde from \"../retrievers/hyde.js\";\nexport * as experimental__autogpt from \"../experimental/autogpt/index.js\";\nexport * as agents__react__output_parser from \"../agents/react/output_parser.js\";\nexport * as document from \"../document.js\";\nexport * as output_parsers from \"../output_parsers/index.js\";\nexport * as util__document from \"../util/document.js\";\nexport * as chains__query_constructor from \"../chains/query_constructor/index.js\";\nexport * as document_loaders__base from \"../document_loaders/base.js\";\nexport * as experimental__prompts__custom_format from \"../experimental/prompts/custom_format.js\";\nexport * as stores__message__in_memory from \"../stores/message/in_memory.js\";\nexport * as vectorstores__memory from \"../vectorstores/memory.js\";\nexport * as experimental__masking from \"../experimental/masking/index.js\";\nexport * as tools from \"../tools/index.js\";\nexport * as chains__sql_db from \"../chains/sql_db/index.js\";\nexport * as index from \"../index.js\";\nexport * as storage__encoder_backed from \"../storage/encoder_backed.js\";\nexport * as stores__doc__base from \"../stores/doc/base.js\";\nexport * as chains__query_constructor__ir from \"../chains/query_constructor/ir.js\";\nexport * as agents__format_scratchpad__openai_tools from \"../agents/format_scratchpad/openai_tools.js\";\nexport * as agents__toolkits__sql from \"../agents/toolkits/sql/index.js\";\nexport * as util__math from \"../util/math.js\";\nexport * as document_loaders__fs__buffer from \"../document_loaders/fs/buffer.js\";\nexport * as tools__sql from \"../tools/sql.js\";\nexport * as chains from \"../chains/index.js\";\nexport * as agents__format_scratchpad__openai_functions from \"../agents/format_scratchpad/openai_functions.js\";\nexport * as evaluation from \"../evaluation/index.js\";\nexport * as retrievers__contextual_compression from \"../retrievers/contextual_compression.js\";\nimport { StringOutputParser } from \"@langchain/core/output_parsers\";\nconst schema__output_parser = {\n StringOutputParser,\n};\nexport { schema__output_parser };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8FA,MAAM,wBAAwB,EAC5B,mBACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matryoshka_retriever.d.ts","names":["DocumentInterface","Embeddings","VectorStore","VectorStoreRetriever","VectorStoreRetrieverInput","AddDocumentOptions","Record","MatryoshkaRetrieverFields","MatryoshkaRetriever","Store","Promise"],"sources":["../../src/retrievers/matryoshka_retriever.d.ts"],"sourcesContent":["import { DocumentInterface } from \"@langchain/core/documents\";\nimport { Embeddings } from \"@langchain/core/embeddings\";\nimport { VectorStore, VectorStoreRetriever, VectorStoreRetrieverInput } from \"@langchain/core/vectorstores\";\n/**\n * Type for options when adding a document to the VectorStore.\n */\ntype AddDocumentOptions = Record<string, any>;\nexport interface MatryoshkaRetrieverFields {\n /**\n * The number of documents to retrieve from the small store.\n * @default 50\n */\n smallK?: number;\n /**\n * The number of documents to retrieve from the large store.\n * @default 8\n */\n largeK?: number;\n /**\n * The metadata key to store the larger embeddings.\n * @default \"lc_large_embedding\"\n */\n largeEmbeddingKey?: string;\n /**\n * The embedding model to use when generating the large\n * embeddings.\n */\n largeEmbeddingModel: Embeddings;\n /**\n * The type of search to perform using the large embeddings.\n * @default \"cosine\"\n */\n searchType?: \"cosine\" | \"innerProduct\" | \"euclidean\";\n}\n/**\n * A retriever that uses two sets of embeddings to perform adaptive retrieval. Based\n * off of the \"Matryoshka embeddings: faster OpenAI vector search using Adaptive Retrieval\"\n * blog post {@link https://supabase.com/blog/matryoshka-embeddings}.\n *\n *\n * This class performs \"Adaptive Retrieval\" for searching text embeddings efficiently using the\n * Matryoshka Representation Learning (MRL) technique. It retrieves documents similar to a query\n * embedding in two steps:\n *\n * First-pass: Uses a lower dimensional sub-vector from the MRL embedding for an initial, fast,\n * but less accurate search.\n *\n * Second-pass: Re-ranks the top results from the first pass using the full, high-dimensional\n * embedding for higher accuracy.\n *\n *\n * This code implements MRL embeddings for efficient vector search by combining faster,\n * lower-dimensional initial search with accurate, high-dimensional re-ranking.\n */\nexport declare class MatryoshkaRetriever<Store extends VectorStore = VectorStore> extends VectorStoreRetriever<Store> {\n smallK: number;\n largeK: number;\n largeEmbeddingKey: string;\n largeEmbeddingModel: Embeddings;\n searchType: \"cosine\" | \"innerProduct\" | \"euclidean\";\n constructor(fields: MatryoshkaRetrieverFields & VectorStoreRetrieverInput<Store>);\n /**\n * Ranks documents based on their similarity to a query embedding using larger embeddings.\n *\n * This method takes a query embedding and a list of documents (smallResults) as input. Each document\n * in the smallResults array has previously been associated with a large embedding stored in its metadata.\n * Depending on the `searchType` (cosine, innerProduct, or euclidean), it calculates the similarity scores\n * between the query embedding and each document's large embedding. It then ranks the documents based on\n * these similarity scores, from the most similar to the least similar.\n *\n * The method returns a promise that resolves to an array of the top `largeK` documents, where `largeK`\n * is a class property defining the number of documents to return. This subset of documents is determined\n * by sorting the entire list of documents based on their similarity scores and then selecting the top\n * `largeK` documents.\n *\n * @param {number[]} embeddedQuery The embedding of the query, represented as an array of numbers.\n * @param {DocumentInterface[]} smallResults An array of documents, each with metadata that includes a large embedding for similarity comparison.\n * @returns {Promise<DocumentInterface[]>} A promise that resolves to an array of the top `largeK` ranked documents based on their similarity to the query embedding.\n */\n private _rankByLargeEmbeddings;\n _getRelevantDocuments(query: string): Promise<DocumentInterface[]>;\n /**\n * Override the default `addDocuments` method to embed the documents twice,\n * once using the larger embeddings model, and then again using the default\n * embedding model linked to the vector store.\n *\n * @param {DocumentInterface[]} documents - An array of documents to add to the vector store.\n * @param {AddDocumentOptions} options - An optional object containing additional options for adding documents.\n * @returns {Promise<string[] | void>} A promise that resolves to an array of the document IDs that were added to the vector store.\n */\n addDocuments: (documents: DocumentInterface<Record<string, any>>[], options?: AddDocumentOptions | undefined) => Promise<void | string[]>;\n}\nexport {};\n//# sourceMappingURL=matryoshka_retriever.d.ts.map"],"mappings":";;;;;;;;AAE4G;AAK5G,KADKK,kBAAAA,GAAqBC,MACgB,CAAA,MAAA,EAAA,
|
|
1
|
+
{"version":3,"file":"matryoshka_retriever.d.ts","names":["DocumentInterface","Embeddings","VectorStore","VectorStoreRetriever","VectorStoreRetrieverInput","AddDocumentOptions","Record","MatryoshkaRetrieverFields","MatryoshkaRetriever","Store","Promise"],"sources":["../../src/retrievers/matryoshka_retriever.d.ts"],"sourcesContent":["import { DocumentInterface } from \"@langchain/core/documents\";\nimport { Embeddings } from \"@langchain/core/embeddings\";\nimport { VectorStore, VectorStoreRetriever, VectorStoreRetrieverInput } from \"@langchain/core/vectorstores\";\n/**\n * Type for options when adding a document to the VectorStore.\n */\ntype AddDocumentOptions = Record<string, any>;\nexport interface MatryoshkaRetrieverFields {\n /**\n * The number of documents to retrieve from the small store.\n * @default 50\n */\n smallK?: number;\n /**\n * The number of documents to retrieve from the large store.\n * @default 8\n */\n largeK?: number;\n /**\n * The metadata key to store the larger embeddings.\n * @default \"lc_large_embedding\"\n */\n largeEmbeddingKey?: string;\n /**\n * The embedding model to use when generating the large\n * embeddings.\n */\n largeEmbeddingModel: Embeddings;\n /**\n * The type of search to perform using the large embeddings.\n * @default \"cosine\"\n */\n searchType?: \"cosine\" | \"innerProduct\" | \"euclidean\";\n}\n/**\n * A retriever that uses two sets of embeddings to perform adaptive retrieval. Based\n * off of the \"Matryoshka embeddings: faster OpenAI vector search using Adaptive Retrieval\"\n * blog post {@link https://supabase.com/blog/matryoshka-embeddings}.\n *\n *\n * This class performs \"Adaptive Retrieval\" for searching text embeddings efficiently using the\n * Matryoshka Representation Learning (MRL) technique. It retrieves documents similar to a query\n * embedding in two steps:\n *\n * First-pass: Uses a lower dimensional sub-vector from the MRL embedding for an initial, fast,\n * but less accurate search.\n *\n * Second-pass: Re-ranks the top results from the first pass using the full, high-dimensional\n * embedding for higher accuracy.\n *\n *\n * This code implements MRL embeddings for efficient vector search by combining faster,\n * lower-dimensional initial search with accurate, high-dimensional re-ranking.\n */\nexport declare class MatryoshkaRetriever<Store extends VectorStore = VectorStore> extends VectorStoreRetriever<Store> {\n smallK: number;\n largeK: number;\n largeEmbeddingKey: string;\n largeEmbeddingModel: Embeddings;\n searchType: \"cosine\" | \"innerProduct\" | \"euclidean\";\n constructor(fields: MatryoshkaRetrieverFields & VectorStoreRetrieverInput<Store>);\n /**\n * Ranks documents based on their similarity to a query embedding using larger embeddings.\n *\n * This method takes a query embedding and a list of documents (smallResults) as input. Each document\n * in the smallResults array has previously been associated with a large embedding stored in its metadata.\n * Depending on the `searchType` (cosine, innerProduct, or euclidean), it calculates the similarity scores\n * between the query embedding and each document's large embedding. It then ranks the documents based on\n * these similarity scores, from the most similar to the least similar.\n *\n * The method returns a promise that resolves to an array of the top `largeK` documents, where `largeK`\n * is a class property defining the number of documents to return. This subset of documents is determined\n * by sorting the entire list of documents based on their similarity scores and then selecting the top\n * `largeK` documents.\n *\n * @param {number[]} embeddedQuery The embedding of the query, represented as an array of numbers.\n * @param {DocumentInterface[]} smallResults An array of documents, each with metadata that includes a large embedding for similarity comparison.\n * @returns {Promise<DocumentInterface[]>} A promise that resolves to an array of the top `largeK` ranked documents based on their similarity to the query embedding.\n */\n private _rankByLargeEmbeddings;\n _getRelevantDocuments(query: string): Promise<DocumentInterface[]>;\n /**\n * Override the default `addDocuments` method to embed the documents twice,\n * once using the larger embeddings model, and then again using the default\n * embedding model linked to the vector store.\n *\n * @param {DocumentInterface[]} documents - An array of documents to add to the vector store.\n * @param {AddDocumentOptions} options - An optional object containing additional options for adding documents.\n * @returns {Promise<string[] | void>} A promise that resolves to an array of the document IDs that were added to the vector store.\n */\n addDocuments: (documents: DocumentInterface<Record<string, any>>[], options?: AddDocumentOptions | undefined) => Promise<void | string[]>;\n}\nexport {};\n//# sourceMappingURL=matryoshka_retriever.d.ts.map"],"mappings":";;;;;;;;AAE4G;AAK5G,KADKK,kBAAAA,GAAqBC,MACgB,CAAA,MAAA,EAAA,GAoBjBL,CAAAA;AA2BJO,UA/CJD,yBAAAA,CA+CuB;EAAeL;;;;EAM/BK,MAAAA,CAAAA,EAAAA,MAAAA;EAAsDE;;;;EA8B9BH,MAAAA,CAAAA,EAAAA,MAAAA;EAAlBN;;;;EApCgF,iBAAA,CAAA,EAAA,MAAA;;;;;uBA3BrFC;;;;;;;;;;;;;;;;;;;;;;;;;;;cA2BJO,kCAAkCN,cAAcA,qBAAqBC,qBAAqBM;;;;uBAItFR;;sBAEDM,4BAA4BH,0BAA0BK;;;;;;;;;;;;;;;;;;;;wCAoBpCC,QAAQV;;;;;;;;;;4BAUpBA,kBAAkBM,kCAAkCD,mCAAmCK"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@langchain/classic",
|
|
3
|
-
"version": "1.0.6-dev-
|
|
3
|
+
"version": "1.0.6-dev-1765432861398",
|
|
4
4
|
"description": "Old abstractions form LangChain.js",
|
|
5
5
|
"author": "LangChain",
|
|
6
6
|
"license": "MIT",
|
|
@@ -171,40 +171,40 @@
|
|
|
171
171
|
"voy-search": "0.6.2",
|
|
172
172
|
"weaviate-client": "^3.8.0",
|
|
173
173
|
"zod-to-json-schema": "^3.24.6",
|
|
174
|
-
"@langchain/anthropic": "1.3.0-dev-
|
|
174
|
+
"@langchain/anthropic": "1.3.0-dev-1765432861398",
|
|
175
175
|
"@langchain/aws": "1.1.0",
|
|
176
176
|
"@langchain/azure-cosmosdb": "1.1.0",
|
|
177
177
|
"@langchain/azure-dynamic-sessions": "1.0.1",
|
|
178
178
|
"@langchain/baidu-qianfan": "1.0.1",
|
|
179
179
|
"@langchain/cloudflare": "1.0.1",
|
|
180
180
|
"@langchain/cohere": "1.0.1",
|
|
181
|
-
"@langchain/core": "1.1.5-dev-
|
|
182
|
-
"@langchain/deepseek": "1.0.3-dev-
|
|
181
|
+
"@langchain/core": "1.1.5-dev-1765432861398",
|
|
182
|
+
"@langchain/deepseek": "1.0.3-dev-1765432861398",
|
|
183
183
|
"@langchain/eslint": "0.1.1",
|
|
184
184
|
"@langchain/exa": "1.0.1",
|
|
185
|
-
"@langchain/google-cloud-sql-pg": "1.0.6-dev-
|
|
186
|
-
"@langchain/google-common": "2.0.5-dev-
|
|
187
|
-
"@langchain/google-genai": "2.0.5-dev-
|
|
188
|
-
"@langchain/google-vertexai": "2.0.5-dev-
|
|
189
|
-
"@langchain/google-vertexai-web": "2.0.5-dev-
|
|
185
|
+
"@langchain/google-cloud-sql-pg": "1.0.6-dev-1765432861398",
|
|
186
|
+
"@langchain/google-common": "2.0.5-dev-1765432861398",
|
|
187
|
+
"@langchain/google-genai": "2.0.5-dev-1765432861398",
|
|
188
|
+
"@langchain/google-vertexai": "2.0.5-dev-1765432861398",
|
|
189
|
+
"@langchain/google-vertexai-web": "2.0.5-dev-1765432861398",
|
|
190
190
|
"@langchain/groq": "1.0.2",
|
|
191
191
|
"@langchain/mistralai": "1.0.1",
|
|
192
192
|
"@langchain/mongodb": "1.0.2",
|
|
193
193
|
"@langchain/nomic": "1.0.1",
|
|
194
|
-
"@langchain/ollama": "1.0.4-dev-
|
|
194
|
+
"@langchain/ollama": "1.0.4-dev-1765432861398",
|
|
195
195
|
"@langchain/pinecone": "1.0.1",
|
|
196
196
|
"@langchain/qdrant": "1.0.1",
|
|
197
197
|
"@langchain/redis": "1.0.1",
|
|
198
198
|
"@langchain/tavily": "1.0.1",
|
|
199
199
|
"@langchain/textsplitters": "1.0.1",
|
|
200
200
|
"@langchain/weaviate": "1.0.1",
|
|
201
|
-
"@langchain/xai": "1.0.3-dev-
|
|
201
|
+
"@langchain/xai": "1.0.3-dev-1765432861398",
|
|
202
202
|
"@langchain/yandex": "1.0.1",
|
|
203
203
|
"@langchain/tsconfig": "0.0.1",
|
|
204
|
-
"langchain": "1.1.6-dev-
|
|
204
|
+
"langchain": "1.1.6-dev-1765432861398"
|
|
205
205
|
},
|
|
206
206
|
"peerDependencies": {
|
|
207
|
-
"@langchain/core": "1.1.5-dev-
|
|
207
|
+
"@langchain/core": "1.1.5-dev-1765432861398",
|
|
208
208
|
"cheerio": "*",
|
|
209
209
|
"peggy": "^3.0.2",
|
|
210
210
|
"typeorm": "*"
|
|
@@ -228,7 +228,7 @@
|
|
|
228
228
|
"uuid": "^10.0.0",
|
|
229
229
|
"yaml": "^2.2.1",
|
|
230
230
|
"zod": "^3.25.76 || ^4",
|
|
231
|
-
"@langchain/openai": "1.2.0-dev-
|
|
231
|
+
"@langchain/openai": "1.2.0-dev-1765432861398",
|
|
232
232
|
"@langchain/textsplitters": "1.0.1"
|
|
233
233
|
},
|
|
234
234
|
"optionalDependencies": {
|