feat: populate tool call name and id in when token streaming (#2639)

This commit is contained in:
cthomas
2025-06-04 17:06:44 -07:00
committed by GitHub
parent 5dcc1fa819
commit f8c0002fbc
2 changed files with 4 additions and 2 deletions

View File

@@ -277,7 +277,9 @@ class AnthropicStreamingInterface:
# Otherwise, it is a normal tool call - buffer or yield based on inner thoughts status
tool_call_msg = ToolCallMessage(
id=self.letta_tool_message_id,
tool_call=ToolCallDelta(arguments=delta.partial_json),
tool_call=ToolCallDelta(
name=self.tool_call_name, tool_call_id=self.tool_call_id, arguments=delta.partial_json
),
date=datetime.now(timezone.utc).isoformat(),
)
if self.inner_thoughts_complete:

View File

@@ -295,7 +295,7 @@ class OpenAIStreamingInterface:
id=self.letta_tool_message_id,
date=datetime.now(timezone.utc),
tool_call=ToolCallDelta(
name=None,
name=self.function_name_buffer,
arguments=combined_chunk,
tool_call_id=self.function_id_buffer,
),