Skip to content

Commit 364e63f

Browse files
authored
Merge pull request #58 from langchain-ai/dqbd/summarization-kwargs
fix: use new `trigger` / `keep` kwargs for `summarizationMiddleware`
2 parents f5253f1 + c346110 commit 364e63f

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

.changeset/dull-pans-train.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"deepagents": patch
3+
---
4+
5+
Fix warnings being shown when creating deep agent

src/agent.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ export function createDeepAgent<
136136
// Subagent middleware: Automatic conversation summarization when token limits are approached
137137
summarizationMiddleware({
138138
model,
139-
maxTokensBeforeSummary: 170000,
140-
messagesToKeep: 6,
139+
trigger: { tokens: 170_000 },
140+
keep: { messages: 6 },
141141
}),
142142
// Subagent middleware: Anthropic prompt caching for improved performance
143143
anthropicPromptCachingMiddleware({
@@ -153,8 +153,8 @@ export function createDeepAgent<
153153
// Automatically summarizes conversation history when token limits are approached
154154
summarizationMiddleware({
155155
model,
156-
maxTokensBeforeSummary: 170000,
157-
messagesToKeep: 6,
156+
trigger: { tokens: 170_000 },
157+
keep: { messages: 6 },
158158
}),
159159
// Enables Anthropic prompt caching for improved performance and reduced costs
160160
anthropicPromptCachingMiddleware({

0 commit comments

Comments
 (0)