mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-10 21:10:59 +00:00
Merge pull request #1150 from Tigrex-Dai/master
添加针对Anthropic新模型的thinking开关
This commit is contained in:
@@ -146,7 +146,9 @@ class AnthropicMessages(requester.LLMAPIRequester):
|
|||||||
assert type(resp) is anthropic.types.message.Message
|
assert type(resp) is anthropic.types.message.Message
|
||||||
|
|
||||||
for block in resp.content:
|
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
|
args['content'] += block.text
|
||||||
elif block.type == 'tool_use':
|
elif block.type == 'tool_use':
|
||||||
assert type(block) is anthropic.types.tool_use_block.ToolUseBlock
|
assert type(block) is anthropic.types.tool_use_block.ToolUseBlock
|
||||||
|
|||||||
Reference in New Issue
Block a user