Claude reasoning small fix

This commit is contained in:
Andrew Pareles
2025-04-15 17:30:35 -07:00
parent 5e84fca100
commit 3a08edc266
@@ -143,13 +143,19 @@ const prepareMessages_anthropic_tools = (messages: SimpleLLMMessage[], supportsA
// add anthropic reasoning
if (currMsg.role === 'assistant') {
if (currMsg.anthropicReasoning && supportsAnthropicReasoning) {
const content = currMsg.content
newMessages[i] = {
role: 'assistant',
content: content ? [...currMsg.anthropicReasoning, { type: 'text' as const, text: content }] : currMsg.anthropicReasoning
}
}
else {
newMessages[i] = {
role: 'assistant',
content: currMsg.content,
// strip away anthropicReasoning
}
}
continue
}