Merge pull request #1150 from Tigrex-Dai/master

添加针对Anthropic新模型的thinking开关
This commit is contained in:
Junyan Qin (Chin)
2025-03-02 15:39:58 +08:00
committed by GitHub

View File

@@ -146,7 +146,9 @@ class AnthropicMessages(requester.LLMAPIRequester):
assert type(resp) is anthropic.types.message.Message
for block in resp.content:
if block.type == 'text':
if block.type == 'thinking':
args['content'] = '<think>' + block.thinking + '</think>\n' + args['content']
elif block.type == 'text':
args['content'] += block.text
elif block.type == 'tool_use':
assert type(block) is anthropic.types.tool_use_block.ToolUseBlock