From 35a450e52c141d8f2dd6b89e6af89a70948cf61a Mon Sep 17 00:00:00 2001 From: Alessandro Pignotti Date: Thu, 19 Dec 2024 22:22:08 +0100 Subject: [PATCH] Claude: Remove image payloads after the have been sent We should really not send them everytime --- src/lib/anthropic.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/lib/anthropic.js b/src/lib/anthropic.js index 076f793..e4baca1 100644 --- a/src/lib/anthropic.js +++ b/src/lib/anthropic.js @@ -38,6 +38,16 @@ async function sendMessages(handleTool) var dc = get(displayConfig); var tool = dc ? { type: "computer_20241022", name: "computer", display_width_px: dc.width, display_height_px: dc.height } : { type: "bash_20241022", name: "bash" } const response = await client.beta.messages.create({max_tokens: 1024, messages: messages, model: 'claude-3-5-sonnet-20241022', tools: [tool], betas: ["computer-use-2024-10-22"]}); + // Remove all the image payloads, we don't want to send them over and over again + for(var i=0;i