mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-09-19 16:17:20 +00:00
fix:Modify the remove_think that directly retrieves the configuration file from the requester, retrieves it from the runner, and passes it to the required function
This commit is contained in:
@@ -53,6 +53,7 @@ class AnthropicMessages(requester.ProviderAPIRequester):
|
||||
messages: typing.List[llm_entities.Message],
|
||||
funcs: typing.List[tools_entities.LLMFunction] = None,
|
||||
extra_args: dict[str, typing.Any] = {},
|
||||
remove_think: bool = False,
|
||||
) -> llm_entities.Message:
|
||||
self.client.api_key = model.token_mgr.get_token()
|
||||
|
||||
@@ -151,7 +152,7 @@ class AnthropicMessages(requester.ProviderAPIRequester):
|
||||
assert type(resp) is anthropic.types.message.Message
|
||||
|
||||
for block in resp.content:
|
||||
if block.type == 'thinking':
|
||||
if not remove_think and block.type == 'thinking':
|
||||
args['content'] = '<think>' + block.thinking + '</think>\n' + args['content']
|
||||
elif block.type == 'text':
|
||||
args['content'] += block.text
|
||||
|
||||
Reference in New Issue
Block a user