Skip to content
Snippets Groups Projects
Unverified Commit 224d507a authored by Parham Saidi's avatar Parham Saidi Committed by GitHub
Browse files

fix: prevent anthropic tool calling getting mixed with conversation (#1078)

parent 1f680d73
Branches
Tags
No related merge requests found
---
"@llamaindex/community": patch
---
fix: prevent tool calling getting mixed with conversation
......@@ -118,7 +118,7 @@ export class AnthropicProvider extends Provider<AnthropicStreamEvent> {
if (!delta && !options) continue;
yield {
delta,
delta: options ? "" : delta,
options,
raw: response,
};
......
......@@ -144,6 +144,8 @@ export const mapChatMessagesToAnthropicMessages = <
const content = message.content[0];
if (content.type === "text" && !content.text) return false;
if (content.type === "image" && !content.source.data) return false;
if (content.type === "image" && message.role === "assistant")
return false;
return true;
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment