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
No related branches found
No related tags found
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> { ...@@ -118,7 +118,7 @@ export class AnthropicProvider extends Provider<AnthropicStreamEvent> {
if (!delta && !options) continue; if (!delta && !options) continue;
yield { yield {
delta, delta: options ? "" : delta,
options, options,
raw: response, raw: response,
}; };
......
...@@ -144,6 +144,8 @@ export const mapChatMessagesToAnthropicMessages = < ...@@ -144,6 +144,8 @@ export const mapChatMessagesToAnthropicMessages = <
const content = message.content[0]; const content = message.content[0];
if (content.type === "text" && !content.text) return false; if (content.type === "text" && !content.text) return false;
if (content.type === "image" && !content.source.data) return false; if (content.type === "image" && !content.source.data) return false;
if (content.type === "image" && message.role === "assistant")
return false;
return true; return true;
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment