@langchain/core 1.1.3 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/agents.d.cts +2 -0
- package/dist/agents.d.ts +2 -0
- package/dist/callbacks/base.d.cts +60 -22
- package/dist/callbacks/base.d.ts +60 -22
- package/dist/callbacks/dispatch/index.d.cts +3 -1
- package/dist/callbacks/dispatch/index.d.ts +3 -1
- package/dist/callbacks/dispatch/web.d.cts +3 -1
- package/dist/callbacks/dispatch/web.d.ts +3 -1
- package/dist/callbacks/manager.d.cts +12 -2
- package/dist/callbacks/manager.d.ts +12 -2
- package/dist/chat_history.d.cts +1 -0
- package/dist/chat_history.d.ts +1 -0
- package/dist/document_loaders/langsmith.d.cts +3 -0
- package/dist/document_loaders/langsmith.d.ts +3 -0
- package/dist/documents/document.d.cts +12 -3
- package/dist/documents/document.d.ts +12 -3
- package/dist/example_selectors/length_based.d.cts +1 -1
- package/dist/example_selectors/length_based.d.ts +1 -1
- package/dist/indexing/base.d.cts +1 -0
- package/dist/indexing/base.d.ts +1 -0
- package/dist/indexing/record_manager.d.cts +1 -0
- package/dist/indexing/record_manager.d.ts +1 -0
- package/dist/language_models/base.d.cts +38 -8
- package/dist/language_models/base.d.ts +38 -8
- package/dist/language_models/chat_models.d.cts +33 -6
- package/dist/language_models/chat_models.d.ts +33 -6
- package/dist/language_models/llms.d.cts +6 -0
- package/dist/language_models/llms.d.ts +6 -0
- package/dist/load/import_type.d.cts +1 -0
- package/dist/load/import_type.d.ts +1 -0
- package/dist/load/map_keys.cjs +5 -4
- package/dist/load/map_keys.cjs.map +1 -1
- package/dist/load/map_keys.d.cts +1 -0
- package/dist/load/map_keys.d.ts +1 -0
- package/dist/load/map_keys.js +3 -3
- package/dist/load/map_keys.js.map +1 -1
- package/dist/load/serializable.d.cts +1 -0
- package/dist/load/serializable.d.ts +1 -0
- package/dist/memory.d.cts +3 -0
- package/dist/memory.d.ts +3 -0
- package/dist/messages/base.d.cts +13 -1
- package/dist/messages/base.d.ts +13 -1
- package/dist/messages/content/data.d.cts +7 -2
- package/dist/messages/content/data.d.ts +7 -2
- package/dist/messages/content/index.d.cts +4 -1
- package/dist/messages/content/index.d.ts +4 -1
- package/dist/messages/content/multimodal.d.cts +1 -0
- package/dist/messages/content/multimodal.d.ts +1 -0
- package/dist/messages/content/tools.d.cts +1 -0
- package/dist/messages/content/tools.d.ts +1 -0
- package/dist/messages/tool.d.cts +9 -2
- package/dist/messages/tool.d.ts +9 -2
- package/dist/messages/transformers.d.cts +3 -0
- package/dist/messages/transformers.d.ts +3 -0
- package/dist/messages/utils.d.cts +5 -2
- package/dist/messages/utils.d.ts +5 -2
- package/dist/output_parsers/json.d.cts +5 -1
- package/dist/output_parsers/json.d.ts +5 -1
- package/dist/output_parsers/openai_functions/json_output_functions_parsers.d.cts +6 -2
- package/dist/output_parsers/openai_functions/json_output_functions_parsers.d.ts +6 -2
- package/dist/output_parsers/openai_tools/json_output_tools_parsers.d.cts +34 -10
- package/dist/output_parsers/openai_tools/json_output_tools_parsers.d.ts +34 -10
- package/dist/output_parsers/transform.d.cts +1 -0
- package/dist/output_parsers/transform.d.ts +1 -0
- package/dist/outputs.d.cts +6 -0
- package/dist/outputs.d.ts +6 -0
- package/dist/prompts/base.d.cts +10 -2
- package/dist/prompts/base.d.ts +10 -2
- package/dist/prompts/chat.d.cts +51 -13
- package/dist/prompts/chat.d.ts +51 -13
- package/dist/prompts/few_shot.d.cts +5 -1
- package/dist/prompts/few_shot.d.ts +5 -1
- package/dist/prompts/image.d.cts +10 -2
- package/dist/prompts/image.d.ts +10 -2
- package/dist/prompts/prompt.d.cts +15 -4
- package/dist/prompts/prompt.d.ts +16 -4
- package/dist/prompts/serde.d.cts +1 -0
- package/dist/prompts/serde.d.ts +1 -0
- package/dist/prompts/string.d.cts +5 -1
- package/dist/prompts/string.d.ts +5 -1
- package/dist/prompts/structured.d.cts +16 -3
- package/dist/prompts/structured.d.ts +16 -3
- package/dist/retrievers/document_compressors/index.d.cts +1 -0
- package/dist/retrievers/document_compressors/index.d.ts +1 -0
- package/dist/retrievers/index.d.cts +6 -2
- package/dist/retrievers/index.d.ts +6 -2
- package/dist/runnables/base.cjs +7 -7
- package/dist/runnables/base.cjs.map +1 -1
- package/dist/runnables/base.d.cts +64 -12
- package/dist/runnables/base.d.ts +64 -12
- package/dist/runnables/base.js +1 -1
- package/dist/runnables/base.js.map +1 -1
- package/dist/runnables/branch.d.cts +2 -0
- package/dist/runnables/branch.d.ts +2 -0
- package/dist/runnables/config.d.cts +1 -0
- package/dist/runnables/config.d.ts +1 -0
- package/dist/runnables/graph.d.cts +5 -1
- package/dist/runnables/graph.d.ts +5 -1
- package/dist/runnables/history.d.cts +12 -4
- package/dist/runnables/history.d.ts +12 -4
- package/dist/runnables/passthrough.d.cts +2 -0
- package/dist/runnables/passthrough.d.ts +2 -0
- package/dist/runnables/router.d.cts +1 -0
- package/dist/runnables/router.d.ts +1 -0
- package/dist/runnables/types.d.cts +9 -2
- package/dist/runnables/types.d.ts +9 -2
- package/dist/singletons/async_local_storage/context.d.cts +2 -0
- package/dist/singletons/async_local_storage/context.d.ts +2 -0
- package/dist/singletons/async_local_storage/globals.d.cts +1 -0
- package/dist/singletons/async_local_storage/globals.d.ts +1 -0
- package/dist/singletons/callbacks.cjs.map +1 -1
- package/dist/singletons/callbacks.js.map +1 -1
- package/dist/stores.d.cts +1 -0
- package/dist/stores.d.ts +1 -0
- package/dist/structured_query/utils.d.cts +4 -1
- package/dist/structured_query/utils.d.ts +4 -1
- package/dist/tools/index.d.cts +6 -1
- package/dist/tools/index.d.ts +6 -1
- package/dist/tools/types.d.cts +13 -3
- package/dist/tools/types.d.ts +13 -3
- package/dist/tracers/base.d.cts +20 -1
- package/dist/tracers/base.d.ts +20 -1
- package/dist/tracers/console.cjs +3 -3
- package/dist/tracers/console.cjs.map +1 -1
- package/dist/tracers/console.d.cts +2 -0
- package/dist/tracers/console.d.ts +2 -0
- package/dist/tracers/console.js +3 -3
- package/dist/tracers/console.js.map +1 -1
- package/dist/tracers/event_stream.d.cts +4 -0
- package/dist/tracers/event_stream.d.ts +4 -0
- package/dist/tracers/log_stream.d.cts +6 -0
- package/dist/tracers/log_stream.d.ts +6 -0
- package/dist/types/_internal.d.cts +3 -0
- package/dist/types/_internal.d.ts +3 -0
- package/dist/types/type-utils.d.cts +2 -0
- package/dist/types/type-utils.d.ts +2 -0
- package/dist/utils/async_caller.cjs +1 -1
- package/dist/utils/async_caller.cjs.map +1 -1
- package/dist/utils/async_caller.d.cts +3 -0
- package/dist/utils/async_caller.d.ts +3 -0
- package/dist/utils/async_caller.js +1 -1
- package/dist/utils/async_caller.js.map +1 -1
- package/dist/utils/env.d.cts +4 -0
- package/dist/utils/env.d.ts +4 -0
- package/dist/utils/event_source_parse.d.cts +4 -1
- package/dist/utils/event_source_parse.d.ts +4 -1
- package/dist/utils/function_calling.d.cts +3 -1
- package/dist/utils/function_calling.d.ts +3 -1
- package/dist/{node_modules/.pnpm/is-network-error@1.3.0/node_modules → utils}/is-network-error/index.cjs +1 -1
- package/dist/utils/is-network-error/index.cjs.map +1 -0
- package/dist/{node_modules/.pnpm/is-network-error@1.3.0/node_modules → utils}/is-network-error/index.js +1 -1
- package/dist/utils/is-network-error/index.js.map +1 -0
- package/dist/utils/json.d.cts +1 -0
- package/dist/utils/json.d.ts +1 -0
- package/dist/{node_modules/.pnpm/p-retry@7.1.0/node_modules → utils}/p-retry/index.cjs +2 -2
- package/dist/utils/p-retry/index.cjs.map +1 -0
- package/dist/{node_modules/.pnpm/p-retry@7.1.0/node_modules → utils}/p-retry/index.js +2 -2
- package/dist/utils/p-retry/index.js.map +1 -0
- package/dist/utils/stream.d.cts +13 -1
- package/dist/utils/stream.d.ts +13 -1
- package/dist/utils/testing/chat_models.d.cts +11 -3
- package/dist/utils/testing/chat_models.d.ts +11 -3
- package/dist/utils/testing/retrievers.d.cts +3 -1
- package/dist/utils/testing/retrievers.d.ts +3 -1
- package/dist/utils/testing/vectorstores.d.cts +1 -0
- package/dist/utils/testing/vectorstores.d.ts +1 -0
- package/dist/utils/types/index.d.cts +2 -0
- package/dist/utils/types/index.d.ts +2 -0
- package/dist/utils/types/zod.d.cts +3 -0
- package/dist/utils/types/zod.d.ts +3 -0
- package/dist/vectorstores.d.cts +17 -5
- package/dist/vectorstores.d.ts +17 -5
- package/package.json +5 -6
- package/dist/node_modules/.pnpm/ansi-styles@6.2.3/node_modules/ansi-styles/index.cjs +0 -169
- package/dist/node_modules/.pnpm/ansi-styles@6.2.3/node_modules/ansi-styles/index.cjs.map +0 -1
- package/dist/node_modules/.pnpm/ansi-styles@6.2.3/node_modules/ansi-styles/index.js +0 -168
- package/dist/node_modules/.pnpm/ansi-styles@6.2.3/node_modules/ansi-styles/index.js.map +0 -1
- package/dist/node_modules/.pnpm/camelcase@9.0.0/node_modules/camelcase/index.cjs +0 -122
- package/dist/node_modules/.pnpm/camelcase@9.0.0/node_modules/camelcase/index.cjs.map +0 -1
- package/dist/node_modules/.pnpm/camelcase@9.0.0/node_modules/camelcase/index.js +0 -121
- package/dist/node_modules/.pnpm/camelcase@9.0.0/node_modules/camelcase/index.js.map +0 -1
- package/dist/node_modules/.pnpm/decamelize@6.0.1/node_modules/decamelize/index.cjs +0 -18
- package/dist/node_modules/.pnpm/decamelize@6.0.1/node_modules/decamelize/index.cjs.map +0 -1
- package/dist/node_modules/.pnpm/decamelize@6.0.1/node_modules/decamelize/index.js +0 -17
- package/dist/node_modules/.pnpm/decamelize@6.0.1/node_modules/decamelize/index.js.map +0 -1
- package/dist/node_modules/.pnpm/is-network-error@1.3.0/node_modules/is-network-error/index.cjs.map +0 -1
- package/dist/node_modules/.pnpm/is-network-error@1.3.0/node_modules/is-network-error/index.js.map +0 -1
- package/dist/node_modules/.pnpm/p-retry@7.1.0/node_modules/p-retry/index.cjs.map +0 -1
- package/dist/node_modules/.pnpm/p-retry@7.1.0/node_modules/p-retry/index.js.map +0 -1
|
@@ -9,21 +9,28 @@ import * as z4 from "zod/v4/core";
|
|
|
9
9
|
type ParsedToolCall = {
|
|
10
10
|
id?: string;
|
|
11
11
|
type: string;
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
13
|
args: Record<string, any>;
|
|
13
14
|
};
|
|
14
15
|
type JsonOutputToolsParserParams = {
|
|
15
16
|
/** Whether to return the tool call id. */
|
|
16
17
|
returnId?: boolean;
|
|
17
18
|
} & BaseCumulativeTransformOutputParserInput;
|
|
18
|
-
declare function parseToolCall(
|
|
19
|
+
declare function parseToolCall(
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
|
+
rawToolCall: Record<string, any>, options: {
|
|
19
22
|
returnId?: boolean;
|
|
20
23
|
partial: true;
|
|
21
24
|
}): ToolCall | undefined;
|
|
22
|
-
declare function parseToolCall(
|
|
25
|
+
declare function parseToolCall(
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
|
+
rawToolCall: Record<string, any>, options?: {
|
|
23
28
|
returnId?: boolean;
|
|
24
29
|
partial?: false;
|
|
25
30
|
}): ToolCall;
|
|
26
|
-
declare function parseToolCall(
|
|
31
|
+
declare function parseToolCall(
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
33
|
+
rawToolCall: Record<string, any>, options?: {
|
|
27
34
|
returnId?: boolean;
|
|
28
35
|
partial?: boolean;
|
|
29
36
|
}): ToolCall | undefined;
|
|
@@ -35,7 +42,9 @@ declare function convertLangChainToolCallToOpenAI(toolCall: ToolCall): {
|
|
|
35
42
|
arguments: string;
|
|
36
43
|
};
|
|
37
44
|
};
|
|
38
|
-
declare function makeInvalidToolCall(
|
|
45
|
+
declare function makeInvalidToolCall(
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
47
|
+
rawToolCall: Record<string, any>, errorMsg?: string): InvalidToolCall;
|
|
39
48
|
/**
|
|
40
49
|
* Class for parsing the output of a tool-calling LLM into a JSON object.
|
|
41
50
|
*/
|
|
@@ -54,27 +63,40 @@ declare class JsonOutputToolsParser<T> extends BaseCumulativeTransformOutputPars
|
|
|
54
63
|
* @param generations The output of the LLM to parse.
|
|
55
64
|
* @returns A JSON object representation of the function call or its arguments.
|
|
56
65
|
*/
|
|
57
|
-
parsePartialResult(generations: ChatGenerationChunk[] | ChatGeneration[], partial?: boolean
|
|
66
|
+
parsePartialResult(generations: ChatGenerationChunk[] | ChatGeneration[], partial?: boolean
|
|
67
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
68
|
+
): Promise<any>;
|
|
58
69
|
}
|
|
59
70
|
type JsonOutputKeyToolsParserParamsBase = {
|
|
60
71
|
keyName: string;
|
|
61
72
|
returnSingle?: boolean;
|
|
62
73
|
} & JsonOutputToolsParserParams;
|
|
63
|
-
type JsonOutputKeyToolsParserParamsV3<
|
|
74
|
+
type JsonOutputKeyToolsParserParamsV3<
|
|
75
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
76
|
+
T extends Record<string, any> = Record<string, any>> = {
|
|
64
77
|
zodSchema?: z3.ZodType<T>;
|
|
65
78
|
} & JsonOutputKeyToolsParserParamsBase;
|
|
66
|
-
type JsonOutputKeyToolsParserParamsV4<
|
|
79
|
+
type JsonOutputKeyToolsParserParamsV4<
|
|
80
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
81
|
+
T extends Record<string, any> = Record<string, any>> = {
|
|
67
82
|
zodSchema?: z4.$ZodType<T, T>;
|
|
68
83
|
} & JsonOutputKeyToolsParserParamsBase;
|
|
69
|
-
type JsonOutputKeyToolsParserParamsInterop<
|
|
84
|
+
type JsonOutputKeyToolsParserParamsInterop<
|
|
85
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
86
|
+
T extends Record<string, any> = Record<string, any>> = {
|
|
70
87
|
zodSchema?: InteropZodType<T>;
|
|
71
88
|
} & JsonOutputKeyToolsParserParamsBase;
|
|
72
|
-
|
|
89
|
+
// Use Zod 3 for backwards compatibility
|
|
90
|
+
type JsonOutputKeyToolsParserParams<
|
|
91
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
92
|
+
T extends Record<string, any> = Record<string, any>> = JsonOutputKeyToolsParserParamsV3<T>;
|
|
73
93
|
/**
|
|
74
94
|
* Class for parsing the output of a tool-calling LLM into a JSON object if you are
|
|
75
95
|
* expecting only a single tool to be called.
|
|
76
96
|
*/
|
|
77
|
-
declare class JsonOutputKeyToolsParser<
|
|
97
|
+
declare class JsonOutputKeyToolsParser<
|
|
98
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
99
|
+
T extends Record<string, any> = Record<string, any>> extends JsonOutputToolsParser<T> {
|
|
78
100
|
static lc_name(): string;
|
|
79
101
|
lc_namespace: string[];
|
|
80
102
|
lc_serializable: boolean;
|
|
@@ -88,7 +110,9 @@ declare class JsonOutputKeyToolsParser<T extends Record<string, any> = Record<st
|
|
|
88
110
|
constructor(params: JsonOutputKeyToolsParserParamsV4<T>);
|
|
89
111
|
constructor(params: JsonOutputKeyToolsParserParamsInterop<T>);
|
|
90
112
|
protected _validateResult(result: unknown): Promise<T>;
|
|
113
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
91
114
|
parsePartialResult(generations: ChatGeneration[]): Promise<any>;
|
|
115
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
92
116
|
parseResult(generations: ChatGeneration[]): Promise<any>;
|
|
93
117
|
}
|
|
94
118
|
//#endregion
|
|
@@ -9,21 +9,28 @@ import * as z4 from "zod/v4/core";
|
|
|
9
9
|
type ParsedToolCall = {
|
|
10
10
|
id?: string;
|
|
11
11
|
type: string;
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
13
|
args: Record<string, any>;
|
|
13
14
|
};
|
|
14
15
|
type JsonOutputToolsParserParams = {
|
|
15
16
|
/** Whether to return the tool call id. */
|
|
16
17
|
returnId?: boolean;
|
|
17
18
|
} & BaseCumulativeTransformOutputParserInput;
|
|
18
|
-
declare function parseToolCall(
|
|
19
|
+
declare function parseToolCall(
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
|
+
rawToolCall: Record<string, any>, options: {
|
|
19
22
|
returnId?: boolean;
|
|
20
23
|
partial: true;
|
|
21
24
|
}): ToolCall | undefined;
|
|
22
|
-
declare function parseToolCall(
|
|
25
|
+
declare function parseToolCall(
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
|
+
rawToolCall: Record<string, any>, options?: {
|
|
23
28
|
returnId?: boolean;
|
|
24
29
|
partial?: false;
|
|
25
30
|
}): ToolCall;
|
|
26
|
-
declare function parseToolCall(
|
|
31
|
+
declare function parseToolCall(
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
33
|
+
rawToolCall: Record<string, any>, options?: {
|
|
27
34
|
returnId?: boolean;
|
|
28
35
|
partial?: boolean;
|
|
29
36
|
}): ToolCall | undefined;
|
|
@@ -35,7 +42,9 @@ declare function convertLangChainToolCallToOpenAI(toolCall: ToolCall): {
|
|
|
35
42
|
arguments: string;
|
|
36
43
|
};
|
|
37
44
|
};
|
|
38
|
-
declare function makeInvalidToolCall(
|
|
45
|
+
declare function makeInvalidToolCall(
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
47
|
+
rawToolCall: Record<string, any>, errorMsg?: string): InvalidToolCall;
|
|
39
48
|
/**
|
|
40
49
|
* Class for parsing the output of a tool-calling LLM into a JSON object.
|
|
41
50
|
*/
|
|
@@ -54,27 +63,40 @@ declare class JsonOutputToolsParser<T> extends BaseCumulativeTransformOutputPars
|
|
|
54
63
|
* @param generations The output of the LLM to parse.
|
|
55
64
|
* @returns A JSON object representation of the function call or its arguments.
|
|
56
65
|
*/
|
|
57
|
-
parsePartialResult(generations: ChatGenerationChunk[] | ChatGeneration[], partial?: boolean
|
|
66
|
+
parsePartialResult(generations: ChatGenerationChunk[] | ChatGeneration[], partial?: boolean
|
|
67
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
68
|
+
): Promise<any>;
|
|
58
69
|
}
|
|
59
70
|
type JsonOutputKeyToolsParserParamsBase = {
|
|
60
71
|
keyName: string;
|
|
61
72
|
returnSingle?: boolean;
|
|
62
73
|
} & JsonOutputToolsParserParams;
|
|
63
|
-
type JsonOutputKeyToolsParserParamsV3<
|
|
74
|
+
type JsonOutputKeyToolsParserParamsV3<
|
|
75
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
76
|
+
T extends Record<string, any> = Record<string, any>> = {
|
|
64
77
|
zodSchema?: z3.ZodType<T>;
|
|
65
78
|
} & JsonOutputKeyToolsParserParamsBase;
|
|
66
|
-
type JsonOutputKeyToolsParserParamsV4<
|
|
79
|
+
type JsonOutputKeyToolsParserParamsV4<
|
|
80
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
81
|
+
T extends Record<string, any> = Record<string, any>> = {
|
|
67
82
|
zodSchema?: z4.$ZodType<T, T>;
|
|
68
83
|
} & JsonOutputKeyToolsParserParamsBase;
|
|
69
|
-
type JsonOutputKeyToolsParserParamsInterop<
|
|
84
|
+
type JsonOutputKeyToolsParserParamsInterop<
|
|
85
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
86
|
+
T extends Record<string, any> = Record<string, any>> = {
|
|
70
87
|
zodSchema?: InteropZodType<T>;
|
|
71
88
|
} & JsonOutputKeyToolsParserParamsBase;
|
|
72
|
-
|
|
89
|
+
// Use Zod 3 for backwards compatibility
|
|
90
|
+
type JsonOutputKeyToolsParserParams<
|
|
91
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
92
|
+
T extends Record<string, any> = Record<string, any>> = JsonOutputKeyToolsParserParamsV3<T>;
|
|
73
93
|
/**
|
|
74
94
|
* Class for parsing the output of a tool-calling LLM into a JSON object if you are
|
|
75
95
|
* expecting only a single tool to be called.
|
|
76
96
|
*/
|
|
77
|
-
declare class JsonOutputKeyToolsParser<
|
|
97
|
+
declare class JsonOutputKeyToolsParser<
|
|
98
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
99
|
+
T extends Record<string, any> = Record<string, any>> extends JsonOutputToolsParser<T> {
|
|
78
100
|
static lc_name(): string;
|
|
79
101
|
lc_namespace: string[];
|
|
80
102
|
lc_serializable: boolean;
|
|
@@ -88,7 +110,9 @@ declare class JsonOutputKeyToolsParser<T extends Record<string, any> = Record<st
|
|
|
88
110
|
constructor(params: JsonOutputKeyToolsParserParamsV4<T>);
|
|
89
111
|
constructor(params: JsonOutputKeyToolsParserParamsInterop<T>);
|
|
90
112
|
protected _validateResult(result: unknown): Promise<T>;
|
|
113
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
91
114
|
parsePartialResult(generations: ChatGeneration[]): Promise<any>;
|
|
115
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
92
116
|
parseResult(generations: ChatGeneration[]): Promise<any>;
|
|
93
117
|
}
|
|
94
118
|
//#endregion
|
|
@@ -30,6 +30,7 @@ type BaseCumulativeTransformOutputParserInput = {
|
|
|
30
30
|
declare abstract class BaseCumulativeTransformOutputParser<T = unknown> extends BaseTransformOutputParser<T> {
|
|
31
31
|
protected diff: boolean;
|
|
32
32
|
constructor(fields?: BaseCumulativeTransformOutputParserInput);
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
33
34
|
protected abstract _diff(prev: any | undefined, next: any): any;
|
|
34
35
|
abstract parsePartialResult(generations: Generation[] | ChatGeneration[]): Promise<T | undefined>;
|
|
35
36
|
_transform(inputGenerator: AsyncGenerator<string | BaseMessage>): AsyncGenerator<T>;
|
|
@@ -30,6 +30,7 @@ type BaseCumulativeTransformOutputParserInput = {
|
|
|
30
30
|
declare abstract class BaseCumulativeTransformOutputParser<T = unknown> extends BaseTransformOutputParser<T> {
|
|
31
31
|
protected diff: boolean;
|
|
32
32
|
constructor(fields?: BaseCumulativeTransformOutputParserInput);
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
33
34
|
protected abstract _diff(prev: any | undefined, next: any): any;
|
|
34
35
|
abstract parsePartialResult(generations: Generation[] | ChatGeneration[]): Promise<T | undefined>;
|
|
35
36
|
_transform(inputGenerator: AsyncGenerator<string | BaseMessage>): AsyncGenerator<T>;
|
package/dist/outputs.d.cts
CHANGED
|
@@ -14,10 +14,12 @@ interface Generation {
|
|
|
14
14
|
* Raw generation info response from the provider.
|
|
15
15
|
* May include things like reason for finishing (e.g. in {@link OpenAI})
|
|
16
16
|
*/
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
18
|
generationInfo?: Record<string, any>;
|
|
18
19
|
}
|
|
19
20
|
type GenerationChunkFields = {
|
|
20
21
|
text: string;
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
23
|
generationInfo?: Record<string, any>;
|
|
22
24
|
};
|
|
23
25
|
/**
|
|
@@ -25,6 +27,7 @@ type GenerationChunkFields = {
|
|
|
25
27
|
*/
|
|
26
28
|
declare class GenerationChunk implements Generation {
|
|
27
29
|
text: string;
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28
31
|
generationInfo?: Record<string, any>;
|
|
29
32
|
constructor(fields: GenerationChunkFields);
|
|
30
33
|
concat(chunk: GenerationChunk): GenerationChunk;
|
|
@@ -40,10 +43,12 @@ type LLMResult = {
|
|
|
40
43
|
/**
|
|
41
44
|
* Dictionary of arbitrary LLM-provider specific output.
|
|
42
45
|
*/
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
43
47
|
llmOutput?: Record<string, any>;
|
|
44
48
|
/**
|
|
45
49
|
* Dictionary of run metadata
|
|
46
50
|
*/
|
|
51
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
47
52
|
[RUN_KEY]?: Record<string, any>;
|
|
48
53
|
};
|
|
49
54
|
interface ChatGeneration extends Generation {
|
|
@@ -59,6 +64,7 @@ declare class ChatGenerationChunk extends GenerationChunk implements ChatGenerat
|
|
|
59
64
|
}
|
|
60
65
|
interface ChatResult {
|
|
61
66
|
generations: ChatGeneration[];
|
|
67
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
62
68
|
llmOutput?: Record<string, any>;
|
|
63
69
|
}
|
|
64
70
|
//#endregion
|
package/dist/outputs.d.ts
CHANGED
|
@@ -14,10 +14,12 @@ interface Generation {
|
|
|
14
14
|
* Raw generation info response from the provider.
|
|
15
15
|
* May include things like reason for finishing (e.g. in {@link OpenAI})
|
|
16
16
|
*/
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
18
|
generationInfo?: Record<string, any>;
|
|
18
19
|
}
|
|
19
20
|
type GenerationChunkFields = {
|
|
20
21
|
text: string;
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
23
|
generationInfo?: Record<string, any>;
|
|
22
24
|
};
|
|
23
25
|
/**
|
|
@@ -25,6 +27,7 @@ type GenerationChunkFields = {
|
|
|
25
27
|
*/
|
|
26
28
|
declare class GenerationChunk implements Generation {
|
|
27
29
|
text: string;
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28
31
|
generationInfo?: Record<string, any>;
|
|
29
32
|
constructor(fields: GenerationChunkFields);
|
|
30
33
|
concat(chunk: GenerationChunk): GenerationChunk;
|
|
@@ -40,10 +43,12 @@ type LLMResult = {
|
|
|
40
43
|
/**
|
|
41
44
|
* Dictionary of arbitrary LLM-provider specific output.
|
|
42
45
|
*/
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
43
47
|
llmOutput?: Record<string, any>;
|
|
44
48
|
/**
|
|
45
49
|
* Dictionary of run metadata
|
|
46
50
|
*/
|
|
51
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
47
52
|
[RUN_KEY]?: Record<string, any>;
|
|
48
53
|
};
|
|
49
54
|
interface ChatGeneration extends Generation {
|
|
@@ -59,6 +64,7 @@ declare class ChatGenerationChunk extends GenerationChunk implements ChatGenerat
|
|
|
59
64
|
}
|
|
60
65
|
interface ChatResult {
|
|
61
66
|
generations: ChatGeneration[];
|
|
67
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
62
68
|
llmOutput?: Record<string, any>;
|
|
63
69
|
}
|
|
64
70
|
//#endregion
|
package/dist/prompts/base.d.cts
CHANGED
|
@@ -11,7 +11,11 @@ type Example = Record<string, string>;
|
|
|
11
11
|
/**
|
|
12
12
|
* Input common to all prompt templates.
|
|
13
13
|
*/
|
|
14
|
-
interface BasePromptTemplateInput<
|
|
14
|
+
interface BasePromptTemplateInput<
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16
|
+
InputVariables extends InputValues = any,
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18
|
+
PartialVariableName extends string = any> {
|
|
15
19
|
/**
|
|
16
20
|
* A list of variable names the prompt template expects
|
|
17
21
|
*/
|
|
@@ -27,7 +31,11 @@ interface BasePromptTemplateInput<InputVariables extends InputValues = any, Part
|
|
|
27
31
|
* Base class for prompt templates. Exposes a format method that returns a
|
|
28
32
|
* string prompt given a set of input values.
|
|
29
33
|
*/
|
|
30
|
-
declare abstract class BasePromptTemplate<
|
|
34
|
+
declare abstract class BasePromptTemplate<
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
36
|
+
RunInput extends InputValues = any, RunOutput extends BasePromptValueInterface = BasePromptValueInterface,
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
38
|
+
PartialVariableName extends string = any> extends Runnable<RunInput, RunOutput> implements BasePromptTemplateInput {
|
|
31
39
|
PromptValueReturnType: RunOutput;
|
|
32
40
|
lc_serializable: boolean;
|
|
33
41
|
lc_namespace: string[];
|
package/dist/prompts/base.d.ts
CHANGED
|
@@ -12,7 +12,11 @@ type Example = Record<string, string>;
|
|
|
12
12
|
/**
|
|
13
13
|
* Input common to all prompt templates.
|
|
14
14
|
*/
|
|
15
|
-
interface BasePromptTemplateInput<
|
|
15
|
+
interface BasePromptTemplateInput<
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
|
+
InputVariables extends InputValues = any,
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19
|
+
PartialVariableName extends string = any> {
|
|
16
20
|
/**
|
|
17
21
|
* A list of variable names the prompt template expects
|
|
18
22
|
*/
|
|
@@ -28,7 +32,11 @@ interface BasePromptTemplateInput<InputVariables extends InputValues = any, Part
|
|
|
28
32
|
* Base class for prompt templates. Exposes a format method that returns a
|
|
29
33
|
* string prompt given a set of input values.
|
|
30
34
|
*/
|
|
31
|
-
declare abstract class BasePromptTemplate<
|
|
35
|
+
declare abstract class BasePromptTemplate<
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
37
|
+
RunInput extends InputValues = any, RunOutput extends BasePromptValueInterface = BasePromptValueInterface,
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
39
|
+
PartialVariableName extends string = any> extends Runnable<RunInput, RunOutput> implements BasePromptTemplateInput {
|
|
32
40
|
PromptValueReturnType: RunOutput;
|
|
33
41
|
lc_serializable: boolean;
|
|
34
42
|
lc_namespace: string[];
|
package/dist/prompts/chat.d.cts
CHANGED
|
@@ -21,7 +21,9 @@ import { DictPromptTemplate } from "./dict.cjs";
|
|
|
21
21
|
* templates. It defines how to format messages for different roles in a
|
|
22
22
|
* conversation.
|
|
23
23
|
*/
|
|
24
|
-
declare abstract class BaseMessagePromptTemplate<
|
|
24
|
+
declare abstract class BaseMessagePromptTemplate<
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
26
|
+
RunInput extends InputValues = any, RunOutput extends BaseMessage[] = BaseMessage[]> extends Runnable<RunInput, RunOutput> {
|
|
25
27
|
lc_namespace: string[];
|
|
26
28
|
lc_serializable: boolean;
|
|
27
29
|
abstract inputVariables: Array<Extract<keyof RunInput, string>>;
|
|
@@ -51,7 +53,9 @@ interface MessagesPlaceholderFields<T extends string> {
|
|
|
51
53
|
* Class that represents a placeholder for messages in a chat prompt. It
|
|
52
54
|
* extends the BaseMessagePromptTemplate.
|
|
53
55
|
*/
|
|
54
|
-
declare class MessagesPlaceholder<
|
|
56
|
+
declare class MessagesPlaceholder<
|
|
57
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
58
|
+
RunInput extends InputValues = any> extends BaseMessagePromptTemplate<RunInput> implements MessagesPlaceholderFields<Extract<keyof RunInput, string>> {
|
|
55
59
|
static lc_name(): string;
|
|
56
60
|
variableName: Extract<keyof RunInput, string>;
|
|
57
61
|
optional: boolean;
|
|
@@ -63,14 +67,18 @@ declare class MessagesPlaceholder<RunInput extends InputValues = any> extends Ba
|
|
|
63
67
|
/**
|
|
64
68
|
* Interface for the fields of a MessageStringPromptTemplate.
|
|
65
69
|
*/
|
|
66
|
-
interface MessageStringPromptTemplateFields<
|
|
70
|
+
interface MessageStringPromptTemplateFields<
|
|
71
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
72
|
+
T extends InputValues = any> {
|
|
67
73
|
prompt: BaseStringPromptTemplate<T, string>;
|
|
68
74
|
}
|
|
69
75
|
/**
|
|
70
76
|
* Abstract class that serves as a base for creating message string prompt
|
|
71
77
|
* templates. It extends the BaseMessagePromptTemplate.
|
|
72
78
|
*/
|
|
73
|
-
declare abstract class BaseMessageStringPromptTemplate<
|
|
79
|
+
declare abstract class BaseMessageStringPromptTemplate<
|
|
80
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
81
|
+
RunInput extends InputValues = any> extends BaseMessagePromptTemplate<RunInput> {
|
|
74
82
|
prompt: BaseStringPromptTemplate<InputValues<Extract<keyof RunInput, string>>, string>;
|
|
75
83
|
constructor(prompt: BaseStringPromptTemplate<InputValues<Extract<keyof RunInput, string>>>);
|
|
76
84
|
constructor(fields: MessageStringPromptTemplateFields<InputValues<Extract<keyof RunInput, string>>>);
|
|
@@ -82,7 +90,11 @@ declare abstract class BaseMessageStringPromptTemplate<RunInput extends InputVal
|
|
|
82
90
|
* Abstract class that serves as a base for creating chat prompt
|
|
83
91
|
* templates. It extends the BasePromptTemplate.
|
|
84
92
|
*/
|
|
85
|
-
declare abstract class BaseChatPromptTemplate<
|
|
93
|
+
declare abstract class BaseChatPromptTemplate<
|
|
94
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
95
|
+
RunInput extends InputValues = any,
|
|
96
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
97
|
+
PartialVariableName extends string = any> extends BasePromptTemplate<RunInput, ChatPromptValueInterface, PartialVariableName> {
|
|
86
98
|
constructor(input: BasePromptTemplateInput<RunInput, PartialVariableName>);
|
|
87
99
|
abstract formatMessages(values: TypedPromptInputValues<RunInput>): Promise<BaseMessage[]>;
|
|
88
100
|
format(values: TypedPromptInputValues<RunInput>): Promise<string>;
|
|
@@ -91,6 +103,7 @@ declare abstract class BaseChatPromptTemplate<RunInput extends InputValues = any
|
|
|
91
103
|
/**
|
|
92
104
|
* Interface for the fields of a ChatMessagePromptTemplate.
|
|
93
105
|
*/
|
|
106
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
94
107
|
interface ChatMessagePromptTemplateFields<T extends InputValues = any> extends MessageStringPromptTemplateFields<T> {
|
|
95
108
|
role: string;
|
|
96
109
|
}
|
|
@@ -98,7 +111,9 @@ interface ChatMessagePromptTemplateFields<T extends InputValues = any> extends M
|
|
|
98
111
|
* Class that represents a chat message prompt template. It extends the
|
|
99
112
|
* BaseMessageStringPromptTemplate.
|
|
100
113
|
*/
|
|
101
|
-
declare class ChatMessagePromptTemplate<
|
|
114
|
+
declare class ChatMessagePromptTemplate<
|
|
115
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
116
|
+
RunInput extends InputValues = any> extends BaseMessageStringPromptTemplate<RunInput> {
|
|
102
117
|
static lc_name(): string;
|
|
103
118
|
role: string;
|
|
104
119
|
constructor(prompt: BaseStringPromptTemplate<InputValues<Extract<keyof RunInput, string>>>, role: string);
|
|
@@ -109,9 +124,11 @@ declare class ChatMessagePromptTemplate<RunInput extends InputValues = any> exte
|
|
|
109
124
|
}): ChatMessagePromptTemplate<ExtractedFStringParams<T, RunInput>>;
|
|
110
125
|
}
|
|
111
126
|
interface _TextTemplateParam {
|
|
127
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
112
128
|
text?: string | Record<string, any>;
|
|
113
129
|
}
|
|
114
130
|
interface _ImageTemplateParam {
|
|
131
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
115
132
|
image_url?: string | Record<string, any>;
|
|
116
133
|
}
|
|
117
134
|
type MessageClass = typeof HumanMessage | typeof AIMessage | typeof SystemMessage;
|
|
@@ -119,7 +136,9 @@ type ChatMessageClass = typeof ChatMessage;
|
|
|
119
136
|
interface _StringImageMessagePromptTemplateOptions<Format extends TemplateFormat = TemplateFormat> extends Record<string, unknown> {
|
|
120
137
|
templateFormat?: Format;
|
|
121
138
|
}
|
|
122
|
-
declare class _StringImageMessagePromptTemplate<
|
|
139
|
+
declare class _StringImageMessagePromptTemplate<
|
|
140
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
141
|
+
RunInput extends InputValues = any, RunOutput extends BaseMessage[] = BaseMessage[]> extends BaseMessagePromptTemplate<RunInput, RunOutput> {
|
|
123
142
|
lc_namespace: string[];
|
|
124
143
|
lc_serializable: boolean;
|
|
125
144
|
inputVariables: Array<Extract<keyof RunInput, string>>;
|
|
@@ -127,8 +146,11 @@ declare class _StringImageMessagePromptTemplate<RunInput extends InputValues = a
|
|
|
127
146
|
prompt: BaseStringPromptTemplate<InputValues<Extract<keyof RunInput, string>>, string> | Array<BaseStringPromptTemplate<InputValues<Extract<keyof RunInput, string>>, string> | ImagePromptTemplate<InputValues<Extract<keyof RunInput, string>>, string> | MessageStringPromptTemplateFields<InputValues<Extract<keyof RunInput, string>>> | DictPromptTemplate<InputValues<Extract<keyof RunInput, string>>>>;
|
|
128
147
|
protected messageClass?: MessageClass;
|
|
129
148
|
static _messageClass(): MessageClass;
|
|
149
|
+
// ChatMessage contains role field, others don't.
|
|
150
|
+
// Because of this, we have a separate class property for ChatMessage.
|
|
130
151
|
protected chatMessageClass?: ChatMessageClass;
|
|
131
152
|
constructor(/** @TODO When we come up with a better way to type prompt templates, fix this */
|
|
153
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
132
154
|
fields: any, additionalOptions?: _StringImageMessagePromptTemplateOptions);
|
|
133
155
|
createMessage(content: MessageContent): any;
|
|
134
156
|
getRoleFromMessageClass(name: string): "ai" | "chat" | "human" | "system";
|
|
@@ -150,7 +172,9 @@ declare class _StringImageMessagePromptTemplate<RunInput extends InputValues = a
|
|
|
150
172
|
* });
|
|
151
173
|
* ```
|
|
152
174
|
*/
|
|
153
|
-
declare class HumanMessagePromptTemplate<
|
|
175
|
+
declare class HumanMessagePromptTemplate<
|
|
176
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
177
|
+
RunInput extends InputValues = any> extends _StringImageMessagePromptTemplate<RunInput> {
|
|
154
178
|
static _messageClass(): typeof HumanMessage;
|
|
155
179
|
static lc_name(): string;
|
|
156
180
|
}
|
|
@@ -158,7 +182,9 @@ declare class HumanMessagePromptTemplate<RunInput extends InputValues = any> ext
|
|
|
158
182
|
* Class that represents an AI message prompt template. It extends the
|
|
159
183
|
* BaseMessageStringPromptTemplate.
|
|
160
184
|
*/
|
|
161
|
-
declare class AIMessagePromptTemplate<
|
|
185
|
+
declare class AIMessagePromptTemplate<
|
|
186
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
187
|
+
RunInput extends InputValues = any> extends _StringImageMessagePromptTemplate<RunInput> {
|
|
162
188
|
static _messageClass(): typeof AIMessage;
|
|
163
189
|
static lc_name(): string;
|
|
164
190
|
}
|
|
@@ -176,14 +202,20 @@ declare class AIMessagePromptTemplate<RunInput extends InputValues = any> extend
|
|
|
176
202
|
* });
|
|
177
203
|
* ```
|
|
178
204
|
*/
|
|
179
|
-
declare class SystemMessagePromptTemplate<
|
|
205
|
+
declare class SystemMessagePromptTemplate<
|
|
206
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
207
|
+
RunInput extends InputValues = any> extends _StringImageMessagePromptTemplate<RunInput> {
|
|
180
208
|
static _messageClass(): typeof SystemMessage;
|
|
181
209
|
static lc_name(): string;
|
|
182
210
|
}
|
|
183
211
|
/**
|
|
184
212
|
* Interface for the input of a ChatPromptTemplate.
|
|
185
213
|
*/
|
|
186
|
-
interface ChatPromptTemplateInput<
|
|
214
|
+
interface ChatPromptTemplateInput<
|
|
215
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
216
|
+
RunInput extends InputValues = any,
|
|
217
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
218
|
+
PartialVariableName extends string = any> extends BasePromptTemplateInput<RunInput, PartialVariableName> {
|
|
187
219
|
/**
|
|
188
220
|
* The prompt messages
|
|
189
221
|
*/
|
|
@@ -217,7 +249,11 @@ type BaseMessagePromptTemplateLike = BaseMessagePromptTemplate | BaseMessageLike
|
|
|
217
249
|
* });
|
|
218
250
|
* ```
|
|
219
251
|
*/
|
|
220
|
-
declare class ChatPromptTemplate<
|
|
252
|
+
declare class ChatPromptTemplate<
|
|
253
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
254
|
+
RunInput extends InputValues = any,
|
|
255
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
256
|
+
PartialVariableName extends string = any> extends BaseChatPromptTemplate<RunInput, PartialVariableName> implements ChatPromptTemplateInput<RunInput, PartialVariableName> {
|
|
221
257
|
static lc_name(): string;
|
|
222
258
|
get lc_aliases(): Record<string, string>;
|
|
223
259
|
promptMessages: Array<BaseMessagePromptTemplate | BaseMessage>;
|
|
@@ -240,7 +276,9 @@ declare class ChatPromptTemplate<RunInput extends InputValues = any, PartialVari
|
|
|
240
276
|
* @param promptMessages Messages to be passed to the chat model
|
|
241
277
|
* @returns A new ChatPromptTemplate
|
|
242
278
|
*/
|
|
243
|
-
static fromMessages<
|
|
279
|
+
static fromMessages<
|
|
280
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
281
|
+
RunInput extends InputValues = any, Extra extends ChatPromptTemplateInput<RunInput> = ChatPromptTemplateInput<RunInput>>(promptMessages: (ChatPromptTemplate<InputValues, string> | BaseMessagePromptTemplateLike)[], extra?: Omit<Extra, "inputVariables" | "promptMessages" | "partialVariables">): ChatPromptTemplate<RunInput>;
|
|
244
282
|
}
|
|
245
283
|
//#endregion
|
|
246
284
|
export { AIMessagePromptTemplate, BaseChatPromptTemplate, BaseMessagePromptTemplate, BaseMessagePromptTemplateLike, BaseMessageStringPromptTemplate, ChatMessagePromptTemplate, ChatMessagePromptTemplateFields, ChatPromptTemplate, ChatPromptTemplateInput, HumanMessagePromptTemplate, MessageStringPromptTemplateFields, MessagesPlaceholder, MessagesPlaceholderFields, SystemMessagePromptTemplate };
|