langchain 0.2.0 → 0.2.1
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/README.md +7 -7
- package/dist/agents/chat/index.cjs +1 -1
- package/dist/agents/chat/index.d.ts +1 -1
- package/dist/agents/chat/index.js +1 -1
- package/dist/agents/chat_convo/index.cjs +1 -1
- package/dist/agents/chat_convo/index.d.ts +1 -1
- package/dist/agents/chat_convo/index.js +1 -1
- package/dist/agents/mrkl/index.cjs +1 -1
- package/dist/agents/mrkl/index.d.ts +1 -1
- package/dist/agents/mrkl/index.js +1 -1
- package/dist/agents/openai_functions/index.cjs +1 -1
- package/dist/agents/openai_functions/index.d.ts +1 -1
- package/dist/agents/openai_functions/index.js +1 -1
- package/dist/agents/structured_chat/index.cjs +1 -1
- package/dist/agents/structured_chat/index.d.ts +1 -1
- package/dist/agents/structured_chat/index.js +1 -1
- package/dist/agents/xml/index.cjs +1 -1
- package/dist/agents/xml/index.d.ts +1 -1
- package/dist/agents/xml/index.js +1 -1
- package/dist/chains/load.cjs +1 -1
- package/dist/chains/load.d.ts +1 -1
- package/dist/chains/load.js +1 -1
- package/dist/chains/openai_functions/structured_output.cjs +2 -2
- package/dist/chains/openai_functions/structured_output.d.ts +2 -2
- package/dist/chains/openai_functions/structured_output.js +2 -2
- package/dist/chains/serde.d.ts +12 -12
- package/dist/document_loaders/web/browserbase.cjs +7 -1
- package/dist/document_loaders/web/browserbase.d.ts +3 -4
- package/dist/document_loaders/web/browserbase.js +7 -1
- package/dist/load/import_map.cjs +2 -11
- package/dist/load/import_map.d.ts +0 -9
- package/dist/load/import_map.js +0 -9
- package/dist/smith/config.cjs +10 -2
- package/dist/smith/config.d.ts +37 -5
- package/dist/smith/config.js +10 -2
- package/package.json +3 -16
- package/prompts/index.cjs +0 -1
- package/prompts/index.d.cts +0 -1
- package/prompts/index.d.ts +0 -1
- package/prompts/index.js +0 -1
- package/prompts/load.cjs +0 -1
- package/prompts/load.d.cts +0 -1
- package/prompts/load.d.ts +0 -1
- package/prompts/load.js +0 -1
package/README.md
CHANGED
|
@@ -63,8 +63,8 @@ This library aims to assist in the development of those types of applications. C
|
|
|
63
63
|
|
|
64
64
|
**💬 Chatbots**
|
|
65
65
|
|
|
66
|
-
- [Documentation](https://js.langchain.com/docs/
|
|
67
|
-
- End-to-end Example: [Chat-LangChain](https://github.com/langchain-ai/chat-
|
|
66
|
+
- [Documentation](https://js.langchain.com/v0.2/docs/how_to/#chatbots)
|
|
67
|
+
- End-to-end Example: [Chat-LangChain](https://github.com/langchain-ai/chat-langchainjs)
|
|
68
68
|
|
|
69
69
|
## 🚀 How does LangChain help?
|
|
70
70
|
|
|
@@ -90,12 +90,12 @@ Agents involve an LLM making decisions about which Actions to take, taking that
|
|
|
90
90
|
|
|
91
91
|
## 📖 Documentation
|
|
92
92
|
|
|
93
|
-
Please see [here](https://js.langchain.com) for full documentation, which includes:
|
|
93
|
+
Please see [here](https://js.langchain.com/v0.2/) for full documentation, which includes:
|
|
94
94
|
|
|
95
|
-
- [Getting started](https://js.langchain.com/docs/
|
|
96
|
-
-
|
|
97
|
-
- [Use case](https://js.langchain.com/docs/
|
|
98
|
-
- [Reference](https://api.js.langchain.com): full API docs
|
|
95
|
+
- [Getting started](https://js.langchain.com/v0.2/docs/introduction): installation, setting up the environment, simple examples
|
|
96
|
+
- [Tutorials](https://js.langchain.com/v0.2/docs/tutorials/): interactive guides and walkthroughs of common use cases/tasks.
|
|
97
|
+
- [Use case](https://js.langchain.com/v0.2/docs/how_to/) walkthroughs and best practices for every component of the LangChain library.
|
|
98
|
+
- [Reference](https://v02.api.js.langchain.com): full API docs
|
|
99
99
|
|
|
100
100
|
## 💁 Contributing
|
|
101
101
|
|
|
@@ -11,7 +11,7 @@ const DEFAULT_HUMAN_MESSAGE_TEMPLATE = "{input}\n\n{agent_scratchpad}";
|
|
|
11
11
|
* Agent for the MRKL chain.
|
|
12
12
|
* @augments Agent
|
|
13
13
|
*
|
|
14
|
-
* @deprecated Use the {@link https://api.js.langchain.com/functions/langchain_agents.createStructuredChatAgent.html | createStructuredChatAgent method instead}.
|
|
14
|
+
* @deprecated Use the {@link https://v02.api.js.langchain.com/functions/langchain_agents.createStructuredChatAgent.html | createStructuredChatAgent method instead}.
|
|
15
15
|
*/
|
|
16
16
|
class ChatAgent extends agent_js_1.Agent {
|
|
17
17
|
static lc_name() {
|
|
@@ -33,7 +33,7 @@ export type ChatAgentInput = Optional<AgentInput, "outputParser">;
|
|
|
33
33
|
* Agent for the MRKL chain.
|
|
34
34
|
* @augments Agent
|
|
35
35
|
*
|
|
36
|
-
* @deprecated Use the {@link https://api.js.langchain.com/functions/langchain_agents.createStructuredChatAgent.html | createStructuredChatAgent method instead}.
|
|
36
|
+
* @deprecated Use the {@link https://v02.api.js.langchain.com/functions/langchain_agents.createStructuredChatAgent.html | createStructuredChatAgent method instead}.
|
|
37
37
|
*/
|
|
38
38
|
export declare class ChatAgent extends Agent {
|
|
39
39
|
static lc_name(): string;
|
|
@@ -8,7 +8,7 @@ const DEFAULT_HUMAN_MESSAGE_TEMPLATE = "{input}\n\n{agent_scratchpad}";
|
|
|
8
8
|
* Agent for the MRKL chain.
|
|
9
9
|
* @augments Agent
|
|
10
10
|
*
|
|
11
|
-
* @deprecated Use the {@link https://api.js.langchain.com/functions/langchain_agents.createStructuredChatAgent.html | createStructuredChatAgent method instead}.
|
|
11
|
+
* @deprecated Use the {@link https://v02.api.js.langchain.com/functions/langchain_agents.createStructuredChatAgent.html | createStructuredChatAgent method instead}.
|
|
12
12
|
*/
|
|
13
13
|
export class ChatAgent extends Agent {
|
|
14
14
|
static lc_name() {
|
|
@@ -11,7 +11,7 @@ const prompt_js_1 = require("./prompt.cjs");
|
|
|
11
11
|
* Agent for the MRKL chain.
|
|
12
12
|
* @augments Agent
|
|
13
13
|
*
|
|
14
|
-
* @deprecated Use the {@link https://api.js.langchain.com/functions/langchain_agents.createStructuredChatAgent.html | createStructuredChatAgent method instead}.
|
|
14
|
+
* @deprecated Use the {@link https://v02.api.js.langchain.com/functions/langchain_agents.createStructuredChatAgent.html | createStructuredChatAgent method instead}.
|
|
15
15
|
*/
|
|
16
16
|
class ChatConversationalAgent extends agent_js_1.Agent {
|
|
17
17
|
static lc_name() {
|
|
@@ -30,7 +30,7 @@ export type ChatConversationalAgentInput = Optional<AgentInput, "outputParser">;
|
|
|
30
30
|
* Agent for the MRKL chain.
|
|
31
31
|
* @augments Agent
|
|
32
32
|
*
|
|
33
|
-
* @deprecated Use the {@link https://api.js.langchain.com/functions/langchain_agents.createStructuredChatAgent.html | createStructuredChatAgent method instead}.
|
|
33
|
+
* @deprecated Use the {@link https://v02.api.js.langchain.com/functions/langchain_agents.createStructuredChatAgent.html | createStructuredChatAgent method instead}.
|
|
34
34
|
*/
|
|
35
35
|
export declare class ChatConversationalAgent extends Agent {
|
|
36
36
|
static lc_name(): string;
|
|
@@ -8,7 +8,7 @@ import { PREFIX_END, DEFAULT_PREFIX, DEFAULT_SUFFIX, TEMPLATE_TOOL_RESPONSE, } f
|
|
|
8
8
|
* Agent for the MRKL chain.
|
|
9
9
|
* @augments Agent
|
|
10
10
|
*
|
|
11
|
-
* @deprecated Use the {@link https://api.js.langchain.com/functions/langchain_agents.createStructuredChatAgent.html | createStructuredChatAgent method instead}.
|
|
11
|
+
* @deprecated Use the {@link https://v02.api.js.langchain.com/functions/langchain_agents.createStructuredChatAgent.html | createStructuredChatAgent method instead}.
|
|
12
12
|
*/
|
|
13
13
|
export class ChatConversationalAgent extends Agent {
|
|
14
14
|
static lc_name() {
|
|
@@ -32,7 +32,7 @@ const prompt_js_1 = require("./prompt.cjs");
|
|
|
32
32
|
* });
|
|
33
33
|
* ```
|
|
34
34
|
*
|
|
35
|
-
* @deprecated Use the {@link https://api.js.langchain.com/functions/langchain_agents.createReactAgent.html | createReactAgent method instead}.
|
|
35
|
+
* @deprecated Use the {@link https://v02.api.js.langchain.com/functions/langchain_agents.createReactAgent.html | createReactAgent method instead}.
|
|
36
36
|
*/
|
|
37
37
|
class ZeroShotAgent extends agent_js_1.Agent {
|
|
38
38
|
static lc_name() {
|
|
@@ -46,7 +46,7 @@ export type ZeroShotAgentInput = Optional<AgentInput, "outputParser">;
|
|
|
46
46
|
* });
|
|
47
47
|
* ```
|
|
48
48
|
*
|
|
49
|
-
* @deprecated Use the {@link https://api.js.langchain.com/functions/langchain_agents.createReactAgent.html | createReactAgent method instead}.
|
|
49
|
+
* @deprecated Use the {@link https://v02.api.js.langchain.com/functions/langchain_agents.createReactAgent.html | createReactAgent method instead}.
|
|
50
50
|
*/
|
|
51
51
|
export declare class ZeroShotAgent extends Agent {
|
|
52
52
|
static lc_name(): string;
|
|
@@ -29,7 +29,7 @@ import { FORMAT_INSTRUCTIONS, PREFIX, SUFFIX } from "./prompt.js";
|
|
|
29
29
|
* });
|
|
30
30
|
* ```
|
|
31
31
|
*
|
|
32
|
-
* @deprecated Use the {@link https://api.js.langchain.com/functions/langchain_agents.createReactAgent.html | createReactAgent method instead}.
|
|
32
|
+
* @deprecated Use the {@link https://v02.api.js.langchain.com/functions/langchain_agents.createReactAgent.html | createReactAgent method instead}.
|
|
33
33
|
*/
|
|
34
34
|
export class ZeroShotAgent extends Agent {
|
|
35
35
|
static lc_name() {
|
|
@@ -35,7 +35,7 @@ exports._formatIntermediateSteps = _formatIntermediateSteps;
|
|
|
35
35
|
* extends the Agent class and provides additional functionality specific
|
|
36
36
|
* to the OpenAIAgent type.
|
|
37
37
|
*
|
|
38
|
-
* @deprecated Use the {@link https://api.js.langchain.com/functions/langchain_agents.createOpenAIFunctionsAgent.html | createOpenAIFunctionsAgent method instead}.
|
|
38
|
+
* @deprecated Use the {@link https://v02.api.js.langchain.com/functions/langchain_agents.createOpenAIFunctionsAgent.html | createOpenAIFunctionsAgent method instead}.
|
|
39
39
|
*/
|
|
40
40
|
class OpenAIAgent extends agent_js_1.Agent {
|
|
41
41
|
static lc_name() {
|
|
@@ -29,7 +29,7 @@ export interface OpenAIAgentCreatePromptArgs {
|
|
|
29
29
|
* extends the Agent class and provides additional functionality specific
|
|
30
30
|
* to the OpenAIAgent type.
|
|
31
31
|
*
|
|
32
|
-
* @deprecated Use the {@link https://api.js.langchain.com/functions/langchain_agents.createOpenAIFunctionsAgent.html | createOpenAIFunctionsAgent method instead}.
|
|
32
|
+
* @deprecated Use the {@link https://v02.api.js.langchain.com/functions/langchain_agents.createOpenAIFunctionsAgent.html | createOpenAIFunctionsAgent method instead}.
|
|
33
33
|
*/
|
|
34
34
|
export declare class OpenAIAgent extends Agent {
|
|
35
35
|
static lc_name(): string;
|
|
@@ -31,7 +31,7 @@ export function _formatIntermediateSteps(intermediateSteps) {
|
|
|
31
31
|
* extends the Agent class and provides additional functionality specific
|
|
32
32
|
* to the OpenAIAgent type.
|
|
33
33
|
*
|
|
34
|
-
* @deprecated Use the {@link https://api.js.langchain.com/functions/langchain_agents.createOpenAIFunctionsAgent.html | createOpenAIFunctionsAgent method instead}.
|
|
34
|
+
* @deprecated Use the {@link https://v02.api.js.langchain.com/functions/langchain_agents.createOpenAIFunctionsAgent.html | createOpenAIFunctionsAgent method instead}.
|
|
35
35
|
*/
|
|
36
36
|
export class OpenAIAgent extends Agent {
|
|
37
37
|
static lc_name() {
|
|
@@ -13,7 +13,7 @@ const log_js_1 = require("../format_scratchpad/log.cjs");
|
|
|
13
13
|
/**
|
|
14
14
|
* Agent that interoperates with Structured Tools using React logic.
|
|
15
15
|
* @augments Agent
|
|
16
|
-
* @deprecated Use the {@link https://api.js.langchain.com/functions/langchain_agents.createStructuredChatAgent.html | createStructuredChatAgent method instead}.
|
|
16
|
+
* @deprecated Use the {@link https://v02.api.js.langchain.com/functions/langchain_agents.createStructuredChatAgent.html | createStructuredChatAgent method instead}.
|
|
17
17
|
*/
|
|
18
18
|
class StructuredChatAgent extends agent_js_1.Agent {
|
|
19
19
|
static lc_name() {
|
|
@@ -31,7 +31,7 @@ export type StructuredChatAgentInput = Optional<AgentInput, "outputParser">;
|
|
|
31
31
|
/**
|
|
32
32
|
* Agent that interoperates with Structured Tools using React logic.
|
|
33
33
|
* @augments Agent
|
|
34
|
-
* @deprecated Use the {@link https://api.js.langchain.com/functions/langchain_agents.createStructuredChatAgent.html | createStructuredChatAgent method instead}.
|
|
34
|
+
* @deprecated Use the {@link https://v02.api.js.langchain.com/functions/langchain_agents.createStructuredChatAgent.html | createStructuredChatAgent method instead}.
|
|
35
35
|
*/
|
|
36
36
|
export declare class StructuredChatAgent extends Agent {
|
|
37
37
|
static lc_name(): string;
|
|
@@ -10,7 +10,7 @@ import { formatLogToString } from "../format_scratchpad/log.js";
|
|
|
10
10
|
/**
|
|
11
11
|
* Agent that interoperates with Structured Tools using React logic.
|
|
12
12
|
* @augments Agent
|
|
13
|
-
* @deprecated Use the {@link https://api.js.langchain.com/functions/langchain_agents.createStructuredChatAgent.html | createStructuredChatAgent method instead}.
|
|
13
|
+
* @deprecated Use the {@link https://v02.api.js.langchain.com/functions/langchain_agents.createStructuredChatAgent.html | createStructuredChatAgent method instead}.
|
|
14
14
|
*/
|
|
15
15
|
export class StructuredChatAgent extends Agent {
|
|
16
16
|
static lc_name() {
|
|
@@ -12,7 +12,7 @@ const xml_js_1 = require("../format_scratchpad/xml.cjs");
|
|
|
12
12
|
/**
|
|
13
13
|
* Class that represents an agent that uses XML tags.
|
|
14
14
|
*
|
|
15
|
-
* @deprecated Use the {@link https://api.js.langchain.com/functions/langchain_agents.createXmlAgent.html | createXmlAgent method instead}.
|
|
15
|
+
* @deprecated Use the {@link https://v02.api.js.langchain.com/functions/langchain_agents.createXmlAgent.html | createXmlAgent method instead}.
|
|
16
16
|
*/
|
|
17
17
|
class XMLAgent extends agent_js_1.BaseSingleActionAgent {
|
|
18
18
|
static lc_name() {
|
|
@@ -18,7 +18,7 @@ export interface XMLAgentInput {
|
|
|
18
18
|
/**
|
|
19
19
|
* Class that represents an agent that uses XML tags.
|
|
20
20
|
*
|
|
21
|
-
* @deprecated Use the {@link https://api.js.langchain.com/functions/langchain_agents.createXmlAgent.html | createXmlAgent method instead}.
|
|
21
|
+
* @deprecated Use the {@link https://v02.api.js.langchain.com/functions/langchain_agents.createXmlAgent.html | createXmlAgent method instead}.
|
|
22
22
|
*/
|
|
23
23
|
export declare class XMLAgent extends BaseSingleActionAgent implements XMLAgentInput {
|
|
24
24
|
static lc_name(): string;
|
package/dist/agents/xml/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { formatXml } from "../format_scratchpad/xml.js";
|
|
|
9
9
|
/**
|
|
10
10
|
* Class that represents an agent that uses XML tags.
|
|
11
11
|
*
|
|
12
|
-
* @deprecated Use the {@link https://api.js.langchain.com/functions/langchain_agents.createXmlAgent.html | createXmlAgent method instead}.
|
|
12
|
+
* @deprecated Use the {@link https://v02.api.js.langchain.com/functions/langchain_agents.createXmlAgent.html | createXmlAgent method instead}.
|
|
13
13
|
*/
|
|
14
14
|
export class XMLAgent extends BaseSingleActionAgent {
|
|
15
15
|
static lc_name() {
|
package/dist/chains/load.cjs
CHANGED
|
@@ -27,7 +27,7 @@ const loadChainFromFile = async (file, path, values = {}) => {
|
|
|
27
27
|
* const chain = await loadChain("/path/to/chain.json");
|
|
28
28
|
* ```
|
|
29
29
|
*
|
|
30
|
-
* @deprecated Use newer {@link https://api.js.langchain.com/functions/langchain_load.load.html | load method}.
|
|
30
|
+
* @deprecated Use newer {@link https://v02.api.js.langchain.com/functions/langchain_load.load.html | load method}.
|
|
31
31
|
*/
|
|
32
32
|
const loadChain = async (uri, values = {}) => {
|
|
33
33
|
const hubResult = await (0, hub_js_1.loadFromHub)(uri, loadChainFromFile, "chains", new Set(["json", "yaml"]), values);
|
package/dist/chains/load.d.ts
CHANGED
|
@@ -18,6 +18,6 @@ import { LoadValues } from "../util/load.js";
|
|
|
18
18
|
* const chain = await loadChain("/path/to/chain.json");
|
|
19
19
|
* ```
|
|
20
20
|
*
|
|
21
|
-
* @deprecated Use newer {@link https://api.js.langchain.com/functions/langchain_load.load.html | load method}.
|
|
21
|
+
* @deprecated Use newer {@link https://v02.api.js.langchain.com/functions/langchain_load.load.html | load method}.
|
|
22
22
|
*/
|
|
23
23
|
export declare const loadChain: (uri: string, values?: LoadValues) => Promise<BaseChain>;
|
package/dist/chains/load.js
CHANGED
|
@@ -24,7 +24,7 @@ const loadChainFromFile = async (file, path, values = {}) => {
|
|
|
24
24
|
* const chain = await loadChain("/path/to/chain.json");
|
|
25
25
|
* ```
|
|
26
26
|
*
|
|
27
|
-
* @deprecated Use newer {@link https://api.js.langchain.com/functions/langchain_load.load.html | load method}.
|
|
27
|
+
* @deprecated Use newer {@link https://v02.api.js.langchain.com/functions/langchain_load.load.html | load method}.
|
|
28
28
|
*/
|
|
29
29
|
export const loadChain = async (uri, values = {}) => {
|
|
30
30
|
const hubResult = await loadFromHub(uri, loadChainFromFile, "chains", new Set(["json", "yaml"]), values);
|
|
@@ -102,7 +102,7 @@ class FunctionCallStructuredOutputParser extends output_parsers_1.BaseLLMOutputP
|
|
|
102
102
|
}
|
|
103
103
|
exports.FunctionCallStructuredOutputParser = FunctionCallStructuredOutputParser;
|
|
104
104
|
/**
|
|
105
|
-
* @deprecated Use {@link https://api.js.langchain.com/functions/langchain_chains_openai_functions.createStructuredOutputRunnable.html | createStructuredOutputRunnable} instead
|
|
105
|
+
* @deprecated Use {@link https://v02.api.js.langchain.com/functions/langchain_chains_openai_functions.createStructuredOutputRunnable.html | createStructuredOutputRunnable} instead
|
|
106
106
|
* Create a chain that returns output matching a JSON Schema.
|
|
107
107
|
* @param input Object that includes all LLMChainInput fields except "outputParser"
|
|
108
108
|
* as well as an additional required "outputSchema" JSON Schema object.
|
|
@@ -138,7 +138,7 @@ function createStructuredOutputChain(input) {
|
|
|
138
138
|
});
|
|
139
139
|
}
|
|
140
140
|
exports.createStructuredOutputChain = createStructuredOutputChain;
|
|
141
|
-
/** @deprecated Use {@link https://api.js.langchain.com/functions/langchain_chains_openai_functions.createStructuredOutputRunnable.html | createStructuredOutputRunnable} instead */
|
|
141
|
+
/** @deprecated Use {@link https://v02.api.js.langchain.com/functions/langchain_chains_openai_functions.createStructuredOutputRunnable.html | createStructuredOutputRunnable} instead */
|
|
142
142
|
function createStructuredOutputChainFromZod(zodSchema, input) {
|
|
143
143
|
return createStructuredOutputChain({
|
|
144
144
|
...input,
|
|
@@ -49,12 +49,12 @@ export declare class FunctionCallStructuredOutputParser<T extends z.AnyZodObject
|
|
|
49
49
|
parseResult(generations: ChatGeneration[]): Promise<any>;
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
|
-
* @deprecated Use {@link https://api.js.langchain.com/functions/langchain_chains_openai_functions.createStructuredOutputRunnable.html | createStructuredOutputRunnable} instead
|
|
52
|
+
* @deprecated Use {@link https://v02.api.js.langchain.com/functions/langchain_chains_openai_functions.createStructuredOutputRunnable.html | createStructuredOutputRunnable} instead
|
|
53
53
|
* Create a chain that returns output matching a JSON Schema.
|
|
54
54
|
* @param input Object that includes all LLMChainInput fields except "outputParser"
|
|
55
55
|
* as well as an additional required "outputSchema" JSON Schema object.
|
|
56
56
|
* @returns OpenAPIChain
|
|
57
57
|
*/
|
|
58
58
|
export declare function createStructuredOutputChain<T extends z.AnyZodObject = z.AnyZodObject>(input: StructuredOutputChainInput<T>): LLMChain<any, BaseChatModel<BaseFunctionCallOptions, import("@langchain/core/messages").BaseMessageChunk> | ChatOpenAI<BaseFunctionCallOptions>>;
|
|
59
|
-
/** @deprecated Use {@link https://api.js.langchain.com/functions/langchain_chains_openai_functions.createStructuredOutputRunnable.html | createStructuredOutputRunnable} instead */
|
|
59
|
+
/** @deprecated Use {@link https://v02.api.js.langchain.com/functions/langchain_chains_openai_functions.createStructuredOutputRunnable.html | createStructuredOutputRunnable} instead */
|
|
60
60
|
export declare function createStructuredOutputChainFromZod<T extends z.AnyZodObject>(zodSchema: T, input: Omit<StructuredOutputChainInput<T>, "outputSchema">): LLMChain<any, BaseChatModel<BaseFunctionCallOptions, import("@langchain/core/messages").BaseMessageChunk> | ChatOpenAI<BaseFunctionCallOptions>>;
|
|
@@ -98,7 +98,7 @@ export class FunctionCallStructuredOutputParser extends BaseLLMOutputParser {
|
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
/**
|
|
101
|
-
* @deprecated Use {@link https://api.js.langchain.com/functions/langchain_chains_openai_functions.createStructuredOutputRunnable.html | createStructuredOutputRunnable} instead
|
|
101
|
+
* @deprecated Use {@link https://v02.api.js.langchain.com/functions/langchain_chains_openai_functions.createStructuredOutputRunnable.html | createStructuredOutputRunnable} instead
|
|
102
102
|
* Create a chain that returns output matching a JSON Schema.
|
|
103
103
|
* @param input Object that includes all LLMChainInput fields except "outputParser"
|
|
104
104
|
* as well as an additional required "outputSchema" JSON Schema object.
|
|
@@ -133,7 +133,7 @@ export function createStructuredOutputChain(input) {
|
|
|
133
133
|
...rest,
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
|
-
/** @deprecated Use {@link https://api.js.langchain.com/functions/langchain_chains_openai_functions.createStructuredOutputRunnable.html | createStructuredOutputRunnable} instead */
|
|
136
|
+
/** @deprecated Use {@link https://v02.api.js.langchain.com/functions/langchain_chains_openai_functions.createStructuredOutputRunnable.html | createStructuredOutputRunnable} instead */
|
|
137
137
|
export function createStructuredOutputChainFromZod(zodSchema, input) {
|
|
138
138
|
return createStructuredOutputChain({
|
|
139
139
|
...input,
|
package/dist/chains/serde.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { SerializedBasePromptTemplate } from "@langchain/core/prompts";
|
|
|
4
4
|
* Represents the serialized form of an LLMChain. It includes properties
|
|
5
5
|
* such as `_type`, `llm`, and `prompt`.
|
|
6
6
|
*
|
|
7
|
-
* @deprecated Use newer {@link https://api.js.langchain.com/functions/langchain_load.load.html | serialization methods}.
|
|
7
|
+
* @deprecated Use newer {@link https://v02.api.js.langchain.com/functions/langchain_load.load.html | serialization methods}.
|
|
8
8
|
*/
|
|
9
9
|
export type SerializedLLMChain = {
|
|
10
10
|
_type: "llm_chain";
|
|
@@ -16,7 +16,7 @@ export type SerializedLLMChain = {
|
|
|
16
16
|
* properties such as `_type`, `input_variables`, `output_variables`, and
|
|
17
17
|
* `chains`.
|
|
18
18
|
*
|
|
19
|
-
* @deprecated Use newer {@link https://api.js.langchain.com/functions/langchain_load.load.html | serialization methods}.
|
|
19
|
+
* @deprecated Use newer {@link https://v02.api.js.langchain.com/functions/langchain_load.load.html | serialization methods}.
|
|
20
20
|
*/
|
|
21
21
|
export type SerializedSequentialChain = {
|
|
22
22
|
_type: "sequential_chain";
|
|
@@ -28,7 +28,7 @@ export type SerializedSequentialChain = {
|
|
|
28
28
|
* Represents the serialized form of a SimpleSequentialChain. It includes
|
|
29
29
|
* properties such as `_type` and `chains`.
|
|
30
30
|
*
|
|
31
|
-
* @deprecated Use newer {@link https://api.js.langchain.com/functions/langchain_load.load.html | serialization methods}.
|
|
31
|
+
* @deprecated Use newer {@link https://v02.api.js.langchain.com/functions/langchain_load.load.html | serialization methods}.
|
|
32
32
|
*/
|
|
33
33
|
export type SerializedSimpleSequentialChain = {
|
|
34
34
|
_type: "simple_sequential_chain";
|
|
@@ -38,7 +38,7 @@ export type SerializedSimpleSequentialChain = {
|
|
|
38
38
|
* Represents the serialized form of a VectorDBQAChain. It includes
|
|
39
39
|
* properties such as `_type`, `k`, and `combine_documents_chain`.
|
|
40
40
|
*
|
|
41
|
-
* @deprecated Use newer {@link https://api.js.langchain.com/functions/langchain_load.load.html | serialization methods}.
|
|
41
|
+
* @deprecated Use newer {@link https://v02.api.js.langchain.com/functions/langchain_load.load.html | serialization methods}.
|
|
42
42
|
*/
|
|
43
43
|
export type SerializedVectorDBQAChain = {
|
|
44
44
|
_type: "vector_db_qa";
|
|
@@ -50,7 +50,7 @@ export type SerializedVectorDBQAChain = {
|
|
|
50
50
|
* such as `_type`, `api_request_chain`, `api_answer_chain`, and
|
|
51
51
|
* `api_docs`.
|
|
52
52
|
*
|
|
53
|
-
* @deprecated Use newer {@link https://api.js.langchain.com/functions/langchain_load.load.html | serialization methods}.
|
|
53
|
+
* @deprecated Use newer {@link https://v02.api.js.langchain.com/functions/langchain_load.load.html | serialization methods}.
|
|
54
54
|
*/
|
|
55
55
|
export type SerializedAPIChain = {
|
|
56
56
|
_type: "api_chain";
|
|
@@ -62,7 +62,7 @@ export type SerializedAPIChain = {
|
|
|
62
62
|
* Represents the serialized form of a StuffDocumentsChain. It includes
|
|
63
63
|
* properties such as `_type` and `llm_chain`.
|
|
64
64
|
*
|
|
65
|
-
* @deprecated Use newer {@link https://api.js.langchain.com/functions/langchain_load.load.html | serialization methods}.
|
|
65
|
+
* @deprecated Use newer {@link https://v02.api.js.langchain.com/functions/langchain_load.load.html | serialization methods}.
|
|
66
66
|
*/
|
|
67
67
|
export type SerializedStuffDocumentsChain = {
|
|
68
68
|
_type: "stuff_documents_chain";
|
|
@@ -73,7 +73,7 @@ export type SerializedStuffDocumentsChain = {
|
|
|
73
73
|
* properties such as `_type`, `k`, `combine_documents_chain`, and
|
|
74
74
|
* `question_generator`.
|
|
75
75
|
*
|
|
76
|
-
* @deprecated Use newer {@link https://api.js.langchain.com/functions/langchain_load.load.html | serialization methods}.
|
|
76
|
+
* @deprecated Use newer {@link https://v02.api.js.langchain.com/functions/langchain_load.load.html | serialization methods}.
|
|
77
77
|
*/
|
|
78
78
|
export type SerializedChatVectorDBQAChain = {
|
|
79
79
|
_type: "chat-vector-db";
|
|
@@ -86,7 +86,7 @@ export type SerializedChatVectorDBQAChain = {
|
|
|
86
86
|
* includes properties such as `_type`, `llm_chain`, and
|
|
87
87
|
* `combine_document_chain`.
|
|
88
88
|
*
|
|
89
|
-
* @deprecated Use newer {@link https://api.js.langchain.com/functions/langchain_load.load.html | serialization methods}.
|
|
89
|
+
* @deprecated Use newer {@link https://v02.api.js.langchain.com/functions/langchain_load.load.html | serialization methods}.
|
|
90
90
|
*/
|
|
91
91
|
export type SerializedMapReduceDocumentsChain = {
|
|
92
92
|
_type: "map_reduce_documents_chain";
|
|
@@ -97,7 +97,7 @@ export type SerializedMapReduceDocumentsChain = {
|
|
|
97
97
|
* Represents the serialized form of a RefineDocumentsChain. It includes
|
|
98
98
|
* properties such as `_type`, `llm_chain`, and `refine_llm_chain`.
|
|
99
99
|
*
|
|
100
|
-
* @deprecated Use newer {@link https://api.js.langchain.com/functions/langchain_load.load.html | serialization methods}.
|
|
100
|
+
* @deprecated Use newer {@link https://v02.api.js.langchain.com/functions/langchain_load.load.html | serialization methods}.
|
|
101
101
|
*/
|
|
102
102
|
export type SerializedRefineDocumentsChain = {
|
|
103
103
|
_type: "refine_documents_chain";
|
|
@@ -108,7 +108,7 @@ export type SerializedRefineDocumentsChain = {
|
|
|
108
108
|
* Represents the serialized form of an AnalyzeDocumentChain. It includes
|
|
109
109
|
* properties such as `_type` and `combine_document_chain`.
|
|
110
110
|
*
|
|
111
|
-
* @deprecated Use newer {@link https://api.js.langchain.com/functions/langchain_load.load.html | serialization methods}.
|
|
111
|
+
* @deprecated Use newer {@link https://v02.api.js.langchain.com/functions/langchain_load.load.html | serialization methods}.
|
|
112
112
|
*/
|
|
113
113
|
export type SerializedAnalyzeDocumentChain = {
|
|
114
114
|
_type: "analyze_document_chain";
|
|
@@ -119,7 +119,7 @@ export type SerializedAnalyzeDocumentChain = {
|
|
|
119
119
|
* includes properties such as `_type`, `critiqueRequest`,
|
|
120
120
|
* `revisionRequest`, and `name`.
|
|
121
121
|
*
|
|
122
|
-
* @deprecated Use newer {@link https://api.js.langchain.com/functions/langchain_load.load.html | serialization methods}.
|
|
122
|
+
* @deprecated Use newer {@link https://v02.api.js.langchain.com/functions/langchain_load.load.html | serialization methods}.
|
|
123
123
|
*/
|
|
124
124
|
export type SerializedConstitutionalPrinciple = {
|
|
125
125
|
_type: "constitutional_principle";
|
|
@@ -145,6 +145,6 @@ export type SerializedConstitutionalChain = {
|
|
|
145
145
|
* Represents the serialized form of a BaseChain. It can be one of the
|
|
146
146
|
* above serialized chain types.
|
|
147
147
|
*
|
|
148
|
-
* @deprecated Use newer {@link https://api.js.langchain.com/functions/langchain_load.load.html | serialization methods}.
|
|
148
|
+
* @deprecated Use newer {@link https://v02.api.js.langchain.com/functions/langchain_load.load.html | serialization methods}.
|
|
149
149
|
*/
|
|
150
150
|
export type SerializedBaseChain = SerializedLLMChain | SerializedSequentialChain | SerializedSimpleSequentialChain | SerializedVectorDBQAChain | SerializedAPIChain | SerializedStuffDocumentsChain | SerializedChatVectorDBQAChain | SerializedMapReduceDocumentsChain | SerializedAnalyzeDocumentChain | SerializedRefineDocumentsChain | SerializedConstitutionalChain;
|
|
@@ -7,7 +7,13 @@ exports.BrowserbaseLoader = void 0;
|
|
|
7
7
|
const documents_1 = require("@langchain/core/documents");
|
|
8
8
|
const sdk_1 = __importDefault(require("@browserbasehq/sdk"));
|
|
9
9
|
const base_js_1 = require("../base.cjs");
|
|
10
|
+
const entrypoint_deprecation_js_1 = require("../../util/entrypoint_deprecation.cjs");
|
|
11
|
+
/* #__PURE__ */ (0, entrypoint_deprecation_js_1.logVersion020MigrationWarning)({
|
|
12
|
+
oldEntrypointName: "document_loaders/web/browserbase",
|
|
13
|
+
newPackageName: "@langchain/community",
|
|
14
|
+
});
|
|
10
15
|
/**
|
|
16
|
+
* @deprecated Import from "@langchain/community/document_loaders/web/browserbase" instead. This entrypoint will be removed in 0.3.0.
|
|
11
17
|
* Load pre-rendered web pages using a headless browser hosted on Browserbase.
|
|
12
18
|
*
|
|
13
19
|
* Depends on `@browserbasehq/sdk` package.
|
|
@@ -51,7 +57,7 @@ class BrowserbaseLoader extends base_js_1.BaseDocumentLoader {
|
|
|
51
57
|
});
|
|
52
58
|
this.urls = urls;
|
|
53
59
|
this.options = options;
|
|
54
|
-
this.browserbase = new sdk_1.default(options
|
|
60
|
+
this.browserbase = new sdk_1.default(options);
|
|
55
61
|
}
|
|
56
62
|
/**
|
|
57
63
|
* Load pages from URLs.
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Document, type DocumentInterface } from "@langchain/core/documents";
|
|
2
|
-
import Browserbase, {
|
|
2
|
+
import Browserbase, { LoadOptions, ClientOptions } from "@browserbasehq/sdk";
|
|
3
3
|
import { BaseDocumentLoader } from "../base.js";
|
|
4
4
|
import type { DocumentLoader } from "../base.js";
|
|
5
|
-
|
|
6
|
-
apiKey?: string;
|
|
7
|
-
}
|
|
5
|
+
type BrowserbaseLoaderOptions = ClientOptions & LoadOptions;
|
|
8
6
|
/**
|
|
7
|
+
* @deprecated Import from "@langchain/community/document_loaders/web/browserbase" instead. This entrypoint will be removed in 0.3.0.
|
|
9
8
|
* Load pre-rendered web pages using a headless browser hosted on Browserbase.
|
|
10
9
|
*
|
|
11
10
|
* Depends on `@browserbasehq/sdk` package.
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { Document } from "@langchain/core/documents";
|
|
2
2
|
import Browserbase from "@browserbasehq/sdk";
|
|
3
3
|
import { BaseDocumentLoader } from "../base.js";
|
|
4
|
+
import { logVersion020MigrationWarning } from "../../util/entrypoint_deprecation.js";
|
|
5
|
+
/* #__PURE__ */ logVersion020MigrationWarning({
|
|
6
|
+
oldEntrypointName: "document_loaders/web/browserbase",
|
|
7
|
+
newPackageName: "@langchain/community",
|
|
8
|
+
});
|
|
4
9
|
/**
|
|
10
|
+
* @deprecated Import from "@langchain/community/document_loaders/web/browserbase" instead. This entrypoint will be removed in 0.3.0.
|
|
5
11
|
* Load pre-rendered web pages using a headless browser hosted on Browserbase.
|
|
6
12
|
*
|
|
7
13
|
* Depends on `@browserbasehq/sdk` package.
|
|
@@ -45,7 +51,7 @@ export class BrowserbaseLoader extends BaseDocumentLoader {
|
|
|
45
51
|
});
|
|
46
52
|
this.urls = urls;
|
|
47
53
|
this.options = options;
|
|
48
|
-
this.browserbase = new Browserbase(options
|
|
54
|
+
this.browserbase = new Browserbase(options);
|
|
49
55
|
}
|
|
50
56
|
/**
|
|
51
57
|
* Load pages from URLs.
|
package/dist/load/import_map.cjs
CHANGED
|
@@ -24,8 +24,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
return result;
|
|
25
25
|
};
|
|
26
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.
|
|
28
|
-
exports.schema__output = exports.schema__output_parser = exports.schema__runnable = exports.prompts__base = exports.prompts__pipeline = exports.prompts__image = exports.prompts__chat = exports.schema = exports.schema__messages = exports.prompts__prompt = exports.embeddings__openai = exports.llms__openai = exports.chat_models__openai = exports.schema__prompt_template = exports.schema__query_constructor = exports.indexes = exports.runnables__remote = exports.smith = exports.evaluation = exports.experimental__prompts__custom_format = exports.experimental__masking = exports.experimental__chains__violation_of_expectations = exports.experimental__plan_and_execute = exports.experimental__generative_agents = exports.experimental__babyagi = exports.experimental__openai_files = exports.experimental__openai_assistant = exports.experimental__autogpt =
|
|
27
|
+
exports.util__time = exports.util__math = exports.util__document = exports.storage__in_memory = exports.storage__encoder_backed = exports.stores__message__in_memory = exports.stores__file__in_memory = exports.stores__doc__in_memory = exports.stores__doc__base = exports.retrievers__matryoshka_retriever = exports.retrievers__score_threshold = exports.retrievers__hyde = exports.retrievers__document_compressors__embeddings_filter = exports.retrievers__document_compressors__chain_extract = exports.retrievers__time_weighted = exports.retrievers__parent_document = exports.retrievers__multi_vector = exports.retrievers__multi_query = exports.retrievers__document_compressors = exports.retrievers__contextual_compression = exports.output_parsers = exports.callbacks = exports.document_transformers__openai_functions = exports.document_loaders__base = exports.memory__chat_memory = exports.memory__index = exports.text_splitter = exports.vectorstores__memory = exports.embeddings__fake = exports.embeddings__cache_backed = exports.chains__retrieval = exports.chains__openai_functions = exports.chains__history_aware_retriever = exports.chains__combine_documents__reduce = exports.chains__combine_documents = exports.chains = exports.tools__retriever = exports.tools__render = exports.tools__chain = exports.tools = exports.agents__openai__output_parser = exports.agents__xml__output_parser = exports.agents__react__output_parser = exports.agents__format_scratchpad__log_to_message = exports.agents__format_scratchpad__xml = exports.agents__format_scratchpad__log = exports.agents__format_scratchpad__openai_tools = exports.agents__format_scratchpad = exports.agents__toolkits = exports.agents = void 0;
|
|
28
|
+
exports.schema__output = exports.schema__output_parser = exports.schema__runnable = exports.prompts__base = exports.prompts__pipeline = exports.prompts__image = exports.prompts__chat = exports.schema = exports.schema__messages = exports.prompts__prompt = exports.embeddings__openai = exports.llms__openai = exports.chat_models__openai = exports.schema__prompt_template = exports.schema__query_constructor = exports.indexes = exports.runnables__remote = exports.smith = exports.evaluation = exports.experimental__prompts__custom_format = exports.experimental__masking = exports.experimental__chains__violation_of_expectations = exports.experimental__plan_and_execute = exports.experimental__generative_agents = exports.experimental__babyagi = exports.experimental__openai_files = exports.experimental__openai_assistant = exports.experimental__autogpt = void 0;
|
|
29
29
|
exports.agents = __importStar(require("../agents/index.cjs"));
|
|
30
30
|
exports.agents__toolkits = __importStar(require("../agents/toolkits/index.cjs"));
|
|
31
31
|
exports.agents__format_scratchpad = __importStar(require("../agents/format_scratchpad/openai_functions.cjs"));
|
|
@@ -48,15 +48,11 @@ exports.chains__openai_functions = __importStar(require("../chains/openai_functi
|
|
|
48
48
|
exports.chains__retrieval = __importStar(require("../chains/retrieval.cjs"));
|
|
49
49
|
exports.embeddings__cache_backed = __importStar(require("../embeddings/cache_backed.cjs"));
|
|
50
50
|
exports.embeddings__fake = __importStar(require("../embeddings/fake.cjs"));
|
|
51
|
-
exports.prompts__index = __importStar(require("../prompts/index.cjs"));
|
|
52
51
|
exports.vectorstores__memory = __importStar(require("../vectorstores/memory.cjs"));
|
|
53
52
|
exports.text_splitter = __importStar(require("../text_splitter.cjs"));
|
|
54
53
|
exports.memory__index = __importStar(require("../memory/index.cjs"));
|
|
55
54
|
exports.memory__chat_memory = __importStar(require("../memory/chat_memory.cjs"));
|
|
56
55
|
exports.document_loaders__base = __importStar(require("../document_loaders/base.cjs"));
|
|
57
|
-
exports.document_loaders__web__searchapi = __importStar(require("../document_loaders/web/searchapi.cjs"));
|
|
58
|
-
exports.document_loaders__web__serpapi = __importStar(require("../document_loaders/web/serpapi.cjs"));
|
|
59
|
-
exports.document_loaders__web__sort_xyz_blockchain = __importStar(require("../document_loaders/web/sort_xyz_blockchain.cjs"));
|
|
60
56
|
exports.document_transformers__openai_functions = __importStar(require("../document_transformers/openai_functions.cjs"));
|
|
61
57
|
exports.callbacks = __importStar(require("../callbacks/index.cjs"));
|
|
62
58
|
exports.output_parsers = __importStar(require("../output_parsers/index.cjs"));
|
|
@@ -70,11 +66,6 @@ exports.retrievers__document_compressors__chain_extract = __importStar(require("
|
|
|
70
66
|
exports.retrievers__document_compressors__embeddings_filter = __importStar(require("../retrievers/document_compressors/embeddings_filter.cjs"));
|
|
71
67
|
exports.retrievers__hyde = __importStar(require("../retrievers/hyde.cjs"));
|
|
72
68
|
exports.retrievers__score_threshold = __importStar(require("../retrievers/score_threshold.cjs"));
|
|
73
|
-
exports.retrievers__self_query__chroma = __importStar(require("../retrievers/self_query/chroma.cjs"));
|
|
74
|
-
exports.retrievers__self_query__pinecone = __importStar(require("../retrievers/self_query/pinecone.cjs"));
|
|
75
|
-
exports.retrievers__self_query__supabase = __importStar(require("../retrievers/self_query/supabase.cjs"));
|
|
76
|
-
exports.retrievers__self_query__weaviate = __importStar(require("../retrievers/self_query/weaviate.cjs"));
|
|
77
|
-
exports.retrievers__self_query__vectara = __importStar(require("../retrievers/self_query/vectara.cjs"));
|
|
78
69
|
exports.retrievers__matryoshka_retriever = __importStar(require("../retrievers/matryoshka_retriever.cjs"));
|
|
79
70
|
exports.stores__doc__base = __importStar(require("../stores/doc/base.cjs"));
|
|
80
71
|
exports.stores__doc__in_memory = __importStar(require("../stores/doc/in_memory.cjs"));
|
|
@@ -20,15 +20,11 @@ export * as chains__openai_functions from "../chains/openai_functions/index.js";
|
|
|
20
20
|
export * as chains__retrieval from "../chains/retrieval.js";
|
|
21
21
|
export * as embeddings__cache_backed from "../embeddings/cache_backed.js";
|
|
22
22
|
export * as embeddings__fake from "../embeddings/fake.js";
|
|
23
|
-
export * as prompts__index from "../prompts/index.js";
|
|
24
23
|
export * as vectorstores__memory from "../vectorstores/memory.js";
|
|
25
24
|
export * as text_splitter from "../text_splitter.js";
|
|
26
25
|
export * as memory__index from "../memory/index.js";
|
|
27
26
|
export * as memory__chat_memory from "../memory/chat_memory.js";
|
|
28
27
|
export * as document_loaders__base from "../document_loaders/base.js";
|
|
29
|
-
export * as document_loaders__web__searchapi from "../document_loaders/web/searchapi.js";
|
|
30
|
-
export * as document_loaders__web__serpapi from "../document_loaders/web/serpapi.js";
|
|
31
|
-
export * as document_loaders__web__sort_xyz_blockchain from "../document_loaders/web/sort_xyz_blockchain.js";
|
|
32
28
|
export * as document_transformers__openai_functions from "../document_transformers/openai_functions.js";
|
|
33
29
|
export * as callbacks from "../callbacks/index.js";
|
|
34
30
|
export * as output_parsers from "../output_parsers/index.js";
|
|
@@ -42,11 +38,6 @@ export * as retrievers__document_compressors__chain_extract from "../retrievers/
|
|
|
42
38
|
export * as retrievers__document_compressors__embeddings_filter from "../retrievers/document_compressors/embeddings_filter.js";
|
|
43
39
|
export * as retrievers__hyde from "../retrievers/hyde.js";
|
|
44
40
|
export * as retrievers__score_threshold from "../retrievers/score_threshold.js";
|
|
45
|
-
export * as retrievers__self_query__chroma from "../retrievers/self_query/chroma.js";
|
|
46
|
-
export * as retrievers__self_query__pinecone from "../retrievers/self_query/pinecone.js";
|
|
47
|
-
export * as retrievers__self_query__supabase from "../retrievers/self_query/supabase.js";
|
|
48
|
-
export * as retrievers__self_query__weaviate from "../retrievers/self_query/weaviate.js";
|
|
49
|
-
export * as retrievers__self_query__vectara from "../retrievers/self_query/vectara.js";
|
|
50
41
|
export * as retrievers__matryoshka_retriever from "../retrievers/matryoshka_retriever.js";
|
|
51
42
|
export * as stores__doc__base from "../stores/doc/base.js";
|
|
52
43
|
export * as stores__doc__in_memory from "../stores/doc/in_memory.js";
|
package/dist/load/import_map.js
CHANGED
|
@@ -21,15 +21,11 @@ export * as chains__openai_functions from "../chains/openai_functions/index.js";
|
|
|
21
21
|
export * as chains__retrieval from "../chains/retrieval.js";
|
|
22
22
|
export * as embeddings__cache_backed from "../embeddings/cache_backed.js";
|
|
23
23
|
export * as embeddings__fake from "../embeddings/fake.js";
|
|
24
|
-
export * as prompts__index from "../prompts/index.js";
|
|
25
24
|
export * as vectorstores__memory from "../vectorstores/memory.js";
|
|
26
25
|
export * as text_splitter from "../text_splitter.js";
|
|
27
26
|
export * as memory__index from "../memory/index.js";
|
|
28
27
|
export * as memory__chat_memory from "../memory/chat_memory.js";
|
|
29
28
|
export * as document_loaders__base from "../document_loaders/base.js";
|
|
30
|
-
export * as document_loaders__web__searchapi from "../document_loaders/web/searchapi.js";
|
|
31
|
-
export * as document_loaders__web__serpapi from "../document_loaders/web/serpapi.js";
|
|
32
|
-
export * as document_loaders__web__sort_xyz_blockchain from "../document_loaders/web/sort_xyz_blockchain.js";
|
|
33
29
|
export * as document_transformers__openai_functions from "../document_transformers/openai_functions.js";
|
|
34
30
|
export * as callbacks from "../callbacks/index.js";
|
|
35
31
|
export * as output_parsers from "../output_parsers/index.js";
|
|
@@ -43,11 +39,6 @@ export * as retrievers__document_compressors__chain_extract from "../retrievers/
|
|
|
43
39
|
export * as retrievers__document_compressors__embeddings_filter from "../retrievers/document_compressors/embeddings_filter.js";
|
|
44
40
|
export * as retrievers__hyde from "../retrievers/hyde.js";
|
|
45
41
|
export * as retrievers__score_threshold from "../retrievers/score_threshold.js";
|
|
46
|
-
export * as retrievers__self_query__chroma from "../retrievers/self_query/chroma.js";
|
|
47
|
-
export * as retrievers__self_query__pinecone from "../retrievers/self_query/pinecone.js";
|
|
48
|
-
export * as retrievers__self_query__supabase from "../retrievers/self_query/supabase.js";
|
|
49
|
-
export * as retrievers__self_query__weaviate from "../retrievers/self_query/weaviate.js";
|
|
50
|
-
export * as retrievers__self_query__vectara from "../retrievers/self_query/vectara.js";
|
|
51
42
|
export * as retrievers__matryoshka_retriever from "../retrievers/matryoshka_retriever.js";
|
|
52
43
|
export * as stores__doc__base from "../stores/doc/base.js";
|
|
53
44
|
export * as stores__doc__in_memory from "../stores/doc/in_memory.js";
|
package/dist/smith/config.cjs
CHANGED
|
@@ -32,10 +32,14 @@ function Criteria(criteria, config) {
|
|
|
32
32
|
prediction: getSingleStringifiedValue(payload.rawPrediction),
|
|
33
33
|
input: getSingleStringifiedValue(payload.rawInput),
|
|
34
34
|
}));
|
|
35
|
+
if (typeof criteria !== "string" && Object.keys(criteria).length !== 1) {
|
|
36
|
+
throw new Error("Only one criteria key is allowed when specifying custom criteria.");
|
|
37
|
+
}
|
|
38
|
+
const criteriaKey = typeof criteria === "string" ? criteria : Object.keys(criteria)[0];
|
|
35
39
|
return {
|
|
36
40
|
evaluatorType: "criteria",
|
|
37
41
|
criteria,
|
|
38
|
-
feedbackKey: config?.feedbackKey ??
|
|
42
|
+
feedbackKey: config?.feedbackKey ?? criteriaKey,
|
|
39
43
|
llm: config?.llm,
|
|
40
44
|
formatEvaluatorInputs,
|
|
41
45
|
};
|
|
@@ -48,10 +52,14 @@ function LabeledCriteria(criteria, config) {
|
|
|
48
52
|
input: getSingleStringifiedValue(payload.rawInput),
|
|
49
53
|
reference: getSingleStringifiedValue(payload.rawReferenceOutput),
|
|
50
54
|
}));
|
|
55
|
+
if (typeof criteria !== "string" && Object.keys(criteria).length !== 1) {
|
|
56
|
+
throw new Error("Only one labeled criteria key is allowed when specifying custom criteria.");
|
|
57
|
+
}
|
|
58
|
+
const criteriaKey = typeof criteria === "string" ? criteria : Object.keys(criteria)[0];
|
|
51
59
|
return {
|
|
52
60
|
evaluatorType: "labeled_criteria",
|
|
53
61
|
criteria,
|
|
54
|
-
feedbackKey: config?.feedbackKey ??
|
|
62
|
+
feedbackKey: config?.feedbackKey ?? criteriaKey,
|
|
55
63
|
llm: config?.llm,
|
|
56
64
|
formatEvaluatorInputs,
|
|
57
65
|
};
|
package/dist/smith/config.d.ts
CHANGED
|
@@ -133,9 +133,24 @@ export interface EvalConfig extends LoadEvaluatorOptions {
|
|
|
133
133
|
* @example
|
|
134
134
|
* ```ts
|
|
135
135
|
* const evalConfig = {
|
|
136
|
+
* evaluators: [Criteria("helpfulness")],
|
|
137
|
+
* };
|
|
138
|
+
* @example
|
|
139
|
+
* ```ts
|
|
140
|
+
* const evalConfig = {
|
|
141
|
+
* evaluators: [
|
|
142
|
+
* Criteria({
|
|
143
|
+
* "isCompliant": "Does the submission comply with the requirements of XYZ"
|
|
144
|
+
* })
|
|
145
|
+
* ],
|
|
146
|
+
* };
|
|
147
|
+
* @example
|
|
148
|
+
* ```ts
|
|
149
|
+
* const evalConfig = {
|
|
136
150
|
* evaluators: [{
|
|
137
151
|
* evaluatorType: "criteria",
|
|
138
152
|
* criteria: "helpfulness"
|
|
153
|
+
* formatEvaluatorInputs: ...
|
|
139
154
|
* }]
|
|
140
155
|
* };
|
|
141
156
|
* ```
|
|
@@ -144,7 +159,8 @@ export interface EvalConfig extends LoadEvaluatorOptions {
|
|
|
144
159
|
* const evalConfig = {
|
|
145
160
|
* evaluators: [{
|
|
146
161
|
* evaluatorType: "criteria",
|
|
147
|
-
* criteria: { "isCompliant": "Does the submission comply with the requirements of XYZ"
|
|
162
|
+
* criteria: { "isCompliant": "Does the submission comply with the requirements of XYZ" },
|
|
163
|
+
* formatEvaluatorInputs: ...
|
|
148
164
|
* }]
|
|
149
165
|
* };
|
|
150
166
|
*/
|
|
@@ -163,7 +179,7 @@ export type Criteria = EvalConfig & {
|
|
|
163
179
|
llm?: BaseLanguageModel;
|
|
164
180
|
};
|
|
165
181
|
export type CriteriaEvalChainConfig = Criteria;
|
|
166
|
-
export declare function Criteria(criteria: CriteriaType, config?: Pick<Partial<LabeledCriteria>, "formatEvaluatorInputs" | "llm" | "feedbackKey">): EvalConfig;
|
|
182
|
+
export declare function Criteria(criteria: CriteriaType | Record<string, string>, config?: Pick<Partial<LabeledCriteria>, "formatEvaluatorInputs" | "llm" | "feedbackKey">): EvalConfig;
|
|
167
183
|
/**
|
|
168
184
|
* Configuration to load a "LabeledCriteriaEvalChain" evaluator,
|
|
169
185
|
* which prompts an LLM to determine whether the model's
|
|
@@ -176,9 +192,24 @@ export declare function Criteria(criteria: CriteriaType, config?: Pick<Partial<L
|
|
|
176
192
|
* @example
|
|
177
193
|
* ```ts
|
|
178
194
|
* const evalConfig = {
|
|
195
|
+
* evaluators: [LabeledCriteria("correctness")],
|
|
196
|
+
* };
|
|
197
|
+
* @example
|
|
198
|
+
* ```ts
|
|
199
|
+
* const evalConfig = {
|
|
200
|
+
* evaluators: [
|
|
201
|
+
* LabeledCriteria({
|
|
202
|
+
* "mentionsAllFacts": "Does the include all facts provided in the reference?"
|
|
203
|
+
* })
|
|
204
|
+
* ],
|
|
205
|
+
* };
|
|
206
|
+
* @example
|
|
207
|
+
* ```ts
|
|
208
|
+
* const evalConfig = {
|
|
179
209
|
* evaluators: [{
|
|
180
210
|
* evaluatorType: "labeled_criteria",
|
|
181
|
-
* criteria: "correctness"
|
|
211
|
+
* criteria: "correctness",
|
|
212
|
+
* formatEvaluatorInputs: ...
|
|
182
213
|
* }],
|
|
183
214
|
* };
|
|
184
215
|
* ```
|
|
@@ -187,7 +218,8 @@ export declare function Criteria(criteria: CriteriaType, config?: Pick<Partial<L
|
|
|
187
218
|
* const evalConfig = {
|
|
188
219
|
* evaluators: [{
|
|
189
220
|
* evaluatorType: "labeled_criteria",
|
|
190
|
-
* criteria: { "mentionsAllFacts": "Does the include all facts provided in the reference?" }
|
|
221
|
+
* criteria: { "mentionsAllFacts": "Does the include all facts provided in the reference?" },
|
|
222
|
+
* formatEvaluatorInputs: ...
|
|
191
223
|
* }],
|
|
192
224
|
* };
|
|
193
225
|
*/
|
|
@@ -205,7 +237,7 @@ export type LabeledCriteria = EvalConfig & {
|
|
|
205
237
|
*/
|
|
206
238
|
llm?: BaseLanguageModel;
|
|
207
239
|
};
|
|
208
|
-
export declare function LabeledCriteria(criteria: CriteriaType, config?: Pick<Partial<LabeledCriteria>, "formatEvaluatorInputs" | "llm" | "feedbackKey">): LabeledCriteria;
|
|
240
|
+
export declare function LabeledCriteria(criteria: CriteriaType | Record<string, string>, config?: Pick<Partial<LabeledCriteria>, "formatEvaluatorInputs" | "llm" | "feedbackKey">): LabeledCriteria;
|
|
209
241
|
/**
|
|
210
242
|
* Configuration to load a "EmbeddingDistanceEvalChain" evaluator,
|
|
211
243
|
* which embeds distances to score semantic difference between
|
package/dist/smith/config.js
CHANGED
|
@@ -27,10 +27,14 @@ export function Criteria(criteria, config) {
|
|
|
27
27
|
prediction: getSingleStringifiedValue(payload.rawPrediction),
|
|
28
28
|
input: getSingleStringifiedValue(payload.rawInput),
|
|
29
29
|
}));
|
|
30
|
+
if (typeof criteria !== "string" && Object.keys(criteria).length !== 1) {
|
|
31
|
+
throw new Error("Only one criteria key is allowed when specifying custom criteria.");
|
|
32
|
+
}
|
|
33
|
+
const criteriaKey = typeof criteria === "string" ? criteria : Object.keys(criteria)[0];
|
|
30
34
|
return {
|
|
31
35
|
evaluatorType: "criteria",
|
|
32
36
|
criteria,
|
|
33
|
-
feedbackKey: config?.feedbackKey ??
|
|
37
|
+
feedbackKey: config?.feedbackKey ?? criteriaKey,
|
|
34
38
|
llm: config?.llm,
|
|
35
39
|
formatEvaluatorInputs,
|
|
36
40
|
};
|
|
@@ -42,10 +46,14 @@ export function LabeledCriteria(criteria, config) {
|
|
|
42
46
|
input: getSingleStringifiedValue(payload.rawInput),
|
|
43
47
|
reference: getSingleStringifiedValue(payload.rawReferenceOutput),
|
|
44
48
|
}));
|
|
49
|
+
if (typeof criteria !== "string" && Object.keys(criteria).length !== 1) {
|
|
50
|
+
throw new Error("Only one labeled criteria key is allowed when specifying custom criteria.");
|
|
51
|
+
}
|
|
52
|
+
const criteriaKey = typeof criteria === "string" ? criteria : Object.keys(criteria)[0];
|
|
45
53
|
return {
|
|
46
54
|
evaluatorType: "labeled_criteria",
|
|
47
55
|
criteria,
|
|
48
|
-
feedbackKey: config?.feedbackKey ??
|
|
56
|
+
feedbackKey: config?.feedbackKey ?? criteriaKey,
|
|
49
57
|
llm: config?.llm,
|
|
50
58
|
formatEvaluatorInputs,
|
|
51
59
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "langchain",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Typescript bindings for langchain",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -142,10 +142,6 @@
|
|
|
142
142
|
"embeddings/fake.js",
|
|
143
143
|
"embeddings/fake.d.ts",
|
|
144
144
|
"embeddings/fake.d.cts",
|
|
145
|
-
"prompts/index.cjs",
|
|
146
|
-
"prompts/index.js",
|
|
147
|
-
"prompts/index.d.ts",
|
|
148
|
-
"prompts/index.d.cts",
|
|
149
145
|
"vectorstores/memory.cjs",
|
|
150
146
|
"vectorstores/memory.js",
|
|
151
147
|
"vectorstores/memory.d.ts",
|
|
@@ -594,7 +590,7 @@
|
|
|
594
590
|
"@aws-sdk/credential-provider-node": "^3.388.0",
|
|
595
591
|
"@aws-sdk/types": "^3.357.0",
|
|
596
592
|
"@azure/storage-blob": "^12.15.0",
|
|
597
|
-
"@browserbasehq/sdk": "^1.
|
|
593
|
+
"@browserbasehq/sdk": "^1.1.5",
|
|
598
594
|
"@cloudflare/workers-types": "^4.20230922.0",
|
|
599
595
|
"@faker-js/faker": "^7.6.0",
|
|
600
596
|
"@gomomento/sdk": "^1.51.1",
|
|
@@ -602,7 +598,7 @@
|
|
|
602
598
|
"@google-ai/generativelanguage": "^0.2.1",
|
|
603
599
|
"@jest/globals": "^29.5.0",
|
|
604
600
|
"@langchain/cohere": "^0.0.8",
|
|
605
|
-
"@langchain/scripts": "~0.0",
|
|
601
|
+
"@langchain/scripts": "~0.0.14",
|
|
606
602
|
"@mendable/firecrawl-js": "^0.0.13",
|
|
607
603
|
"@notionhq/client": "^2.2.10",
|
|
608
604
|
"@pinecone-database/pinecone": "^1.1.0",
|
|
@@ -1216,15 +1212,6 @@
|
|
|
1216
1212
|
"import": "./embeddings/fake.js",
|
|
1217
1213
|
"require": "./embeddings/fake.cjs"
|
|
1218
1214
|
},
|
|
1219
|
-
"./prompts/index": {
|
|
1220
|
-
"types": {
|
|
1221
|
-
"import": "./prompts/index.d.ts",
|
|
1222
|
-
"require": "./prompts/index.d.cts",
|
|
1223
|
-
"default": "./prompts/index.d.ts"
|
|
1224
|
-
},
|
|
1225
|
-
"import": "./prompts/index.js",
|
|
1226
|
-
"require": "./prompts/index.cjs"
|
|
1227
|
-
},
|
|
1228
1215
|
"./vectorstores/memory": {
|
|
1229
1216
|
"types": {
|
|
1230
1217
|
"import": "./vectorstores/memory.d.ts",
|
package/prompts/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('../dist/prompts/index.cjs');
|
package/prompts/index.d.cts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../dist/prompts/index.js'
|
package/prompts/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../dist/prompts/index.js'
|
package/prompts/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../dist/prompts/index.js'
|
package/prompts/load.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('../dist/prompts/load.cjs');
|
package/prompts/load.d.cts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../dist/prompts/load.js'
|
package/prompts/load.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../dist/prompts/load.js'
|
package/prompts/load.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../dist/prompts/load.js'
|