feat: handle thinking blocks as reasoning blocks in chat normalization

This commit is contained in:
weishu
2025-12-26 13:35:27 +08:00
parent 8122768a01
commit 685c846b91
+4
View File
@@ -116,6 +116,10 @@ function normalizeAssistantOutput(
blocks.push({ type: 'text', text: block.text, uuid, parentUUID })
continue
}
if (block.type === 'thinking' && typeof block.thinking === 'string') {
blocks.push({ type: 'reasoning', text: block.thinking, uuid, parentUUID })
continue
}
if (block.type === 'tool_use' && typeof block.id === 'string') {
const name = asString(block.name) ?? 'Tool'
const input = 'input' in block ? (block as Record<string, unknown>).input : undefined