Merge pull request #575 from voideditor/model-selection

fix anthropic empty err message
This commit is contained in:
Andrew Pareles 2025-05-13 19:53:20 -07:00 committed by GitHub
commit bafbdd9df3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -418,6 +418,7 @@ const prepareOpenAIOrAnthropicMessages = ({
else {
// 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')) {
currMsg.content = currMsg.content.filter(c => !(c.type === 'text' && !c.text)) as any
continue
}
if (nextMsg?.role === 'tool') continue