feat: display thinking content in web console

This commit is contained in:
zhayujie
2026-04-10 15:07:23 +08:00
parent 54e81aba11
commit 6a737fb734
10 changed files with 285 additions and 89 deletions

View File

@@ -429,8 +429,21 @@ class ClaudeAPIBot(Bot, OpenAIImage):
delta = event.get("delta", {})
delta_type = delta.get("type")
if delta_type == "text_delta":
# Text content
if delta_type == "thinking_delta":
thinking_text = delta.get("thinking", "")
if thinking_text:
yield {
"choices": [{
"index": 0,
"delta": {
"role": "assistant",
"reasoning_content": thinking_text
},
"finish_reason": None
}]
}
elif delta_type == "text_delta":
content = delta.get("text", "")
yield {
"id": event.get("id", ""),