mirror of
https://github.com/voideditor/void
synced 2026-05-24 09:58:23 +00:00
Merge pull request #575 from voideditor/model-selection
fix anthropic empty err message
This commit is contained in:
commit
bafbdd9df3
1 changed files with 1 additions and 0 deletions
|
|
@ -418,6 +418,7 @@ const prepareOpenAIOrAnthropicMessages = ({
|
||||||
else {
|
else {
|
||||||
// allowed to be empty if has a tool in it or following it
|
// allowed to be empty if has a tool in it or following it
|
||||||
if (currMsg.content.find(c => c.type === 'tool_result' || c.type === 'tool_use')) {
|
if (currMsg.content.find(c => c.type === 'tool_result' || c.type === 'tool_use')) {
|
||||||
|
currMsg.content = currMsg.content.filter(c => !(c.type === 'text' && !c.text)) as any
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if (nextMsg?.role === 'tool') continue
|
if (nextMsg?.role === 'tool') continue
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue