Skip to content

Commit bda4204

Browse files
committed
add image compression back
1 parent bb02b3a commit bda4204

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/agent/AnthropicCUAClient.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import Anthropic from "@anthropic-ai/sdk";
1515
import { ToolSet } from "ai";
1616
import { AgentClient } from "./AgentClient";
1717
import { mapKeyToPlaywright } from "./utils/cuaKeyMapping";
18+
import { compressConversationImages } from "./utils/imageCompression";
1819

1920
export type ResponseInputItem = AnthropicMessage | AnthropicToolResult;
2021

@@ -323,6 +324,8 @@ export class AnthropicCUAClient extends AgentClient {
323324
const nextInputItems: ResponseInputItem[] = [...inputItems];
324325

325326
// Add the assistant message with tool_use blocks to the history
327+
compressConversationImages(nextInputItems);
328+
326329
nextInputItems.push(assistantMessage);
327330

328331
// Generate tool results and add them as a user message

0 commit comments

Comments
 (0)