From bd5ec59b7cc3792a8ec3024a46d3da4fd307d94f Mon Sep 17 00:00:00 2001 From: fdc310 <82008029+fdc310@users.noreply.github.com> Date: Sat, 21 Mar 2026 22:08:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:The=20fix=20is=20in=20place=20=E2=80=94=20c?= =?UTF-8?q?ontent=20=3D=20''=20is=20now=20reset=20at=20the=20start=20of=20?= =?UTF-8?q?each=20loop=20iteration=20,=20which=20prevents=20stale=20text?= =?UTF-8?q?=20from=20being=20duplicated=20across=20tool=20call=20and=20end?= =?UTF-8?q?-turn=20chunks.=20(#2060)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/langbot/pkg/provider/modelmgr/requesters/anthropicmsgs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/langbot/pkg/provider/modelmgr/requesters/anthropicmsgs.py b/src/langbot/pkg/provider/modelmgr/requesters/anthropicmsgs.py index 9394b73d..1428dc88 100644 --- a/src/langbot/pkg/provider/modelmgr/requesters/anthropicmsgs.py +++ b/src/langbot/pkg/provider/modelmgr/requesters/anthropicmsgs.py @@ -288,10 +288,10 @@ class AnthropicMessages(requester.ProviderAPIRequester): think_started = False think_ended = False finish_reason = False - content = '' tool_name = '' tool_id = '' async for chunk in await self.client.messages.create(**args): + content = '' tool_call = {'id': None, 'function': {'name': None, 'arguments': None}, 'type': 'function'} if isinstance( chunk, anthropic.types.raw_content_block_start_event.RawContentBlockStartEvent