fix: add temp hack to gracefully handle parallel tool calling (#2654)

This commit is contained in:
cthomas
2025-06-05 14:43:46 -07:00
committed by GitHub
parent c323771762
commit 22c66da7bc
3 changed files with 9 additions and 3 deletions

View File

@@ -379,7 +379,7 @@ class AnthropicStreamingInterface:
group: List[Union[ReasoningMessage, HiddenReasoningMessage]], group_type: str
) -> Union[TextContent, ReasoningContent, RedactedReasoningContent]:
if group_type == "reasoning":
reasoning_text = "".join(chunk.reasoning for chunk in group)
reasoning_text = "".join(chunk.reasoning for chunk in group).strip()
is_native = any(chunk.source == "reasoner_model" for chunk in group)
signature = next((chunk.signature for chunk in group if chunk.signature is not None), None)
if is_native: