ToolCall.tool_call_id property, refs #937

This commit is contained in:
Simon Willison 2025-05-11 17:14:38 -07:00
parent 290c311ce1
commit c990578934
2 changed files with 2 additions and 0 deletions

View file

@ -656,6 +656,7 @@ class Chat(_Shared, KeyModel):
# ChoiceDeltaToolCallFunction(arguments='{"city":"San Francisco"}', name='get_weather')
response.add_tool_call(
llm.ToolCall(
tool_call_id=value.id,
name=value.function.name,
arguments=json.loads(value.function.arguments),
)

View file

@ -169,6 +169,7 @@ class Tool:
class ToolCall:
name: str
arguments: dict
tool_call_id: Optional[str] = None
@dataclass