langchain 1.5.15 → 1.5.17
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 +16 -0
- package/dist/agents/ReactAgent.cjs +1 -1
- package/dist/agents/ReactAgent.cjs.map +1 -1
- package/dist/agents/ReactAgent.d.cts +1 -2
- package/dist/agents/ReactAgent.d.cts.map +1 -1
- package/dist/agents/ReactAgent.d.ts +1 -2
- package/dist/agents/ReactAgent.d.ts.map +1 -1
- package/dist/agents/ReactAgent.js +2 -2
- package/dist/agents/ReactAgent.js.map +1 -1
- package/dist/agents/constants.d.cts +2 -3
- package/dist/agents/constants.d.cts.map +1 -1
- package/dist/agents/constants.d.ts +2 -3
- package/dist/agents/constants.d.ts.map +1 -1
- package/dist/agents/errors.d.cts +5 -6
- package/dist/agents/errors.d.cts.map +1 -1
- package/dist/agents/errors.d.ts +5 -6
- package/dist/agents/errors.d.ts.map +1 -1
- package/dist/agents/index.d.cts +14 -14
- package/dist/agents/index.d.cts.map +1 -1
- package/dist/agents/index.d.ts +14 -14
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/middleware/contextEditing.d.cts +5 -6
- package/dist/agents/middleware/contextEditing.d.cts.map +1 -1
- package/dist/agents/middleware/contextEditing.d.ts +5 -6
- package/dist/agents/middleware/contextEditing.d.ts.map +1 -1
- package/dist/agents/middleware/dynamicSystemPrompt.d.cts +2 -3
- package/dist/agents/middleware/dynamicSystemPrompt.d.cts.map +1 -1
- package/dist/agents/middleware/dynamicSystemPrompt.d.ts +2 -3
- package/dist/agents/middleware/dynamicSystemPrompt.d.ts.map +1 -1
- package/dist/agents/middleware/hitl.cjs +24 -8
- package/dist/agents/middleware/hitl.cjs.map +1 -1
- package/dist/agents/middleware/hitl.d.cts +40 -30
- package/dist/agents/middleware/hitl.d.cts.map +1 -1
- package/dist/agents/middleware/hitl.d.ts +40 -30
- package/dist/agents/middleware/hitl.d.ts.map +1 -1
- package/dist/agents/middleware/hitl.js +24 -8
- package/dist/agents/middleware/hitl.js.map +1 -1
- package/dist/agents/middleware/index.d.cts +2 -2
- package/dist/agents/middleware/index.d.ts +2 -2
- package/dist/agents/middleware/llmToolSelector.d.cts +3 -4
- package/dist/agents/middleware/llmToolSelector.d.cts.map +1 -1
- package/dist/agents/middleware/llmToolSelector.d.ts +3 -4
- package/dist/agents/middleware/llmToolSelector.d.ts.map +1 -1
- package/dist/agents/middleware/modelCallLimit.d.cts +2 -3
- package/dist/agents/middleware/modelCallLimit.d.cts.map +1 -1
- package/dist/agents/middleware/modelCallLimit.d.ts +2 -3
- package/dist/agents/middleware/modelCallLimit.d.ts.map +1 -1
- package/dist/agents/middleware/modelFallback.d.cts +1 -2
- package/dist/agents/middleware/modelFallback.d.cts.map +1 -1
- package/dist/agents/middleware/modelFallback.d.ts +1 -2
- package/dist/agents/middleware/modelFallback.d.ts.map +1 -1
- package/dist/agents/middleware/modelRetry.d.cts +3 -4
- package/dist/agents/middleware/modelRetry.d.cts.map +1 -1
- package/dist/agents/middleware/modelRetry.d.ts +3 -4
- package/dist/agents/middleware/modelRetry.d.ts.map +1 -1
- package/dist/agents/middleware/pii.d.cts +17 -18
- package/dist/agents/middleware/pii.d.cts.map +1 -1
- package/dist/agents/middleware/pii.d.ts +17 -18
- package/dist/agents/middleware/pii.d.ts.map +1 -1
- package/dist/agents/middleware/piiRedaction.d.cts +2 -3
- package/dist/agents/middleware/piiRedaction.d.cts.map +1 -1
- package/dist/agents/middleware/piiRedaction.d.ts +2 -3
- package/dist/agents/middleware/piiRedaction.d.ts.map +1 -1
- package/dist/agents/middleware/provider/anthropic/promptCaching.d.cts +2 -3
- package/dist/agents/middleware/provider/anthropic/promptCaching.d.cts.map +1 -1
- package/dist/agents/middleware/provider/anthropic/promptCaching.d.ts +2 -3
- package/dist/agents/middleware/provider/anthropic/promptCaching.d.ts.map +1 -1
- package/dist/agents/middleware/provider/aws/promptCaching.d.cts +2 -3
- package/dist/agents/middleware/provider/aws/promptCaching.d.cts.map +1 -1
- package/dist/agents/middleware/provider/aws/promptCaching.d.ts +2 -3
- package/dist/agents/middleware/provider/aws/promptCaching.d.ts.map +1 -1
- package/dist/agents/middleware/provider/openai/moderation.d.cts +2 -3
- package/dist/agents/middleware/provider/openai/moderation.d.cts.map +1 -1
- package/dist/agents/middleware/provider/openai/moderation.d.ts +2 -3
- package/dist/agents/middleware/provider/openai/moderation.d.ts.map +1 -1
- package/dist/agents/middleware/providerToolSearch.d.cts +3 -4
- package/dist/agents/middleware/providerToolSearch.d.cts.map +1 -1
- package/dist/agents/middleware/providerToolSearch.d.ts +3 -4
- package/dist/agents/middleware/providerToolSearch.d.ts.map +1 -1
- package/dist/agents/middleware/summarization.d.cts +7 -8
- package/dist/agents/middleware/summarization.d.cts.map +1 -1
- package/dist/agents/middleware/summarization.d.ts +7 -8
- package/dist/agents/middleware/summarization.d.ts.map +1 -1
- package/dist/agents/middleware/todoListMiddleware.d.cts +4 -5
- package/dist/agents/middleware/todoListMiddleware.d.cts.map +1 -1
- package/dist/agents/middleware/todoListMiddleware.d.ts +4 -5
- package/dist/agents/middleware/todoListMiddleware.d.ts.map +1 -1
- package/dist/agents/middleware/toolCallLimit.d.cts +4 -5
- package/dist/agents/middleware/toolCallLimit.d.cts.map +1 -1
- package/dist/agents/middleware/toolCallLimit.d.ts +4 -5
- package/dist/agents/middleware/toolCallLimit.d.ts.map +1 -1
- package/dist/agents/middleware/toolEmulator.d.cts +2 -3
- package/dist/agents/middleware/toolEmulator.d.cts.map +1 -1
- package/dist/agents/middleware/toolEmulator.d.ts +2 -3
- package/dist/agents/middleware/toolEmulator.d.ts.map +1 -1
- package/dist/agents/middleware/toolError.d.cts +3 -4
- package/dist/agents/middleware/toolError.d.cts.map +1 -1
- package/dist/agents/middleware/toolError.d.ts +3 -4
- package/dist/agents/middleware/toolError.d.ts.map +1 -1
- package/dist/agents/middleware/toolRetry.d.cts +3 -4
- package/dist/agents/middleware/toolRetry.d.cts.map +1 -1
- package/dist/agents/middleware/toolRetry.d.ts +3 -4
- package/dist/agents/middleware/toolRetry.d.ts.map +1 -1
- package/dist/agents/middleware/types.d.cts +42 -43
- package/dist/agents/middleware/types.d.cts.map +1 -1
- package/dist/agents/middleware/types.d.ts +42 -43
- package/dist/agents/middleware/types.d.ts.map +1 -1
- package/dist/agents/middleware/utils.d.cts +1 -2
- package/dist/agents/middleware/utils.d.cts.map +1 -1
- package/dist/agents/middleware/utils.d.ts +1 -2
- package/dist/agents/middleware/utils.d.ts.map +1 -1
- package/dist/agents/middleware.d.cts +1 -2
- package/dist/agents/middleware.d.cts.map +1 -1
- package/dist/agents/middleware.d.ts +1 -2
- package/dist/agents/middleware.d.ts.map +1 -1
- package/dist/agents/model.d.cts +1 -2
- package/dist/agents/model.d.cts.map +1 -1
- package/dist/agents/model.d.ts +1 -2
- package/dist/agents/model.d.ts.map +1 -1
- package/dist/agents/nodes/types.d.cts +1 -2
- package/dist/agents/nodes/types.d.cts.map +1 -1
- package/dist/agents/nodes/types.d.ts +1 -2
- package/dist/agents/nodes/types.d.ts.map +1 -1
- package/dist/agents/responses.d.cts +18 -19
- package/dist/agents/responses.d.cts.map +1 -1
- package/dist/agents/responses.d.ts +18 -19
- package/dist/agents/responses.d.ts.map +1 -1
- package/dist/agents/runtime.d.cts +6 -6
- package/dist/agents/runtime.d.cts.map +1 -1
- package/dist/agents/runtime.d.ts +6 -6
- package/dist/agents/runtime.d.ts.map +1 -1
- package/dist/agents/tests/utils.d.cts +1 -2
- package/dist/agents/tests/utils.d.cts.map +1 -1
- package/dist/agents/tests/utils.d.ts +1 -2
- package/dist/agents/tests/utils.d.ts.map +1 -1
- package/dist/agents/transformers/subagent.d.cts +1 -2
- package/dist/agents/transformers/subagent.d.cts.map +1 -1
- package/dist/agents/transformers/subagent.d.ts +1 -2
- package/dist/agents/transformers/subagent.d.ts.map +1 -1
- package/dist/agents/transformers/tool-call.d.cts +1 -2
- package/dist/agents/transformers/tool-call.d.cts.map +1 -1
- package/dist/agents/transformers/tool-call.d.ts +1 -2
- package/dist/agents/transformers/tool-call.d.ts.map +1 -1
- package/dist/agents/transformers/types.d.cts +4 -5
- package/dist/agents/transformers/types.d.cts.map +1 -1
- package/dist/agents/transformers/types.d.ts +4 -5
- package/dist/agents/transformers/types.d.ts.map +1 -1
- package/dist/agents/types.d.cts +30 -30
- package/dist/agents/types.d.cts.map +1 -1
- package/dist/agents/types.d.ts +30 -30
- package/dist/agents/types.d.ts.map +1 -1
- package/dist/browser.d.cts +2 -2
- package/dist/browser.d.ts +2 -2
- package/dist/chat_models/universal.d.cts +11 -12
- package/dist/chat_models/universal.d.cts.map +1 -1
- package/dist/chat_models/universal.d.ts +11 -12
- package/dist/chat_models/universal.d.ts.map +1 -1
- package/dist/hub/base.d.cts +1 -2
- package/dist/hub/base.d.cts.map +1 -1
- package/dist/hub/base.d.ts +1 -2
- package/dist/hub/base.d.ts.map +1 -1
- package/dist/hub/index.d.cts +2 -2
- package/dist/hub/index.d.cts.map +1 -1
- package/dist/hub/index.d.ts +2 -2
- package/dist/hub/index.d.ts.map +1 -1
- package/dist/hub/node.d.cts +3 -3
- package/dist/hub/node.d.cts.map +1 -1
- package/dist/hub/node.d.ts +3 -3
- package/dist/hub/node.d.ts.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/load/import_type.d.cts +1 -2
- package/dist/load/import_type.d.cts.map +1 -1
- package/dist/load/import_type.d.ts +1 -2
- package/dist/load/import_type.d.ts.map +1 -1
- package/dist/load/index.d.cts +1 -2
- package/dist/load/index.d.cts.map +1 -1
- package/dist/load/index.d.ts +1 -2
- package/dist/load/index.d.ts.map +1 -1
- package/dist/storage/encoder_backed.d.cts +2 -3
- package/dist/storage/encoder_backed.d.cts.map +1 -1
- package/dist/storage/encoder_backed.d.ts +2 -3
- package/dist/storage/encoder_backed.d.ts.map +1 -1
- package/dist/storage/file_system.d.cts +1 -2
- package/dist/storage/file_system.d.cts.map +1 -1
- package/dist/storage/file_system.d.ts +1 -2
- package/dist/storage/file_system.d.ts.map +1 -1
- package/dist/tools/headless.d.cts +4 -4
- package/dist/tools/headless.d.cts.map +1 -1
- package/dist/tools/headless.d.ts +4 -4
- package/dist/tools/headless.d.ts.map +1 -1
- package/package.json +19 -19
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moderation.d.cts","names":[],"sources":["../../../../../src/agents/middleware/provider/openai/moderation.ts"],"mappings":";;;KA6FK;;;;
|
|
1
|
+
{"version":3,"file":"moderation.d.cts","names":[],"sources":["../../../../../src/agents/middleware/provider/openai/moderation.ts"],"mappings":";;;KA6FK;;;;iBAsCY;;;;;;;;;;;;;;;;;;;;;EAqBf,gBAAgB;;;;;EAMhB,kBAAkB;;;;;EAMlB;;;;;EAMA;;;;;EAMA;;;;;;;;EASA;;;;;EAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA+Dc,2BACd,SAAS,oCACR"}
|
|
@@ -5,7 +5,7 @@ type ModerationModel = "omni-moderation-latest" | "omni-moderation-2024-09-26" |
|
|
|
5
5
|
/**
|
|
6
6
|
* Options for configuring the OpenAI Moderation middleware.
|
|
7
7
|
*/
|
|
8
|
-
interface OpenAIModerationMiddlewareOptions {
|
|
8
|
+
export interface OpenAIModerationMiddlewareOptions {
|
|
9
9
|
/**
|
|
10
10
|
* OpenAI model to use for moderation. Can be either a model name or a BaseChatModel instance.
|
|
11
11
|
* @example
|
|
@@ -121,7 +121,6 @@ interface OpenAIModerationMiddlewareOptions {
|
|
|
121
121
|
* });
|
|
122
122
|
* ```
|
|
123
123
|
*/
|
|
124
|
-
declare function openAIModerationMiddleware(options: OpenAIModerationMiddlewareOptions): AgentMiddleware;
|
|
124
|
+
export declare function openAIModerationMiddleware(options: OpenAIModerationMiddlewareOptions): AgentMiddleware;
|
|
125
125
|
//#endregion
|
|
126
|
-
export { OpenAIModerationMiddlewareOptions, openAIModerationMiddleware };
|
|
127
126
|
//# sourceMappingURL=moderation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moderation.d.ts","names":[],"sources":["../../../../../src/agents/middleware/provider/openai/moderation.ts"],"mappings":";;;KA6FK;;;;
|
|
1
|
+
{"version":3,"file":"moderation.d.ts","names":[],"sources":["../../../../../src/agents/middleware/provider/openai/moderation.ts"],"mappings":";;;KA6FK;;;;iBAsCY;;;;;;;;;;;;;;;;;;;;;EAqBf,gBAAgB;;;;;EAMhB,kBAAkB;;;;;EAMlB;;;;;EAMA;;;;;EAMA;;;;;;;;EASA;;;;;EAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA+Dc,2BACd,SAAS,oCACR"}
|
|
@@ -2,8 +2,8 @@ import { AgentMiddleware } from "./types.cjs";
|
|
|
2
2
|
import { ClientTool, ServerTool, StructuredToolInterface } from "@langchain/core/tools";
|
|
3
3
|
//#region src/agents/middleware/providerToolSearch.d.ts
|
|
4
4
|
type ToolName = string;
|
|
5
|
-
type ToolIdentifier = ToolName | StructuredToolInterface;
|
|
6
|
-
type ProviderToolSearchMiddlewareConfig = {
|
|
5
|
+
export type ToolIdentifier = ToolName | StructuredToolInterface;
|
|
6
|
+
export type ProviderToolSearchMiddlewareConfig = {
|
|
7
7
|
/**
|
|
8
8
|
* Which tools are deferred; withheld from the model until its tool search surfaces them.
|
|
9
9
|
*
|
|
@@ -68,7 +68,6 @@ type ProviderToolSearchMiddlewareConfig = {
|
|
|
68
68
|
* @param config.searchableTools - Tools to defer behind tool search
|
|
69
69
|
* @returns A middleware instance that can be used with `createAgent`
|
|
70
70
|
*/
|
|
71
|
-
declare function providerToolSearchMiddleware(config?: ProviderToolSearchMiddlewareConfig): AgentMiddleware<undefined, undefined, unknown, readonly (ServerTool | ClientTool)[], readonly []>;
|
|
71
|
+
export declare function providerToolSearchMiddleware(config?: ProviderToolSearchMiddlewareConfig): AgentMiddleware<undefined, undefined, unknown, readonly (ServerTool | ClientTool)[], readonly []>;
|
|
72
72
|
//#endregion
|
|
73
|
-
export { ProviderToolSearchMiddlewareConfig, ToolIdentifier, providerToolSearchMiddleware };
|
|
74
73
|
//# sourceMappingURL=providerToolSearch.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providerToolSearch.d.cts","names":[],"sources":["../../../src/agents/middleware/providerToolSearch.ts"],"mappings":";;;KAcK;
|
|
1
|
+
{"version":3,"file":"providerToolSearch.d.cts","names":["_$__types_js0.AgentMiddleware"],"sources":["../../../src/agents/middleware/providerToolSearch.ts"],"mappings":";;;KAcK;YACO,iBAAiB,WAAW;YAE5B;;;;;;;;EAQV,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA4EJ,6BACd,SAAQ,qCAAuCA,yDAAA,aAAA"}
|
|
@@ -2,8 +2,8 @@ import { AgentMiddleware } from "./types.js";
|
|
|
2
2
|
import { ClientTool, ServerTool, StructuredToolInterface } from "@langchain/core/tools";
|
|
3
3
|
//#region src/agents/middleware/providerToolSearch.d.ts
|
|
4
4
|
type ToolName = string;
|
|
5
|
-
type ToolIdentifier = ToolName | StructuredToolInterface;
|
|
6
|
-
type ProviderToolSearchMiddlewareConfig = {
|
|
5
|
+
export type ToolIdentifier = ToolName | StructuredToolInterface;
|
|
6
|
+
export type ProviderToolSearchMiddlewareConfig = {
|
|
7
7
|
/**
|
|
8
8
|
* Which tools are deferred; withheld from the model until its tool search surfaces them.
|
|
9
9
|
*
|
|
@@ -68,7 +68,6 @@ type ProviderToolSearchMiddlewareConfig = {
|
|
|
68
68
|
* @param config.searchableTools - Tools to defer behind tool search
|
|
69
69
|
* @returns A middleware instance that can be used with `createAgent`
|
|
70
70
|
*/
|
|
71
|
-
declare function providerToolSearchMiddleware(config?: ProviderToolSearchMiddlewareConfig): AgentMiddleware<undefined, undefined, unknown, readonly (ServerTool | ClientTool)[], readonly []>;
|
|
71
|
+
export declare function providerToolSearchMiddleware(config?: ProviderToolSearchMiddlewareConfig): AgentMiddleware<undefined, undefined, unknown, readonly (ServerTool | ClientTool)[], readonly []>;
|
|
72
72
|
//#endregion
|
|
73
|
-
export { ProviderToolSearchMiddlewareConfig, ToolIdentifier, providerToolSearchMiddleware };
|
|
74
73
|
//# sourceMappingURL=providerToolSearch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providerToolSearch.d.ts","names":[],"sources":["../../../src/agents/middleware/providerToolSearch.ts"],"mappings":";;;KAcK;
|
|
1
|
+
{"version":3,"file":"providerToolSearch.d.ts","names":["_$__types_js0.AgentMiddleware"],"sources":["../../../src/agents/middleware/providerToolSearch.ts"],"mappings":";;;KAcK;YACO,iBAAiB,WAAW;YAE5B;;;;;;;;EAQV,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA4EJ,6BACd,SAAQ,qCAAuCA,yDAAA,aAAA"}
|
|
@@ -4,8 +4,8 @@ import { BaseLanguageModel } from "@langchain/core/language_models/base";
|
|
|
4
4
|
import { InferInteropZodInput } from "@langchain/core/utils/types";
|
|
5
5
|
import { z } from "zod/v3";
|
|
6
6
|
//#region src/agents/middleware/summarization.d.ts
|
|
7
|
-
type TokenCounter = (messages: BaseMessage[]) => number | Promise<number>;
|
|
8
|
-
declare const contextSizeSchema: z.ZodEffects<z.ZodObject<{
|
|
7
|
+
export type TokenCounter = (messages: BaseMessage[]) => number | Promise<number>;
|
|
8
|
+
export declare const contextSizeSchema: z.ZodEffects<z.ZodObject<{
|
|
9
9
|
/**
|
|
10
10
|
* Fraction of the model's context size to use as the trigger
|
|
11
11
|
*/
|
|
@@ -35,8 +35,8 @@ declare const contextSizeSchema: z.ZodEffects<z.ZodObject<{
|
|
|
35
35
|
tokens?: number | undefined;
|
|
36
36
|
messages?: number | undefined;
|
|
37
37
|
}>;
|
|
38
|
-
type ContextSize = z.infer<typeof contextSizeSchema>;
|
|
39
|
-
declare const keepSchema: z.ZodEffects<z.ZodObject<{
|
|
38
|
+
export type ContextSize = z.infer<typeof contextSizeSchema>;
|
|
39
|
+
export declare const keepSchema: z.ZodEffects<z.ZodObject<{
|
|
40
40
|
/**
|
|
41
41
|
* Fraction of the model's context size to keep
|
|
42
42
|
*/
|
|
@@ -63,7 +63,7 @@ declare const keepSchema: z.ZodEffects<z.ZodObject<{
|
|
|
63
63
|
tokens?: number | undefined;
|
|
64
64
|
messages?: number | undefined;
|
|
65
65
|
}>;
|
|
66
|
-
type KeepSize = z.infer<typeof keepSchema>;
|
|
66
|
+
export type KeepSize = z.infer<typeof keepSchema>;
|
|
67
67
|
declare const contextSchema: z.ZodObject<{
|
|
68
68
|
/**
|
|
69
69
|
* Model to use for summarization
|
|
@@ -244,7 +244,7 @@ declare const contextSchema: z.ZodObject<{
|
|
|
244
244
|
maxTokensBeforeSummary?: number | undefined;
|
|
245
245
|
messagesToKeep?: number | undefined;
|
|
246
246
|
}>;
|
|
247
|
-
type SummarizationMiddlewareConfig = InferInteropZodInput<typeof contextSchema>;
|
|
247
|
+
export type SummarizationMiddlewareConfig = InferInteropZodInput<typeof contextSchema>;
|
|
248
248
|
/**
|
|
249
249
|
* Summarization middleware that automatically summarizes conversation history when token limits are approached.
|
|
250
250
|
*
|
|
@@ -291,7 +291,7 @@ type SummarizationMiddlewareConfig = InferInteropZodInput<typeof contextSchema>;
|
|
|
291
291
|
*
|
|
292
292
|
* ```
|
|
293
293
|
*/
|
|
294
|
-
declare function summarizationMiddleware(options: SummarizationMiddlewareConfig): AgentMiddleware<undefined, z.ZodObject<{
|
|
294
|
+
export declare function summarizationMiddleware(options: SummarizationMiddlewareConfig): AgentMiddleware<undefined, z.ZodObject<{
|
|
295
295
|
trigger: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodObject<{
|
|
296
296
|
/**
|
|
297
297
|
* Fraction of the model's context size to use as the trigger
|
|
@@ -454,5 +454,4 @@ declare function summarizationMiddleware(options: SummarizationMiddlewareConfig)
|
|
|
454
454
|
model?: BaseLanguageModel<any, import("@langchain/core/language_models/base").BaseLanguageModelCallOptions> | undefined;
|
|
455
455
|
}, readonly (import("@langchain/core/tools").ServerTool | import("@langchain/core/tools").ClientTool)[], readonly []>;
|
|
456
456
|
//#endregion
|
|
457
|
-
export { ContextSize, KeepSize, SummarizationMiddlewareConfig, TokenCounter, contextSizeSchema, keepSchema, summarizationMiddleware };
|
|
458
457
|
//# sourceMappingURL=summarization.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summarization.d.cts","names":[],"sources":["../../../src/agents/middleware/summarization.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"summarization.d.cts","names":["_$__types_js0.AgentMiddleware"],"sources":["../../../src/agents/middleware/summarization.ts"],"mappings":";;;;;;YAyEY,gBACV,UAAU,2BACE;qBAED,mBAAiB,EAAA,WAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAkClB,cAAc,EAAE,aAAa;qBAE5B,YAAU,EAAA,WAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;YAkCX,WAAW,EAAE,aAAa;cAEhC,eAAa,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAqDP,gCAAgC,4BACnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA4EO,wBACd,SAAS,2DAA6B,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6CA+LvC,6CAAA"}
|
|
@@ -4,8 +4,8 @@ import { InferInteropZodInput } from "@langchain/core/utils/types";
|
|
|
4
4
|
import { z } from "zod/v3";
|
|
5
5
|
import { BaseLanguageModel } from "@langchain/core/language_models/base";
|
|
6
6
|
//#region src/agents/middleware/summarization.d.ts
|
|
7
|
-
type TokenCounter = (messages: BaseMessage[]) => number | Promise<number>;
|
|
8
|
-
declare const contextSizeSchema: z.ZodEffects<z.ZodObject<{
|
|
7
|
+
export type TokenCounter = (messages: BaseMessage[]) => number | Promise<number>;
|
|
8
|
+
export declare const contextSizeSchema: z.ZodEffects<z.ZodObject<{
|
|
9
9
|
/**
|
|
10
10
|
* Fraction of the model's context size to use as the trigger
|
|
11
11
|
*/
|
|
@@ -35,8 +35,8 @@ declare const contextSizeSchema: z.ZodEffects<z.ZodObject<{
|
|
|
35
35
|
tokens?: number | undefined;
|
|
36
36
|
messages?: number | undefined;
|
|
37
37
|
}>;
|
|
38
|
-
type ContextSize = z.infer<typeof contextSizeSchema>;
|
|
39
|
-
declare const keepSchema: z.ZodEffects<z.ZodObject<{
|
|
38
|
+
export type ContextSize = z.infer<typeof contextSizeSchema>;
|
|
39
|
+
export declare const keepSchema: z.ZodEffects<z.ZodObject<{
|
|
40
40
|
/**
|
|
41
41
|
* Fraction of the model's context size to keep
|
|
42
42
|
*/
|
|
@@ -63,7 +63,7 @@ declare const keepSchema: z.ZodEffects<z.ZodObject<{
|
|
|
63
63
|
tokens?: number | undefined;
|
|
64
64
|
messages?: number | undefined;
|
|
65
65
|
}>;
|
|
66
|
-
type KeepSize = z.infer<typeof keepSchema>;
|
|
66
|
+
export type KeepSize = z.infer<typeof keepSchema>;
|
|
67
67
|
declare const contextSchema: z.ZodObject<{
|
|
68
68
|
/**
|
|
69
69
|
* Model to use for summarization
|
|
@@ -244,7 +244,7 @@ declare const contextSchema: z.ZodObject<{
|
|
|
244
244
|
maxTokensBeforeSummary?: number | undefined;
|
|
245
245
|
messagesToKeep?: number | undefined;
|
|
246
246
|
}>;
|
|
247
|
-
type SummarizationMiddlewareConfig = InferInteropZodInput<typeof contextSchema>;
|
|
247
|
+
export type SummarizationMiddlewareConfig = InferInteropZodInput<typeof contextSchema>;
|
|
248
248
|
/**
|
|
249
249
|
* Summarization middleware that automatically summarizes conversation history when token limits are approached.
|
|
250
250
|
*
|
|
@@ -291,7 +291,7 @@ type SummarizationMiddlewareConfig = InferInteropZodInput<typeof contextSchema>;
|
|
|
291
291
|
*
|
|
292
292
|
* ```
|
|
293
293
|
*/
|
|
294
|
-
declare function summarizationMiddleware(options: SummarizationMiddlewareConfig): AgentMiddleware<undefined, z.ZodObject<{
|
|
294
|
+
export declare function summarizationMiddleware(options: SummarizationMiddlewareConfig): AgentMiddleware<undefined, z.ZodObject<{
|
|
295
295
|
trigger: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodObject<{
|
|
296
296
|
/**
|
|
297
297
|
* Fraction of the model's context size to use as the trigger
|
|
@@ -454,5 +454,4 @@ declare function summarizationMiddleware(options: SummarizationMiddlewareConfig)
|
|
|
454
454
|
model?: BaseLanguageModel<any, import("@langchain/core/language_models/base").BaseLanguageModelCallOptions> | undefined;
|
|
455
455
|
}, readonly (import("@langchain/core/tools").ServerTool | import("@langchain/core/tools").ClientTool)[], readonly []>;
|
|
456
456
|
//#endregion
|
|
457
|
-
export { ContextSize, KeepSize, SummarizationMiddlewareConfig, TokenCounter, contextSizeSchema, keepSchema, summarizationMiddleware };
|
|
458
457
|
//# sourceMappingURL=summarization.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summarization.d.ts","names":[],"sources":["../../../src/agents/middleware/summarization.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"summarization.d.ts","names":["_$__types_js0.AgentMiddleware"],"sources":["../../../src/agents/middleware/summarization.ts"],"mappings":";;;;;;YAyEY,gBACV,UAAU,2BACE;qBAED,mBAAiB,EAAA,WAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAkClB,cAAc,EAAE,aAAa;qBAE5B,YAAU,EAAA,WAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;YAkCX,WAAW,EAAE,aAAa;cAEhC,eAAa,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAqDP,gCAAgC,4BACnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA4EO,wBACd,SAAS,2DAA6B,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6CA+LvC,6CAAA"}
|
|
@@ -3,7 +3,7 @@ import { ToolMessage } from "@langchain/core/messages";
|
|
|
3
3
|
import { Command } from "@langchain/langgraph";
|
|
4
4
|
import { z } from "zod/v3";
|
|
5
5
|
//#region src/agents/middleware/todoListMiddleware.d.ts
|
|
6
|
-
declare const TODO_LIST_MIDDLEWARE_SYSTEM_PROMPT = "## `write_todos`\n\nYou have access to the `write_todos` tool to help you manage and plan complex objectives. \nUse this tool for complex objectives to ensure that you are tracking each necessary step and giving the user visibility into your progress.\nThis tool is very helpful for planning complex objectives, and for breaking down these larger complex objectives into smaller steps.\n\nIt is critical that you mark todos as completed as soon as you are done with a step. Do not batch up multiple steps before marking them as completed.\nFor simple objectives that only require a few steps, it is better to just complete the objective directly and NOT use this tool.\nWriting todos takes time and tokens, use it when it is helpful for managing complex many-step problems! But not for simple few-step requests.\n\n## Important To-Do List Usage Notes to Remember\n- The `write_todos` tool should never be called multiple times in parallel.\n- Don't be afraid to revise the To-Do list as you go. New information may reveal new tasks that need to be done, or old tasks that are irrelevant.";
|
|
6
|
+
export declare const TODO_LIST_MIDDLEWARE_SYSTEM_PROMPT = "## `write_todos`\n\nYou have access to the `write_todos` tool to help you manage and plan complex objectives. \nUse this tool for complex objectives to ensure that you are tracking each necessary step and giving the user visibility into your progress.\nThis tool is very helpful for planning complex objectives, and for breaking down these larger complex objectives into smaller steps.\n\nIt is critical that you mark todos as completed as soon as you are done with a step. Do not batch up multiple steps before marking them as completed.\nFor simple objectives that only require a few steps, it is better to just complete the objective directly and NOT use this tool.\nWriting todos takes time and tokens, use it when it is helpful for managing complex many-step problems! But not for simple few-step requests.\n\n## Important To-Do List Usage Notes to Remember\n- The `write_todos` tool should never be called multiple times in parallel.\n- Don't be afraid to revise the To-Do list as you go. New information may reveal new tasks that need to be done, or old tasks that are irrelevant.";
|
|
7
7
|
declare const TodoSchema: z.ZodObject<{
|
|
8
8
|
content: z.ZodString;
|
|
9
9
|
status: z.ZodEnum<["pending", "in_progress", "completed"]>;
|
|
@@ -14,8 +14,8 @@ declare const TodoSchema: z.ZodObject<{
|
|
|
14
14
|
content: string;
|
|
15
15
|
status: "completed" | "in_progress" | "pending";
|
|
16
16
|
}>;
|
|
17
|
-
type Todo = z.infer<typeof TodoSchema>;
|
|
18
|
-
interface TodoListMiddlewareOptions {
|
|
17
|
+
export type Todo = z.infer<typeof TodoSchema>;
|
|
18
|
+
export interface TodoListMiddlewareOptions {
|
|
19
19
|
/**
|
|
20
20
|
* Custom system prompt to guide the agent on using the todo tool.
|
|
21
21
|
* If not provided, uses the default {@link PLANNING_MIDDLEWARE_SYSTEM_PROMPT}.
|
|
@@ -62,7 +62,7 @@ interface TodoListMiddlewareOptions {
|
|
|
62
62
|
* @see {@link TodoMiddlewareState} for the state schema
|
|
63
63
|
* @see {@link writeTodos} for the tool implementation
|
|
64
64
|
*/
|
|
65
|
-
declare function todoListMiddleware(options?: TodoListMiddlewareOptions): AgentMiddleware<z.ZodObject<{
|
|
65
|
+
export declare function todoListMiddleware(options?: TodoListMiddlewareOptions): AgentMiddleware<z.ZodObject<{
|
|
66
66
|
todos: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
67
67
|
content: z.ZodString;
|
|
68
68
|
status: z.ZodEnum<["pending", "in_progress", "completed"]>;
|
|
@@ -122,5 +122,4 @@ declare function todoListMiddleware(options?: TodoListMiddlewareOptions): AgentM
|
|
|
122
122
|
messages: ToolMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>>[];
|
|
123
123
|
}, string>, unknown, "write_todos">], readonly []>;
|
|
124
124
|
//#endregion
|
|
125
|
-
export { TODO_LIST_MIDDLEWARE_SYSTEM_PROMPT, Todo, TodoListMiddlewareOptions, todoListMiddleware };
|
|
126
125
|
//# sourceMappingURL=todoListMiddleware.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"todoListMiddleware.d.cts","names":[],"sources":["../../../src/agents/middleware/todoListMiddleware.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"todoListMiddleware.d.cts","names":["_$__types_js0.AgentMiddleware"],"sources":["../../../src/agents/middleware/todoListMiddleware.ts"],"mappings":";;;;;qBAiOa;cAiBP,YAAU,EAAA;;;;;;;;;;YAIJ,OAAO,EAAE,aAAa;iBAOjB;;;;;EAKf;;;;;EAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAsCc,mBAAmB,UAAU,4CAAyB,EAAA"}
|
|
@@ -3,7 +3,7 @@ import { ToolMessage } from "@langchain/core/messages";
|
|
|
3
3
|
import { Command } from "@langchain/langgraph";
|
|
4
4
|
import { z } from "zod/v3";
|
|
5
5
|
//#region src/agents/middleware/todoListMiddleware.d.ts
|
|
6
|
-
declare const TODO_LIST_MIDDLEWARE_SYSTEM_PROMPT = "## `write_todos`\n\nYou have access to the `write_todos` tool to help you manage and plan complex objectives. \nUse this tool for complex objectives to ensure that you are tracking each necessary step and giving the user visibility into your progress.\nThis tool is very helpful for planning complex objectives, and for breaking down these larger complex objectives into smaller steps.\n\nIt is critical that you mark todos as completed as soon as you are done with a step. Do not batch up multiple steps before marking them as completed.\nFor simple objectives that only require a few steps, it is better to just complete the objective directly and NOT use this tool.\nWriting todos takes time and tokens, use it when it is helpful for managing complex many-step problems! But not for simple few-step requests.\n\n## Important To-Do List Usage Notes to Remember\n- The `write_todos` tool should never be called multiple times in parallel.\n- Don't be afraid to revise the To-Do list as you go. New information may reveal new tasks that need to be done, or old tasks that are irrelevant.";
|
|
6
|
+
export declare const TODO_LIST_MIDDLEWARE_SYSTEM_PROMPT = "## `write_todos`\n\nYou have access to the `write_todos` tool to help you manage and plan complex objectives. \nUse this tool for complex objectives to ensure that you are tracking each necessary step and giving the user visibility into your progress.\nThis tool is very helpful for planning complex objectives, and for breaking down these larger complex objectives into smaller steps.\n\nIt is critical that you mark todos as completed as soon as you are done with a step. Do not batch up multiple steps before marking them as completed.\nFor simple objectives that only require a few steps, it is better to just complete the objective directly and NOT use this tool.\nWriting todos takes time and tokens, use it when it is helpful for managing complex many-step problems! But not for simple few-step requests.\n\n## Important To-Do List Usage Notes to Remember\n- The `write_todos` tool should never be called multiple times in parallel.\n- Don't be afraid to revise the To-Do list as you go. New information may reveal new tasks that need to be done, or old tasks that are irrelevant.";
|
|
7
7
|
declare const TodoSchema: z.ZodObject<{
|
|
8
8
|
content: z.ZodString;
|
|
9
9
|
status: z.ZodEnum<["pending", "in_progress", "completed"]>;
|
|
@@ -14,8 +14,8 @@ declare const TodoSchema: z.ZodObject<{
|
|
|
14
14
|
content: string;
|
|
15
15
|
status: "completed" | "in_progress" | "pending";
|
|
16
16
|
}>;
|
|
17
|
-
type Todo = z.infer<typeof TodoSchema>;
|
|
18
|
-
interface TodoListMiddlewareOptions {
|
|
17
|
+
export type Todo = z.infer<typeof TodoSchema>;
|
|
18
|
+
export interface TodoListMiddlewareOptions {
|
|
19
19
|
/**
|
|
20
20
|
* Custom system prompt to guide the agent on using the todo tool.
|
|
21
21
|
* If not provided, uses the default {@link PLANNING_MIDDLEWARE_SYSTEM_PROMPT}.
|
|
@@ -62,7 +62,7 @@ interface TodoListMiddlewareOptions {
|
|
|
62
62
|
* @see {@link TodoMiddlewareState} for the state schema
|
|
63
63
|
* @see {@link writeTodos} for the tool implementation
|
|
64
64
|
*/
|
|
65
|
-
declare function todoListMiddleware(options?: TodoListMiddlewareOptions): AgentMiddleware<z.ZodObject<{
|
|
65
|
+
export declare function todoListMiddleware(options?: TodoListMiddlewareOptions): AgentMiddleware<z.ZodObject<{
|
|
66
66
|
todos: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
67
67
|
content: z.ZodString;
|
|
68
68
|
status: z.ZodEnum<["pending", "in_progress", "completed"]>;
|
|
@@ -122,5 +122,4 @@ declare function todoListMiddleware(options?: TodoListMiddlewareOptions): AgentM
|
|
|
122
122
|
messages: ToolMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>>[];
|
|
123
123
|
}, string>, unknown, "write_todos">], readonly []>;
|
|
124
124
|
//#endregion
|
|
125
|
-
export { TODO_LIST_MIDDLEWARE_SYSTEM_PROMPT, Todo, TodoListMiddlewareOptions, todoListMiddleware };
|
|
126
125
|
//# sourceMappingURL=todoListMiddleware.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"todoListMiddleware.d.ts","names":[],"sources":["../../../src/agents/middleware/todoListMiddleware.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"todoListMiddleware.d.ts","names":["_$__types_js0.AgentMiddleware"],"sources":["../../../src/agents/middleware/todoListMiddleware.ts"],"mappings":";;;;;qBAiOa;cAiBP,YAAU,EAAA;;;;;;;;;;YAIJ,OAAO,EAAE,aAAa;iBAOjB;;;;;EAKf;;;;;EAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAsCc,mBAAmB,UAAU,4CAAyB,EAAA"}
|
|
@@ -8,7 +8,7 @@ import { z } from "zod/v3";
|
|
|
8
8
|
* This exception is raised when the configured exit behavior is 'error'
|
|
9
9
|
* and either the thread or run tool call limit has been exceeded.
|
|
10
10
|
*/
|
|
11
|
-
declare class ToolCallLimitExceededError extends Error {
|
|
11
|
+
export declare class ToolCallLimitExceededError extends Error {
|
|
12
12
|
/**
|
|
13
13
|
* Current thread tool call count.
|
|
14
14
|
*/
|
|
@@ -34,7 +34,7 @@ declare class ToolCallLimitExceededError extends Error {
|
|
|
34
34
|
/**
|
|
35
35
|
* Options for configuring the Tool Call Limit middleware.
|
|
36
36
|
*/
|
|
37
|
-
declare const ToolCallLimitOptionsSchema: z.ZodObject<{
|
|
37
|
+
export declare const ToolCallLimitOptionsSchema: z.ZodObject<{
|
|
38
38
|
/**
|
|
39
39
|
* Name of the specific tool to limit. If undefined, limits apply to all tools.
|
|
40
40
|
*/
|
|
@@ -71,7 +71,7 @@ declare const ToolCallLimitOptionsSchema: z.ZodObject<{
|
|
|
71
71
|
runLimit?: number | undefined;
|
|
72
72
|
exitBehavior?: "continue" | "end" | "error" | undefined;
|
|
73
73
|
}>;
|
|
74
|
-
type ToolCallLimitConfig = InferInteropZodInput<typeof ToolCallLimitOptionsSchema>;
|
|
74
|
+
export type ToolCallLimitConfig = InferInteropZodInput<typeof ToolCallLimitOptionsSchema>;
|
|
75
75
|
/**
|
|
76
76
|
* Middleware that tracks tool call counts and enforces limits.
|
|
77
77
|
*
|
|
@@ -152,7 +152,7 @@ type ToolCallLimitConfig = InferInteropZodInput<typeof ToolCallLimitOptionsSchem
|
|
|
152
152
|
* }
|
|
153
153
|
* ```
|
|
154
154
|
*/
|
|
155
|
-
declare function toolCallLimitMiddleware(options: ToolCallLimitConfig): AgentMiddleware<z.ZodObject<{
|
|
155
|
+
export declare function toolCallLimitMiddleware(options: ToolCallLimitConfig): AgentMiddleware<z.ZodObject<{
|
|
156
156
|
threadToolCallCount: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
157
157
|
runToolCallCount: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
158
158
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -163,5 +163,4 @@ declare function toolCallLimitMiddleware(options: ToolCallLimitConfig): AgentMid
|
|
|
163
163
|
runToolCallCount?: Record<string, number> | undefined;
|
|
164
164
|
}>, undefined, unknown, readonly (import("@langchain/core/tools").ServerTool | import("@langchain/core/tools").ClientTool)[], readonly []>;
|
|
165
165
|
//#endregion
|
|
166
|
-
export { ToolCallLimitConfig, ToolCallLimitExceededError, ToolCallLimitOptionsSchema, toolCallLimitMiddleware };
|
|
167
166
|
//# sourceMappingURL=toolCallLimit.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolCallLimit.d.cts","names":[],"sources":["../../../src/agents/middleware/toolCallLimit.ts"],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"toolCallLimit.d.cts","names":["_$__types_js0.AgentMiddleware"],"sources":["../../../src/agents/middleware/toolCallLimit.ts"],"mappings":";;;;;;;;;;qBA6Ea,mCAAmC;;;;EAI9C;;;;EAIA;;;;EAIA;;;;EAIA;;;;EAIA;EAEA,YACE,qBACA,kBACA,iCACA,8BACA;;;;;qBAuBS,4BAA0B,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA4B3B,sBAAsB,4BACzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA6FO,wBAAwB,SAAS,sBAAmBA,gBAAA,EAAA;;;;;;;;;kEAuRnE,6CAAA"}
|
|
@@ -8,7 +8,7 @@ import { z } from "zod/v3";
|
|
|
8
8
|
* This exception is raised when the configured exit behavior is 'error'
|
|
9
9
|
* and either the thread or run tool call limit has been exceeded.
|
|
10
10
|
*/
|
|
11
|
-
declare class ToolCallLimitExceededError extends Error {
|
|
11
|
+
export declare class ToolCallLimitExceededError extends Error {
|
|
12
12
|
/**
|
|
13
13
|
* Current thread tool call count.
|
|
14
14
|
*/
|
|
@@ -34,7 +34,7 @@ declare class ToolCallLimitExceededError extends Error {
|
|
|
34
34
|
/**
|
|
35
35
|
* Options for configuring the Tool Call Limit middleware.
|
|
36
36
|
*/
|
|
37
|
-
declare const ToolCallLimitOptionsSchema: z.ZodObject<{
|
|
37
|
+
export declare const ToolCallLimitOptionsSchema: z.ZodObject<{
|
|
38
38
|
/**
|
|
39
39
|
* Name of the specific tool to limit. If undefined, limits apply to all tools.
|
|
40
40
|
*/
|
|
@@ -71,7 +71,7 @@ declare const ToolCallLimitOptionsSchema: z.ZodObject<{
|
|
|
71
71
|
runLimit?: number | undefined;
|
|
72
72
|
exitBehavior?: "continue" | "end" | "error" | undefined;
|
|
73
73
|
}>;
|
|
74
|
-
type ToolCallLimitConfig = InferInteropZodInput<typeof ToolCallLimitOptionsSchema>;
|
|
74
|
+
export type ToolCallLimitConfig = InferInteropZodInput<typeof ToolCallLimitOptionsSchema>;
|
|
75
75
|
/**
|
|
76
76
|
* Middleware that tracks tool call counts and enforces limits.
|
|
77
77
|
*
|
|
@@ -152,7 +152,7 @@ type ToolCallLimitConfig = InferInteropZodInput<typeof ToolCallLimitOptionsSchem
|
|
|
152
152
|
* }
|
|
153
153
|
* ```
|
|
154
154
|
*/
|
|
155
|
-
declare function toolCallLimitMiddleware(options: ToolCallLimitConfig): AgentMiddleware<z.ZodObject<{
|
|
155
|
+
export declare function toolCallLimitMiddleware(options: ToolCallLimitConfig): AgentMiddleware<z.ZodObject<{
|
|
156
156
|
threadToolCallCount: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
157
157
|
runToolCallCount: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
158
158
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -163,5 +163,4 @@ declare function toolCallLimitMiddleware(options: ToolCallLimitConfig): AgentMid
|
|
|
163
163
|
runToolCallCount?: Record<string, number> | undefined;
|
|
164
164
|
}>, undefined, unknown, readonly (import("@langchain/core/tools").ServerTool | import("@langchain/core/tools").ClientTool)[], readonly []>;
|
|
165
165
|
//#endregion
|
|
166
|
-
export { ToolCallLimitConfig, ToolCallLimitExceededError, ToolCallLimitOptionsSchema, toolCallLimitMiddleware };
|
|
167
166
|
//# sourceMappingURL=toolCallLimit.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolCallLimit.d.ts","names":[],"sources":["../../../src/agents/middleware/toolCallLimit.ts"],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"toolCallLimit.d.ts","names":["_$__types_js0.AgentMiddleware"],"sources":["../../../src/agents/middleware/toolCallLimit.ts"],"mappings":";;;;;;;;;;qBA6Ea,mCAAmC;;;;EAI9C;;;;EAIA;;;;EAIA;;;;EAIA;;;;EAIA;EAEA,YACE,qBACA,kBACA,iCACA,8BACA;;;;;qBAuBS,4BAA0B,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA4B3B,sBAAsB,4BACzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA6FO,wBAAwB,SAAS,sBAAmBA,gBAAA,EAAA;;;;;;;;;kEAuRnE,6CAAA"}
|
|
@@ -5,7 +5,7 @@ import { ClientTool, ServerTool } from "@langchain/core/tools";
|
|
|
5
5
|
/**
|
|
6
6
|
* Options for configuring the Tool Emulator middleware.
|
|
7
7
|
*/
|
|
8
|
-
interface ToolEmulatorOptions {
|
|
8
|
+
export interface ToolEmulatorOptions {
|
|
9
9
|
/**
|
|
10
10
|
* List of tool names (string) or tool instances to emulate.
|
|
11
11
|
* - If `undefined` (default), ALL tools will be emulated.
|
|
@@ -68,7 +68,6 @@ interface ToolEmulatorOptions {
|
|
|
68
68
|
* });
|
|
69
69
|
* ```
|
|
70
70
|
*/
|
|
71
|
-
declare function toolEmulatorMiddleware(options?: ToolEmulatorOptions): AgentMiddleware<undefined, undefined, unknown, readonly (ServerTool | ClientTool)[], readonly []>;
|
|
71
|
+
export declare function toolEmulatorMiddleware(options?: ToolEmulatorOptions): AgentMiddleware<undefined, undefined, unknown, readonly (ServerTool | ClientTool)[], readonly []>;
|
|
72
72
|
//#endregion
|
|
73
|
-
export { ToolEmulatorOptions, toolEmulatorMiddleware };
|
|
74
73
|
//# sourceMappingURL=toolEmulator.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolEmulator.d.cts","names":[],"sources":["../../../src/agents/middleware/toolEmulator.ts"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"toolEmulator.d.cts","names":["_$__types_js0.AgentMiddleware"],"sources":["../../../src/agents/middleware/toolEmulator.ts"],"mappings":";;;;;;;iBAeiB;;;;;;;EAOf,kBAAkB,aAAa;;;;;;;EAQ/B,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAkDH,uBAAuB,UAAS,sBAAwBA,yDAAA,aAAA"}
|
|
@@ -5,7 +5,7 @@ import { ClientTool, ServerTool } from "@langchain/core/tools";
|
|
|
5
5
|
/**
|
|
6
6
|
* Options for configuring the Tool Emulator middleware.
|
|
7
7
|
*/
|
|
8
|
-
interface ToolEmulatorOptions {
|
|
8
|
+
export interface ToolEmulatorOptions {
|
|
9
9
|
/**
|
|
10
10
|
* List of tool names (string) or tool instances to emulate.
|
|
11
11
|
* - If `undefined` (default), ALL tools will be emulated.
|
|
@@ -68,7 +68,6 @@ interface ToolEmulatorOptions {
|
|
|
68
68
|
* });
|
|
69
69
|
* ```
|
|
70
70
|
*/
|
|
71
|
-
declare function toolEmulatorMiddleware(options?: ToolEmulatorOptions): AgentMiddleware<undefined, undefined, unknown, readonly (ServerTool | ClientTool)[], readonly []>;
|
|
71
|
+
export declare function toolEmulatorMiddleware(options?: ToolEmulatorOptions): AgentMiddleware<undefined, undefined, unknown, readonly (ServerTool | ClientTool)[], readonly []>;
|
|
72
72
|
//#endregion
|
|
73
|
-
export { ToolEmulatorOptions, toolEmulatorMiddleware };
|
|
74
73
|
//# sourceMappingURL=toolEmulator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolEmulator.d.ts","names":[],"sources":["../../../src/agents/middleware/toolEmulator.ts"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"toolEmulator.d.ts","names":["_$__types_js0.AgentMiddleware"],"sources":["../../../src/agents/middleware/toolEmulator.ts"],"mappings":";;;;;;;iBAeiB;;;;;;;EAOf,kBAAkB,aAAa;;;;;;;EAQ/B,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAkDH,uBAAuB,UAAS,sBAAwBA,yDAAA,aAAA"}
|
|
@@ -8,11 +8,11 @@ import { ClientTool, ServerTool } from "@langchain/core/tools";
|
|
|
8
8
|
* Return content to surface the error to the model as an error `ToolMessage`.
|
|
9
9
|
* Return nothing to propagate the original error.
|
|
10
10
|
*/
|
|
11
|
-
type ToolErrorHandler = (error: unknown, request: ToolCallRequest) => MessageContent | void | Promise<MessageContent | void>;
|
|
11
|
+
export type ToolErrorHandler = (error: unknown, request: ToolCallRequest) => MessageContent | void | Promise<MessageContent | void>;
|
|
12
12
|
/**
|
|
13
13
|
* Configuration for {@link toolErrorMiddleware}.
|
|
14
14
|
*/
|
|
15
|
-
interface ToolErrorMiddlewareConfig {
|
|
15
|
+
export interface ToolErrorMiddlewareConfig {
|
|
16
16
|
/**
|
|
17
17
|
* Handler called when tool execution throws. Return content to convert the
|
|
18
18
|
* error into an error `ToolMessage`, or return nothing to propagate it.
|
|
@@ -57,7 +57,6 @@ interface ToolErrorMiddlewareConfig {
|
|
|
57
57
|
* });
|
|
58
58
|
* ```
|
|
59
59
|
*/
|
|
60
|
-
declare function toolErrorMiddleware(config: ToolErrorMiddlewareConfig): AgentMiddleware<undefined, undefined, unknown, readonly (ServerTool | ClientTool)[], readonly []>;
|
|
60
|
+
export declare function toolErrorMiddleware(config: ToolErrorMiddlewareConfig): AgentMiddleware<undefined, undefined, unknown, readonly (ServerTool | ClientTool)[], readonly []>;
|
|
61
61
|
//#endregion
|
|
62
|
-
export { ToolErrorHandler, ToolErrorMiddlewareConfig, toolErrorMiddleware };
|
|
63
62
|
//# sourceMappingURL=toolError.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolError.d.cts","names":[],"sources":["../../../src/agents/middleware/toolError.ts"],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"toolError.d.cts","names":["_$__types_js0.AgentMiddleware"],"sources":["../../../src/agents/middleware/toolError.ts"],"mappings":";;;;;;;;;;YAgBY,oBACV,gBACA,SAAS,oBACN,wBAAwB,QAAQ;;;;iBAKpB;;;;;EAKf,SAAS;;;;;EAMT,QAAQ,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAoCb,oBAAoB,QAAQ,4BAAyBA,yDAAA,aAAA"}
|
|
@@ -8,11 +8,11 @@ import { ClientTool, ServerTool } from "@langchain/core/tools";
|
|
|
8
8
|
* Return content to surface the error to the model as an error `ToolMessage`.
|
|
9
9
|
* Return nothing to propagate the original error.
|
|
10
10
|
*/
|
|
11
|
-
type ToolErrorHandler = (error: unknown, request: ToolCallRequest) => MessageContent | void | Promise<MessageContent | void>;
|
|
11
|
+
export type ToolErrorHandler = (error: unknown, request: ToolCallRequest) => MessageContent | void | Promise<MessageContent | void>;
|
|
12
12
|
/**
|
|
13
13
|
* Configuration for {@link toolErrorMiddleware}.
|
|
14
14
|
*/
|
|
15
|
-
interface ToolErrorMiddlewareConfig {
|
|
15
|
+
export interface ToolErrorMiddlewareConfig {
|
|
16
16
|
/**
|
|
17
17
|
* Handler called when tool execution throws. Return content to convert the
|
|
18
18
|
* error into an error `ToolMessage`, or return nothing to propagate it.
|
|
@@ -57,7 +57,6 @@ interface ToolErrorMiddlewareConfig {
|
|
|
57
57
|
* });
|
|
58
58
|
* ```
|
|
59
59
|
*/
|
|
60
|
-
declare function toolErrorMiddleware(config: ToolErrorMiddlewareConfig): AgentMiddleware<undefined, undefined, unknown, readonly (ServerTool | ClientTool)[], readonly []>;
|
|
60
|
+
export declare function toolErrorMiddleware(config: ToolErrorMiddlewareConfig): AgentMiddleware<undefined, undefined, unknown, readonly (ServerTool | ClientTool)[], readonly []>;
|
|
61
61
|
//#endregion
|
|
62
|
-
export { ToolErrorHandler, ToolErrorMiddlewareConfig, toolErrorMiddleware };
|
|
63
62
|
//# sourceMappingURL=toolError.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolError.d.ts","names":[],"sources":["../../../src/agents/middleware/toolError.ts"],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"toolError.d.ts","names":["_$__types_js0.AgentMiddleware"],"sources":["../../../src/agents/middleware/toolError.ts"],"mappings":";;;;;;;;;;YAgBY,oBACV,gBACA,SAAS,oBACN,wBAAwB,QAAQ;;;;iBAKpB;;;;;EAKf,SAAS;;;;;EAMT,QAAQ,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAoCb,oBAAoB,QAAQ,4BAAyBA,yDAAA,aAAA"}
|
|
@@ -5,7 +5,7 @@ import { z } from "zod/v3";
|
|
|
5
5
|
/**
|
|
6
6
|
* Configuration options for the Tool Retry Middleware.
|
|
7
7
|
*/
|
|
8
|
-
declare const ToolRetryMiddlewareOptionsSchema: z.ZodObject<{
|
|
8
|
+
export declare const ToolRetryMiddlewareOptionsSchema: z.ZodObject<{
|
|
9
9
|
/**
|
|
10
10
|
* Optional list of tools or tool names to apply retry logic to.
|
|
11
11
|
* Can be a list of `BaseTool` instances or tool name strings.
|
|
@@ -51,7 +51,7 @@ declare const ToolRetryMiddlewareOptionsSchema: z.ZodObject<{
|
|
|
51
51
|
tools?: (string | ServerTool | ClientTool)[] | undefined;
|
|
52
52
|
onFailure?: "continue" | "error" | "raise" | "return_message" | ((args_0: Error, ...args: unknown[]) => string) | undefined;
|
|
53
53
|
}>;
|
|
54
|
-
type ToolRetryMiddlewareConfig = z.input<typeof ToolRetryMiddlewareOptionsSchema>;
|
|
54
|
+
export type ToolRetryMiddlewareConfig = z.input<typeof ToolRetryMiddlewareOptionsSchema>;
|
|
55
55
|
/**
|
|
56
56
|
* Middleware that automatically retries failed tool calls with configurable backoff.
|
|
57
57
|
*
|
|
@@ -151,7 +151,7 @@ type ToolRetryMiddlewareConfig = z.input<typeof ToolRetryMiddlewareOptionsSchema
|
|
|
151
151
|
* @param config - Configuration options for the retry middleware
|
|
152
152
|
* @returns A middleware instance that handles tool failures with retries
|
|
153
153
|
*/
|
|
154
|
-
declare function toolRetryMiddleware(config?: ToolRetryMiddlewareConfig): AgentMiddleware<undefined, z.ZodObject<{
|
|
154
|
+
export declare function toolRetryMiddleware(config?: ToolRetryMiddlewareConfig): AgentMiddleware<undefined, z.ZodObject<{
|
|
155
155
|
/**
|
|
156
156
|
* Optional list of tools or tool names to apply retry logic to.
|
|
157
157
|
* Can be a list of `BaseTool` instances or tool name strings.
|
|
@@ -207,5 +207,4 @@ declare function toolRetryMiddleware(config?: ToolRetryMiddlewareConfig): AgentM
|
|
|
207
207
|
onFailure: "continue" | "error" | "raise" | "return_message" | ((args_0: Error, ...args: unknown[]) => string);
|
|
208
208
|
}, readonly (ServerTool | ClientTool)[], readonly []>;
|
|
209
209
|
//#endregion
|
|
210
|
-
export { ToolRetryMiddlewareConfig, ToolRetryMiddlewareOptionsSchema, toolRetryMiddleware };
|
|
211
210
|
//# sourceMappingURL=toolRetry.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolRetry.d.cts","names":[],"sources":["../../../src/agents/middleware/toolRetry.ts"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"toolRetry.d.cts","names":["_$__types_js0.AgentMiddleware"],"sources":["../../../src/agents/middleware/toolRetry.ts"],"mappings":";;;;;;;qBAea,kCAAgC,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA2CjC,4BAA4B,EAAE,aACjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAsGO,oBAAoB,SAAQ,4BA2K3CA,2BA3KyE,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aA2KzE,aAAA"}
|
|
@@ -5,7 +5,7 @@ import { z } from "zod/v3";
|
|
|
5
5
|
/**
|
|
6
6
|
* Configuration options for the Tool Retry Middleware.
|
|
7
7
|
*/
|
|
8
|
-
declare const ToolRetryMiddlewareOptionsSchema: z.ZodObject<{
|
|
8
|
+
export declare const ToolRetryMiddlewareOptionsSchema: z.ZodObject<{
|
|
9
9
|
/**
|
|
10
10
|
* Optional list of tools or tool names to apply retry logic to.
|
|
11
11
|
* Can be a list of `BaseTool` instances or tool name strings.
|
|
@@ -51,7 +51,7 @@ declare const ToolRetryMiddlewareOptionsSchema: z.ZodObject<{
|
|
|
51
51
|
tools?: (string | ServerTool | ClientTool)[] | undefined;
|
|
52
52
|
onFailure?: "continue" | "error" | "raise" | "return_message" | ((args_0: Error, ...args: unknown[]) => string) | undefined;
|
|
53
53
|
}>;
|
|
54
|
-
type ToolRetryMiddlewareConfig = z.input<typeof ToolRetryMiddlewareOptionsSchema>;
|
|
54
|
+
export type ToolRetryMiddlewareConfig = z.input<typeof ToolRetryMiddlewareOptionsSchema>;
|
|
55
55
|
/**
|
|
56
56
|
* Middleware that automatically retries failed tool calls with configurable backoff.
|
|
57
57
|
*
|
|
@@ -151,7 +151,7 @@ type ToolRetryMiddlewareConfig = z.input<typeof ToolRetryMiddlewareOptionsSchema
|
|
|
151
151
|
* @param config - Configuration options for the retry middleware
|
|
152
152
|
* @returns A middleware instance that handles tool failures with retries
|
|
153
153
|
*/
|
|
154
|
-
declare function toolRetryMiddleware(config?: ToolRetryMiddlewareConfig): AgentMiddleware<undefined, z.ZodObject<{
|
|
154
|
+
export declare function toolRetryMiddleware(config?: ToolRetryMiddlewareConfig): AgentMiddleware<undefined, z.ZodObject<{
|
|
155
155
|
/**
|
|
156
156
|
* Optional list of tools or tool names to apply retry logic to.
|
|
157
157
|
* Can be a list of `BaseTool` instances or tool name strings.
|
|
@@ -207,5 +207,4 @@ declare function toolRetryMiddleware(config?: ToolRetryMiddlewareConfig): AgentM
|
|
|
207
207
|
onFailure: "continue" | "error" | "raise" | "return_message" | ((args_0: Error, ...args: unknown[]) => string);
|
|
208
208
|
}, readonly (ServerTool | ClientTool)[], readonly []>;
|
|
209
209
|
//#endregion
|
|
210
|
-
export { ToolRetryMiddlewareConfig, ToolRetryMiddlewareOptionsSchema, toolRetryMiddleware };
|
|
211
210
|
//# sourceMappingURL=toolRetry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolRetry.d.ts","names":[],"sources":["../../../src/agents/middleware/toolRetry.ts"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"toolRetry.d.ts","names":["_$__types_js0.AgentMiddleware"],"sources":["../../../src/agents/middleware/toolRetry.ts"],"mappings":";;;;;;;qBAea,kCAAgC,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA2CjC,4BAA4B,EAAE,aACjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAsGO,oBAAoB,SAAQ,4BA2K3CA,2BA3KyE,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aA2KzE,aAAA"}
|