Fix haiku prompt caching when tool prompt doesnt meet min required tokens

This commit is contained in:
Saoud Rizwan
2024-08-15 20:37:15 -04:00
parent 6989779dd6
commit a0f2a08f35
2 changed files with 14 additions and 26 deletions

View File

@@ -56,9 +56,7 @@ export class AnthropicHandler implements ApiHandler {
}
return message
}),
tools: tools.map((tool, index) =>
index === tools.length - 1 ? { ...tool, cache_control: { type: "ephemeral" } } : tool
),
tools, // cache breakpoints go from tools > system > messages, and since tools dont change, we can just set the breakpoint at the end of system (this avoids having to set a breakpoint at the end of tools which by itself does not meet min requirements for haiku caching)
tool_choice: { type: "auto" },
},
(() => {