Skip to content

Commit 32f81f1

Browse files
cr
1 parent e6c6bbf commit 32f81f1

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

libs/langchain/src/agents/middleware/tests/summarization.test.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
SystemMessage,
77
ToolMessage,
88
} from "@langchain/core/messages";
9+
910
import { summarizationMiddleware } from "../summarization.js";
1011
import { countTokensApproximately } from "../utils.js";
1112
import { createAgent } from "../../index.js";
@@ -367,13 +368,7 @@ describe("summarizationMiddleware", () => {
367368
});
368369

369370
it("can be created using a model string", async () => {
370-
// Verify the mocked ChatAnthropic exists
371-
const { ChatAnthropic } = await import("@langchain/anthropic");
372-
expect(ChatAnthropic).toBeDefined();
373-
expect(typeof ChatAnthropic).toBe("function");
374-
375371
const model = "anthropic:claude-sonnet-4-20250514";
376-
377372
const middleware = summarizationMiddleware({
378373
model,
379374
maxTokensBeforeSummary: 100,
@@ -386,6 +381,6 @@ describe("summarizationMiddleware", () => {
386381
});
387382

388383
const result = await agent.invoke({ messages: [] });
389-
expect(result.messages.length).toBeGreaterThan(0);
384+
expect(result.messages.at(-1)?.content).toBe("Mocked response");
390385
});
391386
});

0 commit comments

Comments
 (0)