@langchain/core 1.1.2 → 1.1.3
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 +10 -0
- package/dist/agents.d.cts +0 -2
- package/dist/agents.d.ts +0 -2
- package/dist/callbacks/base.d.cts +22 -60
- package/dist/callbacks/base.d.ts +22 -60
- package/dist/callbacks/dispatch/index.d.cts +1 -3
- package/dist/callbacks/dispatch/index.d.ts +1 -3
- package/dist/callbacks/dispatch/web.d.cts +1 -3
- package/dist/callbacks/dispatch/web.d.ts +1 -3
- package/dist/callbacks/manager.d.cts +2 -12
- package/dist/callbacks/manager.d.ts +2 -12
- package/dist/chat_history.cjs +1 -1
- package/dist/chat_history.d.cts +0 -1
- package/dist/chat_history.d.ts +0 -1
- package/dist/chat_history.js +1 -1
- package/dist/document_loaders/langsmith.d.cts +0 -3
- package/dist/document_loaders/langsmith.d.ts +0 -3
- package/dist/documents/document.d.cts +3 -12
- package/dist/documents/document.d.ts +3 -12
- 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 +0 -1
- package/dist/indexing/base.d.ts +0 -1
- package/dist/indexing/record_manager.d.cts +0 -1
- package/dist/indexing/record_manager.d.ts +0 -1
- package/dist/language_models/base.d.cts +8 -38
- package/dist/language_models/base.d.ts +8 -38
- package/dist/language_models/chat_models.cjs +1 -1
- package/dist/language_models/chat_models.d.cts +6 -33
- package/dist/language_models/chat_models.d.ts +6 -33
- package/dist/language_models/chat_models.js +1 -1
- package/dist/language_models/llms.d.cts +0 -6
- package/dist/language_models/llms.d.ts +0 -6
- package/dist/load/import_type.d.cts +0 -1
- package/dist/load/import_type.d.ts +0 -1
- package/dist/load/map_keys.cjs +4 -5
- package/dist/load/map_keys.cjs.map +1 -1
- package/dist/load/map_keys.d.cts +0 -1
- package/dist/load/map_keys.d.ts +0 -1
- package/dist/load/map_keys.js +3 -3
- package/dist/load/map_keys.js.map +1 -1
- package/dist/load/serializable.d.cts +0 -1
- package/dist/load/serializable.d.ts +0 -1
- package/dist/memory.d.cts +0 -3
- package/dist/memory.d.ts +0 -3
- package/dist/messages/ai.cjs +6 -48
- package/dist/messages/ai.cjs.map +1 -1
- package/dist/messages/ai.js +6 -48
- package/dist/messages/ai.js.map +1 -1
- package/dist/messages/base.cjs +3 -2
- package/dist/messages/base.cjs.map +1 -1
- package/dist/messages/base.d.cts +1 -13
- package/dist/messages/base.d.ts +1 -13
- package/dist/messages/base.js +3 -2
- package/dist/messages/base.js.map +1 -1
- package/dist/messages/content/data.d.cts +2 -7
- package/dist/messages/content/data.d.ts +2 -7
- package/dist/messages/content/index.d.cts +1 -4
- package/dist/messages/content/index.d.ts +1 -4
- package/dist/messages/content/multimodal.d.cts +0 -1
- package/dist/messages/content/multimodal.d.ts +0 -1
- package/dist/messages/content/tools.d.cts +0 -1
- package/dist/messages/content/tools.d.ts +0 -1
- package/dist/messages/index.cjs +4 -2
- package/dist/messages/index.d.cts +2 -2
- package/dist/messages/index.d.ts +2 -2
- package/dist/messages/index.js +5 -4
- package/dist/messages/tool.d.cts +2 -9
- package/dist/messages/tool.d.ts +2 -9
- package/dist/messages/transformers.cjs +2 -2
- package/dist/messages/transformers.d.cts +0 -3
- package/dist/messages/transformers.d.ts +0 -3
- package/dist/messages/transformers.js +2 -2
- package/dist/messages/utils.cjs +77 -4
- package/dist/messages/utils.cjs.map +1 -1
- package/dist/messages/utils.d.cts +35 -7
- package/dist/messages/utils.d.ts +35 -7
- package/dist/messages/utils.js +77 -5
- package/dist/messages/utils.js.map +1 -1
- package/dist/node_modules/.pnpm/ansi-styles@6.2.3/node_modules/ansi-styles/index.cjs +169 -0
- package/dist/node_modules/.pnpm/ansi-styles@6.2.3/node_modules/ansi-styles/index.cjs.map +1 -0
- package/dist/node_modules/.pnpm/ansi-styles@6.2.3/node_modules/ansi-styles/index.js +168 -0
- package/dist/node_modules/.pnpm/ansi-styles@6.2.3/node_modules/ansi-styles/index.js.map +1 -0
- package/dist/node_modules/.pnpm/camelcase@9.0.0/node_modules/camelcase/index.cjs +122 -0
- package/dist/node_modules/.pnpm/camelcase@9.0.0/node_modules/camelcase/index.cjs.map +1 -0
- package/dist/node_modules/.pnpm/camelcase@9.0.0/node_modules/camelcase/index.js +121 -0
- package/dist/node_modules/.pnpm/camelcase@9.0.0/node_modules/camelcase/index.js.map +1 -0
- package/dist/node_modules/.pnpm/decamelize@6.0.1/node_modules/decamelize/index.cjs +18 -0
- package/dist/node_modules/.pnpm/decamelize@6.0.1/node_modules/decamelize/index.cjs.map +1 -0
- package/dist/node_modules/.pnpm/decamelize@6.0.1/node_modules/decamelize/index.js +17 -0
- package/dist/node_modules/.pnpm/decamelize@6.0.1/node_modules/decamelize/index.js.map +1 -0
- package/dist/node_modules/.pnpm/is-network-error@1.3.0/node_modules/is-network-error/index.cjs +27 -0
- package/dist/node_modules/.pnpm/is-network-error@1.3.0/node_modules/is-network-error/index.cjs.map +1 -0
- package/dist/node_modules/.pnpm/is-network-error@1.3.0/node_modules/is-network-error/index.js +26 -0
- package/dist/node_modules/.pnpm/is-network-error@1.3.0/node_modules/is-network-error/index.js.map +1 -0
- package/dist/node_modules/.pnpm/p-retry@7.1.0/node_modules/p-retry/index.cjs +141 -0
- package/dist/node_modules/.pnpm/p-retry@7.1.0/node_modules/p-retry/index.cjs.map +1 -0
- package/dist/node_modules/.pnpm/p-retry@7.1.0/node_modules/p-retry/index.js +141 -0
- package/dist/node_modules/.pnpm/p-retry@7.1.0/node_modules/p-retry/index.js.map +1 -0
- package/dist/output_parsers/json.d.cts +1 -5
- package/dist/output_parsers/json.d.ts +1 -5
- package/dist/output_parsers/openai_functions/json_output_functions_parsers.d.cts +2 -6
- package/dist/output_parsers/openai_functions/json_output_functions_parsers.d.ts +2 -6
- package/dist/output_parsers/openai_tools/json_output_tools_parsers.d.cts +10 -34
- package/dist/output_parsers/openai_tools/json_output_tools_parsers.d.ts +10 -34
- package/dist/output_parsers/transform.d.cts +0 -1
- package/dist/output_parsers/transform.d.ts +0 -1
- package/dist/outputs.d.cts +0 -6
- package/dist/outputs.d.ts +0 -6
- package/dist/prompts/base.d.cts +2 -10
- package/dist/prompts/base.d.ts +2 -10
- package/dist/prompts/chat.cjs +2 -2
- package/dist/prompts/chat.d.cts +13 -51
- package/dist/prompts/chat.d.ts +13 -51
- package/dist/prompts/chat.js +2 -2
- package/dist/prompts/few_shot.d.cts +1 -5
- package/dist/prompts/few_shot.d.ts +1 -5
- package/dist/prompts/image.d.cts +2 -10
- package/dist/prompts/image.d.ts +2 -10
- package/dist/prompts/prompt.d.cts +4 -15
- package/dist/prompts/prompt.d.ts +4 -16
- package/dist/prompts/serde.d.cts +0 -1
- package/dist/prompts/serde.d.ts +0 -1
- package/dist/prompts/string.d.cts +1 -5
- package/dist/prompts/string.d.ts +1 -5
- package/dist/prompts/structured.d.cts +3 -16
- package/dist/prompts/structured.d.ts +3 -16
- package/dist/retrievers/document_compressors/index.d.cts +0 -1
- package/dist/retrievers/document_compressors/index.d.ts +0 -1
- package/dist/retrievers/index.d.cts +2 -6
- package/dist/retrievers/index.d.ts +2 -6
- package/dist/runnables/base.cjs +7 -7
- package/dist/runnables/base.cjs.map +1 -1
- package/dist/runnables/base.d.cts +12 -64
- package/dist/runnables/base.d.ts +12 -64
- package/dist/runnables/base.js +1 -1
- package/dist/runnables/branch.d.cts +0 -2
- package/dist/runnables/branch.d.ts +0 -2
- package/dist/runnables/config.d.cts +0 -1
- package/dist/runnables/config.d.ts +0 -1
- package/dist/runnables/graph.d.cts +1 -5
- package/dist/runnables/graph.d.ts +1 -5
- package/dist/runnables/graph_mermaid.cjs +2 -1
- package/dist/runnables/graph_mermaid.cjs.map +1 -1
- package/dist/runnables/graph_mermaid.js +3 -1
- package/dist/runnables/graph_mermaid.js.map +1 -1
- package/dist/runnables/history.cjs +1 -1
- package/dist/runnables/history.d.cts +4 -12
- package/dist/runnables/history.d.ts +4 -12
- package/dist/runnables/history.js +1 -1
- package/dist/runnables/passthrough.d.cts +0 -2
- package/dist/runnables/passthrough.d.ts +0 -2
- package/dist/runnables/router.d.cts +0 -1
- package/dist/runnables/router.d.ts +0 -1
- package/dist/runnables/types.d.cts +2 -9
- package/dist/runnables/types.d.ts +2 -9
- package/dist/runnables/utils.cjs +5 -0
- package/dist/runnables/utils.cjs.map +1 -1
- package/dist/runnables/utils.js +5 -1
- package/dist/runnables/utils.js.map +1 -1
- package/dist/singletons/async_local_storage/context.d.cts +0 -2
- package/dist/singletons/async_local_storage/context.d.ts +0 -2
- package/dist/singletons/async_local_storage/globals.d.cts +0 -1
- package/dist/singletons/async_local_storage/globals.d.ts +0 -1
- package/dist/singletons/callbacks.cjs.map +1 -1
- package/dist/singletons/callbacks.js.map +1 -1
- package/dist/stores.d.cts +0 -1
- package/dist/stores.d.ts +0 -1
- package/dist/structured_query/utils.d.cts +1 -4
- package/dist/structured_query/utils.d.ts +1 -4
- package/dist/tools/index.d.cts +1 -6
- package/dist/tools/index.d.ts +1 -6
- package/dist/tools/types.d.cts +3 -13
- package/dist/tools/types.d.ts +3 -13
- package/dist/tracers/base.d.cts +1 -20
- package/dist/tracers/base.d.ts +1 -20
- package/dist/tracers/console.cjs +3 -3
- package/dist/tracers/console.cjs.map +1 -1
- package/dist/tracers/console.d.cts +0 -2
- package/dist/tracers/console.d.ts +0 -2
- package/dist/tracers/console.js +3 -3
- package/dist/tracers/console.js.map +1 -1
- package/dist/tracers/event_stream.d.cts +0 -4
- package/dist/tracers/event_stream.d.ts +0 -4
- package/dist/tracers/log_stream.d.cts +0 -6
- package/dist/tracers/log_stream.d.ts +0 -6
- package/dist/types/_internal.d.cts +0 -3
- package/dist/types/_internal.d.ts +0 -3
- package/dist/types/type-utils.d.cts +0 -2
- package/dist/types/type-utils.d.ts +0 -2
- package/dist/utils/async_caller.cjs +2 -7
- package/dist/utils/async_caller.cjs.map +1 -1
- package/dist/utils/async_caller.d.cts +0 -3
- package/dist/utils/async_caller.d.ts +0 -3
- package/dist/utils/async_caller.js +1 -6
- package/dist/utils/async_caller.js.map +1 -1
- package/dist/utils/env.d.cts +0 -4
- package/dist/utils/env.d.ts +0 -4
- package/dist/utils/event_source_parse.d.cts +1 -4
- package/dist/utils/event_source_parse.d.ts +1 -4
- package/dist/utils/function_calling.d.cts +1 -3
- package/dist/utils/function_calling.d.ts +1 -3
- package/dist/utils/json.d.cts +0 -1
- package/dist/utils/json.d.ts +0 -1
- package/dist/utils/stream.d.cts +1 -13
- package/dist/utils/stream.d.ts +1 -13
- package/dist/utils/testing/chat_models.d.cts +3 -11
- package/dist/utils/testing/chat_models.d.ts +3 -11
- package/dist/utils/testing/message_history.cjs +1 -1
- package/dist/utils/testing/message_history.js +1 -1
- package/dist/utils/testing/retrievers.d.cts +1 -3
- package/dist/utils/testing/retrievers.d.ts +1 -3
- package/dist/utils/testing/vectorstores.d.cts +0 -1
- package/dist/utils/testing/vectorstores.d.ts +0 -1
- package/dist/utils/types/index.cjs +4 -0
- package/dist/utils/types/index.d.cts +2 -4
- package/dist/utils/types/index.d.ts +2 -4
- package/dist/utils/types/index.js +4 -2
- package/dist/utils/types/zod.cjs +24 -0
- package/dist/utils/types/zod.cjs.map +1 -1
- package/dist/utils/types/zod.d.cts +4 -4
- package/dist/utils/types/zod.d.ts +4 -4
- package/dist/utils/types/zod.js +23 -1
- package/dist/utils/types/zod.js.map +1 -1
- package/dist/vectorstores.d.cts +5 -17
- package/dist/vectorstores.d.ts +5 -17
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @langchain/core
|
|
2
2
|
|
|
3
|
+
## 1.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#9534](https://github.com/langchain-ai/langchainjs/pull/9534) [`bd2c46e`](https://github.com/langchain-ai/langchainjs/commit/bd2c46e09e661d9ac766c09e71bc6687d6fc811c) Thanks [@christian-bromann](https://github.com/christian-bromann)! - fix(@langchain/core): update and bundle `p-retry`, `ansi-styles`, `camelcase` and `decamelize` dependencies
|
|
8
|
+
|
|
9
|
+
- [#9544](https://github.com/langchain-ai/langchainjs/pull/9544) [`487378b`](https://github.com/langchain-ai/langchainjs/commit/487378bf14277659c8ca0ef06ea0f9836b818ff4) Thanks [@hntrl](https://github.com/hntrl)! - fix tool chunk concat behavior (#9450)
|
|
10
|
+
|
|
11
|
+
- [#9505](https://github.com/langchain-ai/langchainjs/pull/9505) [`138e7fb`](https://github.com/langchain-ai/langchainjs/commit/138e7fb6280705457079863bedb238b16b322032) Thanks [@chosh-dev](https://github.com/chosh-dev)! - feat: replace btoa with toBase64Url for encoding in drawMermaidImage
|
|
12
|
+
|
|
3
13
|
## 1.1.2
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/dist/agents.d.cts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
//#region src/agents.d.ts
|
|
2
2
|
type AgentAction = {
|
|
3
3
|
tool: string;
|
|
4
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
4
|
toolInput: string | Record<string, any>;
|
|
6
5
|
log: string;
|
|
7
6
|
};
|
|
8
7
|
type AgentFinish = {
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
8
|
returnValues: Record<string, any>;
|
|
11
9
|
log: string;
|
|
12
10
|
};
|
package/dist/agents.d.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
//#region src/agents.d.ts
|
|
2
2
|
type AgentAction = {
|
|
3
3
|
tool: string;
|
|
4
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
4
|
toolInput: string | Record<string, any>;
|
|
6
5
|
log: string;
|
|
7
6
|
};
|
|
8
7
|
type AgentFinish = {
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
8
|
returnValues: Record<string, any>;
|
|
11
9
|
log: string;
|
|
12
10
|
};
|
|
@@ -8,7 +8,6 @@ import { ChainValues } from "../utils/types/index.cjs";
|
|
|
8
8
|
import { DocumentInterface } from "../documents/document.cjs";
|
|
9
9
|
|
|
10
10
|
//#region src/callbacks/base.d.ts
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
11
|
type Error = any;
|
|
13
12
|
/**
|
|
14
13
|
* Interface for the input parameters of the BaseCallbackHandler class. It
|
|
@@ -32,7 +31,6 @@ interface NewTokenIndices {
|
|
|
32
31
|
prompt: number;
|
|
33
32
|
completion: number;
|
|
34
33
|
}
|
|
35
|
-
// TODO: Add all additional callback fields here
|
|
36
34
|
type HandleLLMNewTokenCallbackFields = {
|
|
37
35
|
chunk?: GenerationChunk | ChatGenerationChunk;
|
|
38
36
|
};
|
|
@@ -46,9 +44,7 @@ declare abstract class BaseCallbackHandlerMethodsClass {
|
|
|
46
44
|
* Called at the start of an LLM or Chat Model run, with the prompt(s)
|
|
47
45
|
* and the run ID.
|
|
48
46
|
*/
|
|
49
|
-
handleLLMStart?(llm: Serialized, prompts: string[], runId: string, parentRunId?: string, extraParams?: Record<string, unknown>, tags?: string[], metadata?: Record<string, unknown>, runName?: string):
|
|
50
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
51
|
-
Promise<any> | any;
|
|
47
|
+
handleLLMStart?(llm: Serialized, prompts: string[], runId: string, parentRunId?: string, extraParams?: Record<string, unknown>, tags?: string[], metadata?: Record<string, unknown>, runName?: string): Promise<any> | any;
|
|
52
48
|
/**
|
|
53
49
|
* Called when an LLM/ChatModel in `streaming` mode produces a new token
|
|
54
50
|
*/
|
|
@@ -59,72 +55,50 @@ declare abstract class BaseCallbackHandlerMethodsClass {
|
|
|
59
55
|
* idx.completion is the index of the completion that produced the token
|
|
60
56
|
* (if multiple completions per prompt are requested)
|
|
61
57
|
*/
|
|
62
|
-
idx: NewTokenIndices, runId: string, parentRunId?: string, tags?: string[], fields?: HandleLLMNewTokenCallbackFields):
|
|
63
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
64
|
-
Promise<any> | any;
|
|
58
|
+
idx: NewTokenIndices, runId: string, parentRunId?: string, tags?: string[], fields?: HandleLLMNewTokenCallbackFields): Promise<any> | any;
|
|
65
59
|
/**
|
|
66
60
|
* Called if an LLM/ChatModel run encounters an error
|
|
67
61
|
*/
|
|
68
|
-
handleLLMError?(err: Error, runId: string, parentRunId?: string, tags?: string[], extraParams?: Record<string, unknown>):
|
|
69
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
70
|
-
Promise<any> | any;
|
|
62
|
+
handleLLMError?(err: Error, runId: string, parentRunId?: string, tags?: string[], extraParams?: Record<string, unknown>): Promise<any> | any;
|
|
71
63
|
/**
|
|
72
64
|
* Called at the end of an LLM/ChatModel run, with the output and the run ID.
|
|
73
65
|
*/
|
|
74
|
-
handleLLMEnd?(output: LLMResult, runId: string, parentRunId?: string, tags?: string[], extraParams?: Record<string, unknown>):
|
|
75
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
76
|
-
Promise<any> | any;
|
|
66
|
+
handleLLMEnd?(output: LLMResult, runId: string, parentRunId?: string, tags?: string[], extraParams?: Record<string, unknown>): Promise<any> | any;
|
|
77
67
|
/**
|
|
78
68
|
* Called at the start of a Chat Model run, with the prompt(s)
|
|
79
69
|
* and the run ID.
|
|
80
70
|
*/
|
|
81
|
-
handleChatModelStart?(llm: Serialized, messages: BaseMessage[][], runId: string, parentRunId?: string, extraParams?: Record<string, unknown>, tags?: string[], metadata?: Record<string, unknown>, runName?: string):
|
|
82
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
83
|
-
Promise<any> | any;
|
|
71
|
+
handleChatModelStart?(llm: Serialized, messages: BaseMessage[][], runId: string, parentRunId?: string, extraParams?: Record<string, unknown>, tags?: string[], metadata?: Record<string, unknown>, runName?: string): Promise<any> | any;
|
|
84
72
|
/**
|
|
85
73
|
* Called at the start of a Chain run, with the chain name and inputs
|
|
86
74
|
* and the run ID.
|
|
87
75
|
*/
|
|
88
|
-
handleChainStart?(chain: Serialized, inputs: ChainValues, runId: string, parentRunId?: string, tags?: string[], metadata?: Record<string, unknown>, runType?: string, runName?: string):
|
|
89
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
90
|
-
Promise<any> | any;
|
|
76
|
+
handleChainStart?(chain: Serialized, inputs: ChainValues, runId: string, parentRunId?: string, tags?: string[], metadata?: Record<string, unknown>, runType?: string, runName?: string): Promise<any> | any;
|
|
91
77
|
/**
|
|
92
78
|
* Called if a Chain run encounters an error
|
|
93
79
|
*/
|
|
94
80
|
handleChainError?(err: Error, runId: string, parentRunId?: string, tags?: string[], kwargs?: {
|
|
95
81
|
inputs?: Record<string, unknown>;
|
|
96
|
-
}):
|
|
97
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
98
|
-
Promise<any> | any;
|
|
82
|
+
}): Promise<any> | any;
|
|
99
83
|
/**
|
|
100
84
|
* Called at the end of a Chain run, with the outputs and the run ID.
|
|
101
85
|
*/
|
|
102
86
|
handleChainEnd?(outputs: ChainValues, runId: string, parentRunId?: string, tags?: string[], kwargs?: {
|
|
103
87
|
inputs?: Record<string, unknown>;
|
|
104
|
-
}):
|
|
105
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
106
|
-
Promise<any> | any;
|
|
88
|
+
}): Promise<any> | any;
|
|
107
89
|
/**
|
|
108
90
|
* Called at the start of a Tool run, with the tool name and input
|
|
109
91
|
* and the run ID.
|
|
110
92
|
*/
|
|
111
|
-
handleToolStart?(tool: Serialized, input: string, runId: string, parentRunId?: string, tags?: string[], metadata?: Record<string, unknown>, runName?: string):
|
|
112
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
113
|
-
Promise<any> | any;
|
|
93
|
+
handleToolStart?(tool: Serialized, input: string, runId: string, parentRunId?: string, tags?: string[], metadata?: Record<string, unknown>, runName?: string): Promise<any> | any;
|
|
114
94
|
/**
|
|
115
95
|
* Called if a Tool run encounters an error
|
|
116
96
|
*/
|
|
117
|
-
handleToolError?(err: Error, runId: string, parentRunId?: string, tags?: string[]):
|
|
118
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
119
|
-
Promise<any> | any;
|
|
97
|
+
handleToolError?(err: Error, runId: string, parentRunId?: string, tags?: string[]): Promise<any> | any;
|
|
120
98
|
/**
|
|
121
99
|
* Called at the end of a Tool run, with the tool output and the run ID.
|
|
122
100
|
*/
|
|
123
|
-
handleToolEnd?(
|
|
124
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
125
|
-
output: any, runId: string, parentRunId?: string, tags?: string[]):
|
|
126
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
127
|
-
Promise<any> | any;
|
|
101
|
+
handleToolEnd?(output: any, runId: string, parentRunId?: string, tags?: string[]): Promise<any> | any;
|
|
128
102
|
handleText?(text: string, runId: string, parentRunId?: string, tags?: string[]): Promise<void> | void;
|
|
129
103
|
/**
|
|
130
104
|
* Called when an agent is about to execute an action,
|
|
@@ -136,22 +110,10 @@ declare abstract class BaseCallbackHandlerMethodsClass {
|
|
|
136
110
|
* with the final output and the run ID.
|
|
137
111
|
*/
|
|
138
112
|
handleAgentEnd?(action: AgentFinish, runId: string, parentRunId?: string, tags?: string[]): Promise<void> | void;
|
|
139
|
-
handleRetrieverStart?(retriever: Serialized, query: string, runId: string, parentRunId?: string, tags?: string[], metadata?: Record<string, unknown>, name?: string):
|
|
140
|
-
|
|
141
|
-
Promise<any> | any;
|
|
142
|
-
|
|
143
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
144
|
-
Promise<any> | any;
|
|
145
|
-
handleRetrieverError?(err: Error, runId: string, parentRunId?: string, tags?: string[]):
|
|
146
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
147
|
-
Promise<any> | any;
|
|
148
|
-
handleCustomEvent?(eventName: string,
|
|
149
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
150
|
-
data: any, runId: string, tags?: string[],
|
|
151
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
152
|
-
metadata?: Record<string, any>):
|
|
153
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
154
|
-
Promise<any> | any;
|
|
113
|
+
handleRetrieverStart?(retriever: Serialized, query: string, runId: string, parentRunId?: string, tags?: string[], metadata?: Record<string, unknown>, name?: string): Promise<any> | any;
|
|
114
|
+
handleRetrieverEnd?(documents: DocumentInterface[], runId: string, parentRunId?: string, tags?: string[]): Promise<any> | any;
|
|
115
|
+
handleRetrieverError?(err: Error, runId: string, parentRunId?: string, tags?: string[]): Promise<any> | any;
|
|
116
|
+
handleCustomEvent?(eventName: string, data: any, runId: string, tags?: string[], metadata?: Record<string, any>): Promise<any> | any;
|
|
155
117
|
}
|
|
156
118
|
/**
|
|
157
119
|
* Base interface for callbacks. All methods are optional. If a method is not
|
|
@@ -216,6 +178,7 @@ declare abstract class BaseCallbackHandler extends BaseCallbackHandlerMethodsCla
|
|
|
216
178
|
toJSON(): Serialized;
|
|
217
179
|
toJSONNotImplemented(): SerializedNotImplemented;
|
|
218
180
|
static fromMethods(methods: CallbackHandlerMethods): {
|
|
181
|
+
name: string;
|
|
219
182
|
/**
|
|
220
183
|
* Called at the start of an LLM or Chat Model run, with the prompt(s)
|
|
221
184
|
* and the run ID.
|
|
@@ -284,21 +247,21 @@ declare abstract class BaseCallbackHandler extends BaseCallbackHandlerMethodsCla
|
|
|
284
247
|
handleRetrieverError?(err: any, runId: string, parentRunId?: string | undefined, tags?: string[] | undefined): any;
|
|
285
248
|
handleCustomEvent?(eventName: string, data: any, runId: string, tags?: string[] | undefined, metadata?: Record<string, any> | undefined): any;
|
|
286
249
|
lc_serializable: boolean;
|
|
287
|
-
|
|
288
|
-
|
|
250
|
+
get lc_namespace(): ["langchain_core", "callbacks", string];
|
|
251
|
+
get lc_secrets(): {
|
|
289
252
|
[key: string]: string;
|
|
290
253
|
} | undefined;
|
|
291
|
-
|
|
254
|
+
get lc_attributes(): {
|
|
292
255
|
[key: string]: string;
|
|
293
256
|
} | undefined;
|
|
294
|
-
|
|
257
|
+
get lc_aliases(): {
|
|
295
258
|
[key: string]: string;
|
|
296
259
|
} | undefined;
|
|
297
|
-
|
|
260
|
+
get lc_serializable_keys(): string[] | undefined;
|
|
298
261
|
/**
|
|
299
262
|
* The final serialized identifier for the module.
|
|
300
263
|
*/
|
|
301
|
-
|
|
264
|
+
get lc_id(): string[];
|
|
302
265
|
lc_kwargs: SerializedFields;
|
|
303
266
|
ignoreLLM: boolean;
|
|
304
267
|
ignoreChain: boolean;
|
|
@@ -310,7 +273,6 @@ declare abstract class BaseCallbackHandler extends BaseCallbackHandlerMethodsCla
|
|
|
310
273
|
copy(): BaseCallbackHandler;
|
|
311
274
|
toJSON(): Serialized;
|
|
312
275
|
toJSONNotImplemented(): SerializedNotImplemented;
|
|
313
|
-
name: string;
|
|
314
276
|
};
|
|
315
277
|
}
|
|
316
278
|
declare const isBaseCallbackHandler: (x: unknown) => boolean;
|
package/dist/callbacks/base.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ import { ChainValues } from "../utils/types/index.js";
|
|
|
8
8
|
import { DocumentInterface } from "../documents/document.js";
|
|
9
9
|
|
|
10
10
|
//#region src/callbacks/base.d.ts
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
11
|
type Error = any;
|
|
13
12
|
/**
|
|
14
13
|
* Interface for the input parameters of the BaseCallbackHandler class. It
|
|
@@ -32,7 +31,6 @@ interface NewTokenIndices {
|
|
|
32
31
|
prompt: number;
|
|
33
32
|
completion: number;
|
|
34
33
|
}
|
|
35
|
-
// TODO: Add all additional callback fields here
|
|
36
34
|
type HandleLLMNewTokenCallbackFields = {
|
|
37
35
|
chunk?: GenerationChunk | ChatGenerationChunk;
|
|
38
36
|
};
|
|
@@ -46,9 +44,7 @@ declare abstract class BaseCallbackHandlerMethodsClass {
|
|
|
46
44
|
* Called at the start of an LLM or Chat Model run, with the prompt(s)
|
|
47
45
|
* and the run ID.
|
|
48
46
|
*/
|
|
49
|
-
handleLLMStart?(llm: Serialized, prompts: string[], runId: string, parentRunId?: string, extraParams?: Record<string, unknown>, tags?: string[], metadata?: Record<string, unknown>, runName?: string):
|
|
50
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
51
|
-
Promise<any> | any;
|
|
47
|
+
handleLLMStart?(llm: Serialized, prompts: string[], runId: string, parentRunId?: string, extraParams?: Record<string, unknown>, tags?: string[], metadata?: Record<string, unknown>, runName?: string): Promise<any> | any;
|
|
52
48
|
/**
|
|
53
49
|
* Called when an LLM/ChatModel in `streaming` mode produces a new token
|
|
54
50
|
*/
|
|
@@ -59,72 +55,50 @@ declare abstract class BaseCallbackHandlerMethodsClass {
|
|
|
59
55
|
* idx.completion is the index of the completion that produced the token
|
|
60
56
|
* (if multiple completions per prompt are requested)
|
|
61
57
|
*/
|
|
62
|
-
idx: NewTokenIndices, runId: string, parentRunId?: string, tags?: string[], fields?: HandleLLMNewTokenCallbackFields):
|
|
63
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
64
|
-
Promise<any> | any;
|
|
58
|
+
idx: NewTokenIndices, runId: string, parentRunId?: string, tags?: string[], fields?: HandleLLMNewTokenCallbackFields): Promise<any> | any;
|
|
65
59
|
/**
|
|
66
60
|
* Called if an LLM/ChatModel run encounters an error
|
|
67
61
|
*/
|
|
68
|
-
handleLLMError?(err: Error, runId: string, parentRunId?: string, tags?: string[], extraParams?: Record<string, unknown>):
|
|
69
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
70
|
-
Promise<any> | any;
|
|
62
|
+
handleLLMError?(err: Error, runId: string, parentRunId?: string, tags?: string[], extraParams?: Record<string, unknown>): Promise<any> | any;
|
|
71
63
|
/**
|
|
72
64
|
* Called at the end of an LLM/ChatModel run, with the output and the run ID.
|
|
73
65
|
*/
|
|
74
|
-
handleLLMEnd?(output: LLMResult, runId: string, parentRunId?: string, tags?: string[], extraParams?: Record<string, unknown>):
|
|
75
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
76
|
-
Promise<any> | any;
|
|
66
|
+
handleLLMEnd?(output: LLMResult, runId: string, parentRunId?: string, tags?: string[], extraParams?: Record<string, unknown>): Promise<any> | any;
|
|
77
67
|
/**
|
|
78
68
|
* Called at the start of a Chat Model run, with the prompt(s)
|
|
79
69
|
* and the run ID.
|
|
80
70
|
*/
|
|
81
|
-
handleChatModelStart?(llm: Serialized, messages: BaseMessage[][], runId: string, parentRunId?: string, extraParams?: Record<string, unknown>, tags?: string[], metadata?: Record<string, unknown>, runName?: string):
|
|
82
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
83
|
-
Promise<any> | any;
|
|
71
|
+
handleChatModelStart?(llm: Serialized, messages: BaseMessage[][], runId: string, parentRunId?: string, extraParams?: Record<string, unknown>, tags?: string[], metadata?: Record<string, unknown>, runName?: string): Promise<any> | any;
|
|
84
72
|
/**
|
|
85
73
|
* Called at the start of a Chain run, with the chain name and inputs
|
|
86
74
|
* and the run ID.
|
|
87
75
|
*/
|
|
88
|
-
handleChainStart?(chain: Serialized, inputs: ChainValues, runId: string, parentRunId?: string, tags?: string[], metadata?: Record<string, unknown>, runType?: string, runName?: string):
|
|
89
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
90
|
-
Promise<any> | any;
|
|
76
|
+
handleChainStart?(chain: Serialized, inputs: ChainValues, runId: string, parentRunId?: string, tags?: string[], metadata?: Record<string, unknown>, runType?: string, runName?: string): Promise<any> | any;
|
|
91
77
|
/**
|
|
92
78
|
* Called if a Chain run encounters an error
|
|
93
79
|
*/
|
|
94
80
|
handleChainError?(err: Error, runId: string, parentRunId?: string, tags?: string[], kwargs?: {
|
|
95
81
|
inputs?: Record<string, unknown>;
|
|
96
|
-
}):
|
|
97
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
98
|
-
Promise<any> | any;
|
|
82
|
+
}): Promise<any> | any;
|
|
99
83
|
/**
|
|
100
84
|
* Called at the end of a Chain run, with the outputs and the run ID.
|
|
101
85
|
*/
|
|
102
86
|
handleChainEnd?(outputs: ChainValues, runId: string, parentRunId?: string, tags?: string[], kwargs?: {
|
|
103
87
|
inputs?: Record<string, unknown>;
|
|
104
|
-
}):
|
|
105
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
106
|
-
Promise<any> | any;
|
|
88
|
+
}): Promise<any> | any;
|
|
107
89
|
/**
|
|
108
90
|
* Called at the start of a Tool run, with the tool name and input
|
|
109
91
|
* and the run ID.
|
|
110
92
|
*/
|
|
111
|
-
handleToolStart?(tool: Serialized, input: string, runId: string, parentRunId?: string, tags?: string[], metadata?: Record<string, unknown>, runName?: string):
|
|
112
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
113
|
-
Promise<any> | any;
|
|
93
|
+
handleToolStart?(tool: Serialized, input: string, runId: string, parentRunId?: string, tags?: string[], metadata?: Record<string, unknown>, runName?: string): Promise<any> | any;
|
|
114
94
|
/**
|
|
115
95
|
* Called if a Tool run encounters an error
|
|
116
96
|
*/
|
|
117
|
-
handleToolError?(err: Error, runId: string, parentRunId?: string, tags?: string[]):
|
|
118
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
119
|
-
Promise<any> | any;
|
|
97
|
+
handleToolError?(err: Error, runId: string, parentRunId?: string, tags?: string[]): Promise<any> | any;
|
|
120
98
|
/**
|
|
121
99
|
* Called at the end of a Tool run, with the tool output and the run ID.
|
|
122
100
|
*/
|
|
123
|
-
handleToolEnd?(
|
|
124
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
125
|
-
output: any, runId: string, parentRunId?: string, tags?: string[]):
|
|
126
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
127
|
-
Promise<any> | any;
|
|
101
|
+
handleToolEnd?(output: any, runId: string, parentRunId?: string, tags?: string[]): Promise<any> | any;
|
|
128
102
|
handleText?(text: string, runId: string, parentRunId?: string, tags?: string[]): Promise<void> | void;
|
|
129
103
|
/**
|
|
130
104
|
* Called when an agent is about to execute an action,
|
|
@@ -136,22 +110,10 @@ declare abstract class BaseCallbackHandlerMethodsClass {
|
|
|
136
110
|
* with the final output and the run ID.
|
|
137
111
|
*/
|
|
138
112
|
handleAgentEnd?(action: AgentFinish, runId: string, parentRunId?: string, tags?: string[]): Promise<void> | void;
|
|
139
|
-
handleRetrieverStart?(retriever: Serialized, query: string, runId: string, parentRunId?: string, tags?: string[], metadata?: Record<string, unknown>, name?: string):
|
|
140
|
-
|
|
141
|
-
Promise<any> | any;
|
|
142
|
-
|
|
143
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
144
|
-
Promise<any> | any;
|
|
145
|
-
handleRetrieverError?(err: Error, runId: string, parentRunId?: string, tags?: string[]):
|
|
146
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
147
|
-
Promise<any> | any;
|
|
148
|
-
handleCustomEvent?(eventName: string,
|
|
149
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
150
|
-
data: any, runId: string, tags?: string[],
|
|
151
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
152
|
-
metadata?: Record<string, any>):
|
|
153
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
154
|
-
Promise<any> | any;
|
|
113
|
+
handleRetrieverStart?(retriever: Serialized, query: string, runId: string, parentRunId?: string, tags?: string[], metadata?: Record<string, unknown>, name?: string): Promise<any> | any;
|
|
114
|
+
handleRetrieverEnd?(documents: DocumentInterface[], runId: string, parentRunId?: string, tags?: string[]): Promise<any> | any;
|
|
115
|
+
handleRetrieverError?(err: Error, runId: string, parentRunId?: string, tags?: string[]): Promise<any> | any;
|
|
116
|
+
handleCustomEvent?(eventName: string, data: any, runId: string, tags?: string[], metadata?: Record<string, any>): Promise<any> | any;
|
|
155
117
|
}
|
|
156
118
|
/**
|
|
157
119
|
* Base interface for callbacks. All methods are optional. If a method is not
|
|
@@ -216,6 +178,7 @@ declare abstract class BaseCallbackHandler extends BaseCallbackHandlerMethodsCla
|
|
|
216
178
|
toJSON(): Serialized;
|
|
217
179
|
toJSONNotImplemented(): SerializedNotImplemented;
|
|
218
180
|
static fromMethods(methods: CallbackHandlerMethods): {
|
|
181
|
+
name: string;
|
|
219
182
|
/**
|
|
220
183
|
* Called at the start of an LLM or Chat Model run, with the prompt(s)
|
|
221
184
|
* and the run ID.
|
|
@@ -284,21 +247,21 @@ declare abstract class BaseCallbackHandler extends BaseCallbackHandlerMethodsCla
|
|
|
284
247
|
handleRetrieverError?(err: any, runId: string, parentRunId?: string | undefined, tags?: string[] | undefined): any;
|
|
285
248
|
handleCustomEvent?(eventName: string, data: any, runId: string, tags?: string[] | undefined, metadata?: Record<string, any> | undefined): any;
|
|
286
249
|
lc_serializable: boolean;
|
|
287
|
-
|
|
288
|
-
|
|
250
|
+
get lc_namespace(): ["langchain_core", "callbacks", string];
|
|
251
|
+
get lc_secrets(): {
|
|
289
252
|
[key: string]: string;
|
|
290
253
|
} | undefined;
|
|
291
|
-
|
|
254
|
+
get lc_attributes(): {
|
|
292
255
|
[key: string]: string;
|
|
293
256
|
} | undefined;
|
|
294
|
-
|
|
257
|
+
get lc_aliases(): {
|
|
295
258
|
[key: string]: string;
|
|
296
259
|
} | undefined;
|
|
297
|
-
|
|
260
|
+
get lc_serializable_keys(): string[] | undefined;
|
|
298
261
|
/**
|
|
299
262
|
* The final serialized identifier for the module.
|
|
300
263
|
*/
|
|
301
|
-
|
|
264
|
+
get lc_id(): string[];
|
|
302
265
|
lc_kwargs: SerializedFields;
|
|
303
266
|
ignoreLLM: boolean;
|
|
304
267
|
ignoreChain: boolean;
|
|
@@ -310,7 +273,6 @@ declare abstract class BaseCallbackHandler extends BaseCallbackHandlerMethodsCla
|
|
|
310
273
|
copy(): BaseCallbackHandler;
|
|
311
274
|
toJSON(): Serialized;
|
|
312
275
|
toJSONNotImplemented(): SerializedNotImplemented;
|
|
313
|
-
name: string;
|
|
314
276
|
};
|
|
315
277
|
}
|
|
316
278
|
declare const isBaseCallbackHandler: (x: unknown) => boolean;
|
|
@@ -35,9 +35,7 @@ import { RunnableConfig } from "../../runnables/types.cjs";
|
|
|
35
35
|
* await foo.invoke("hi", { callbacks })
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
38
|
-
declare function dispatchCustomEvent(eventName: string,
|
|
39
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
40
|
-
payload: any, config?: RunnableConfig): Promise<void>;
|
|
38
|
+
declare function dispatchCustomEvent(eventName: string, payload: any, config?: RunnableConfig): Promise<void>;
|
|
41
39
|
//#endregion
|
|
42
40
|
export { dispatchCustomEvent };
|
|
43
41
|
//# sourceMappingURL=index.d.cts.map
|
|
@@ -36,9 +36,7 @@ import "../../runnables/config.js";
|
|
|
36
36
|
* await foo.invoke("hi", { callbacks })
|
|
37
37
|
* ```
|
|
38
38
|
*/
|
|
39
|
-
declare function dispatchCustomEvent(eventName: string,
|
|
40
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41
|
-
payload: any, config?: RunnableConfig): Promise<void>;
|
|
39
|
+
declare function dispatchCustomEvent(eventName: string, payload: any, config?: RunnableConfig): Promise<void>;
|
|
42
40
|
//#endregion
|
|
43
41
|
export { dispatchCustomEvent };
|
|
44
42
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -32,9 +32,7 @@ import { RunnableConfig } from "../../runnables/types.cjs";
|
|
|
32
32
|
* await foo.invoke("hi", { callbacks })
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
|
-
declare function dispatchCustomEvent(name: string,
|
|
36
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
37
|
-
payload: any, config?: RunnableConfig): Promise<void>;
|
|
35
|
+
declare function dispatchCustomEvent(name: string, payload: any, config?: RunnableConfig): Promise<void>;
|
|
38
36
|
//#endregion
|
|
39
37
|
export { dispatchCustomEvent };
|
|
40
38
|
//# sourceMappingURL=web.d.cts.map
|
|
@@ -33,9 +33,7 @@ import "../../runnables/config.js";
|
|
|
33
33
|
* await foo.invoke("hi", { callbacks })
|
|
34
34
|
* ```
|
|
35
35
|
*/
|
|
36
|
-
declare function dispatchCustomEvent(name: string,
|
|
37
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
38
|
-
payload: any, config?: RunnableConfig): Promise<void>;
|
|
36
|
+
declare function dispatchCustomEvent(name: string, payload: any, config?: RunnableConfig): Promise<void>;
|
|
39
37
|
//#endregion
|
|
40
38
|
export { dispatchCustomEvent };
|
|
41
39
|
//# sourceMappingURL=web.d.ts.map
|
|
@@ -64,11 +64,7 @@ declare class BaseRunManager {
|
|
|
64
64
|
constructor(runId: string, handlers: BaseCallbackHandler[], inheritableHandlers: BaseCallbackHandler[], tags: string[], inheritableTags: string[], metadata: Record<string, unknown>, inheritableMetadata: Record<string, unknown>, _parentRunId?: string | undefined);
|
|
65
65
|
get parentRunId(): string | undefined;
|
|
66
66
|
handleText(text: string): Promise<void>;
|
|
67
|
-
handleCustomEvent(eventName: string,
|
|
68
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
69
|
-
data: any, _runId?: string, _tags?: string[],
|
|
70
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
71
|
-
_metadata?: Record<string, any>): Promise<void>;
|
|
67
|
+
handleCustomEvent(eventName: string, data: any, _runId?: string, _tags?: string[], _metadata?: Record<string, any>): Promise<void>;
|
|
72
68
|
}
|
|
73
69
|
/**
|
|
74
70
|
* Manages callbacks for retriever runs.
|
|
@@ -97,7 +93,6 @@ declare class CallbackManagerForChainRun extends BaseRunManager implements BaseC
|
|
|
97
93
|
declare class CallbackManagerForToolRun extends BaseRunManager implements BaseCallbackManagerMethods {
|
|
98
94
|
getChild(tag?: string): CallbackManager;
|
|
99
95
|
handleToolError(err: Error | unknown): Promise<void>;
|
|
100
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
101
96
|
handleToolEnd(output: any): Promise<void>;
|
|
102
97
|
}
|
|
103
98
|
/**
|
|
@@ -146,11 +141,7 @@ declare class CallbackManager extends BaseCallbackManager implements BaseCallbac
|
|
|
146
141
|
handleChainStart(chain: Serialized, inputs: ChainValues, runId?: string, runType?: string | undefined, _tags?: string[] | undefined, _metadata?: Record<string, unknown> | undefined, runName?: string | undefined): Promise<CallbackManagerForChainRun>;
|
|
147
142
|
handleToolStart(tool: Serialized, input: string, runId?: string, _parentRunId?: string | undefined, _tags?: string[] | undefined, _metadata?: Record<string, unknown> | undefined, runName?: string | undefined): Promise<CallbackManagerForToolRun>;
|
|
148
143
|
handleRetrieverStart(retriever: Serialized, query: string, runId?: string, _parentRunId?: string | undefined, _tags?: string[] | undefined, _metadata?: Record<string, unknown> | undefined, runName?: string | undefined): Promise<CallbackManagerForRetrieverRun>;
|
|
149
|
-
handleCustomEvent?(eventName: string,
|
|
150
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
151
|
-
data: any, runId: string, _tags?: string[],
|
|
152
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
153
|
-
_metadata?: Record<string, any>): Promise<any>;
|
|
144
|
+
handleCustomEvent?(eventName: string, data: any, runId: string, _tags?: string[], _metadata?: Record<string, any>): Promise<any>;
|
|
154
145
|
addHandler(handler: BaseCallbackHandler, inherit?: boolean): void;
|
|
155
146
|
removeHandler(handler: BaseCallbackHandler): void;
|
|
156
147
|
setHandlers(handlers: BaseCallbackHandler[], inherit?: boolean): void;
|
|
@@ -161,7 +152,6 @@ declare class CallbackManager extends BaseCallbackManager implements BaseCallbac
|
|
|
161
152
|
copy(additionalHandlers?: BaseCallbackHandler[], inherit?: boolean): CallbackManager;
|
|
162
153
|
static fromHandlers(handlers: CallbackHandlerMethods): CallbackManager;
|
|
163
154
|
static configure(inheritableHandlers?: Callbacks, localHandlers?: Callbacks, inheritableTags?: string[], localTags?: string[], inheritableMetadata?: Record<string, unknown>, localMetadata?: Record<string, unknown>, options?: CallbackManagerOptions): CallbackManager | undefined;
|
|
164
|
-
// TODO: Deprecate async method in favor of this one.
|
|
165
155
|
static _configureSync(inheritableHandlers?: Callbacks, localHandlers?: Callbacks, inheritableTags?: string[], localTags?: string[], inheritableMetadata?: Record<string, unknown>, localMetadata?: Record<string, unknown>, options?: CallbackManagerOptions): CallbackManager | undefined;
|
|
166
156
|
}
|
|
167
157
|
declare function ensureHandler(handler: BaseCallbackHandler | CallbackHandlerMethods): BaseCallbackHandler;
|
|
@@ -64,11 +64,7 @@ declare class BaseRunManager {
|
|
|
64
64
|
constructor(runId: string, handlers: BaseCallbackHandler[], inheritableHandlers: BaseCallbackHandler[], tags: string[], inheritableTags: string[], metadata: Record<string, unknown>, inheritableMetadata: Record<string, unknown>, _parentRunId?: string | undefined);
|
|
65
65
|
get parentRunId(): string | undefined;
|
|
66
66
|
handleText(text: string): Promise<void>;
|
|
67
|
-
handleCustomEvent(eventName: string,
|
|
68
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
69
|
-
data: any, _runId?: string, _tags?: string[],
|
|
70
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
71
|
-
_metadata?: Record<string, any>): Promise<void>;
|
|
67
|
+
handleCustomEvent(eventName: string, data: any, _runId?: string, _tags?: string[], _metadata?: Record<string, any>): Promise<void>;
|
|
72
68
|
}
|
|
73
69
|
/**
|
|
74
70
|
* Manages callbacks for retriever runs.
|
|
@@ -97,7 +93,6 @@ declare class CallbackManagerForChainRun extends BaseRunManager implements BaseC
|
|
|
97
93
|
declare class CallbackManagerForToolRun extends BaseRunManager implements BaseCallbackManagerMethods {
|
|
98
94
|
getChild(tag?: string): CallbackManager;
|
|
99
95
|
handleToolError(err: Error | unknown): Promise<void>;
|
|
100
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
101
96
|
handleToolEnd(output: any): Promise<void>;
|
|
102
97
|
}
|
|
103
98
|
/**
|
|
@@ -146,11 +141,7 @@ declare class CallbackManager extends BaseCallbackManager implements BaseCallbac
|
|
|
146
141
|
handleChainStart(chain: Serialized, inputs: ChainValues, runId?: string, runType?: string | undefined, _tags?: string[] | undefined, _metadata?: Record<string, unknown> | undefined, runName?: string | undefined): Promise<CallbackManagerForChainRun>;
|
|
147
142
|
handleToolStart(tool: Serialized, input: string, runId?: string, _parentRunId?: string | undefined, _tags?: string[] | undefined, _metadata?: Record<string, unknown> | undefined, runName?: string | undefined): Promise<CallbackManagerForToolRun>;
|
|
148
143
|
handleRetrieverStart(retriever: Serialized, query: string, runId?: string, _parentRunId?: string | undefined, _tags?: string[] | undefined, _metadata?: Record<string, unknown> | undefined, runName?: string | undefined): Promise<CallbackManagerForRetrieverRun>;
|
|
149
|
-
handleCustomEvent?(eventName: string,
|
|
150
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
151
|
-
data: any, runId: string, _tags?: string[],
|
|
152
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
153
|
-
_metadata?: Record<string, any>): Promise<any>;
|
|
144
|
+
handleCustomEvent?(eventName: string, data: any, runId: string, _tags?: string[], _metadata?: Record<string, any>): Promise<any>;
|
|
154
145
|
addHandler(handler: BaseCallbackHandler, inherit?: boolean): void;
|
|
155
146
|
removeHandler(handler: BaseCallbackHandler): void;
|
|
156
147
|
setHandlers(handlers: BaseCallbackHandler[], inherit?: boolean): void;
|
|
@@ -161,7 +152,6 @@ declare class CallbackManager extends BaseCallbackManager implements BaseCallbac
|
|
|
161
152
|
copy(additionalHandlers?: BaseCallbackHandler[], inherit?: boolean): CallbackManager;
|
|
162
153
|
static fromHandlers(handlers: CallbackHandlerMethods): CallbackManager;
|
|
163
154
|
static configure(inheritableHandlers?: Callbacks, localHandlers?: Callbacks, inheritableTags?: string[], localTags?: string[], inheritableMetadata?: Record<string, unknown>, localMetadata?: Record<string, unknown>, options?: CallbackManagerOptions): CallbackManager | undefined;
|
|
164
|
-
// TODO: Deprecate async method in favor of this one.
|
|
165
155
|
static _configureSync(inheritableHandlers?: Callbacks, localHandlers?: Callbacks, inheritableTags?: string[], localTags?: string[], inheritableMetadata?: Record<string, unknown>, localMetadata?: Record<string, unknown>, options?: CallbackManagerOptions): CallbackManager | undefined;
|
|
166
156
|
}
|
|
167
157
|
declare function ensureHandler(handler: BaseCallbackHandler | CallbackHandlerMethods): BaseCallbackHandler;
|
package/dist/chat_history.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_load_serializable = require('./load/serializable.cjs');
|
|
3
|
-
const require_ai = require('./messages/ai.cjs');
|
|
4
3
|
const require_human = require('./messages/human.cjs');
|
|
4
|
+
const require_ai = require('./messages/ai.cjs');
|
|
5
5
|
require('./messages/index.cjs');
|
|
6
6
|
|
|
7
7
|
//#region src/chat_history.ts
|
package/dist/chat_history.d.cts
CHANGED
package/dist/chat_history.d.ts
CHANGED
package/dist/chat_history.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __export } from "./_virtual/rolldown_runtime.js";
|
|
2
2
|
import { Serializable } from "./load/serializable.js";
|
|
3
|
-
import { AIMessage } from "./messages/ai.js";
|
|
4
3
|
import { HumanMessage } from "./messages/human.js";
|
|
4
|
+
import { AIMessage } from "./messages/ai.js";
|
|
5
5
|
import "./messages/index.js";
|
|
6
6
|
|
|
7
7
|
//#region src/chat_history.ts
|
|
@@ -5,7 +5,6 @@ import { KVMap } from "langsmith/schemas";
|
|
|
5
5
|
import { Client } from "langsmith";
|
|
6
6
|
|
|
7
7
|
//#region src/document_loaders/langsmith.d.ts
|
|
8
|
-
// TODO: Replace with import from `langsmith` once exposed.
|
|
9
8
|
interface ClientConfig {
|
|
10
9
|
apiUrl?: string;
|
|
11
10
|
apiKey?: string;
|
|
@@ -31,7 +30,6 @@ interface LangSmithLoaderFields {
|
|
|
31
30
|
metadata?: KVMap;
|
|
32
31
|
filter?: string;
|
|
33
32
|
contentKey?: string;
|
|
34
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
35
33
|
formatContent?: (content: any) => string;
|
|
36
34
|
client?: Client;
|
|
37
35
|
clientConfig?: ClientConfig;
|
|
@@ -92,7 +90,6 @@ declare class LangSmithLoader extends BaseDocumentLoader {
|
|
|
92
90
|
metadata?: KVMap;
|
|
93
91
|
filter?: string;
|
|
94
92
|
contentKey: string[];
|
|
95
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
96
93
|
formatContent: (content: any) => string;
|
|
97
94
|
client: Client;
|
|
98
95
|
constructor(fields: LangSmithLoaderFields);
|
|
@@ -5,7 +5,6 @@ import { Client } from "langsmith";
|
|
|
5
5
|
import { KVMap } from "langsmith/schemas";
|
|
6
6
|
|
|
7
7
|
//#region src/document_loaders/langsmith.d.ts
|
|
8
|
-
// TODO: Replace with import from `langsmith` once exposed.
|
|
9
8
|
interface ClientConfig {
|
|
10
9
|
apiUrl?: string;
|
|
11
10
|
apiKey?: string;
|
|
@@ -31,7 +30,6 @@ interface LangSmithLoaderFields {
|
|
|
31
30
|
metadata?: KVMap;
|
|
32
31
|
filter?: string;
|
|
33
32
|
contentKey?: string;
|
|
34
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
35
33
|
formatContent?: (content: any) => string;
|
|
36
34
|
client?: Client;
|
|
37
35
|
clientConfig?: ClientConfig;
|
|
@@ -92,7 +90,6 @@ declare class LangSmithLoader extends BaseDocumentLoader {
|
|
|
92
90
|
metadata?: KVMap;
|
|
93
91
|
filter?: string;
|
|
94
92
|
contentKey: string[];
|
|
95
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
96
93
|
formatContent: (content: any) => string;
|
|
97
94
|
client: Client;
|
|
98
95
|
constructor(fields: LangSmithLoaderFields);
|