You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Retry: Add tool_name to ToolContext for generic tool handlers (#1110)
This is a follow-up to pr #1043 The original changes were reverted due
to missing updates in RealtimeSession, which caused runtime test
failures.
This PR:
- Reapplies the `tool_name` and `tool_call_id` additions to
`ToolContext`.
- Updates `RealtimeSession._handle_tool_call` to instantiate
`ToolContext` with `tool_name=event.name` and
`tool_call_id=event.call_id`.
- Adjusts tests as needed so that all 533 tests (including old-version
Python 3.9) pass cleanly.
Closes#1030
---------
Co-authored-by: Kazuhiro Sera <[email protected]>
Copy file name to clipboardExpand all lines: docs/tools.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -180,7 +180,7 @@ Sometimes, you don't want to use a Python function as a tool. You can directly c
180
180
-`name`
181
181
-`description`
182
182
-`params_json_schema`, which is the JSON schema for the arguments
183
-
-`on_invoke_tool`, which is an async function that receives the context and the arguments as a JSON string, and must return the tool output as a string.
183
+
-`on_invoke_tool`, which is an async function that receives a [`ToolContext`][agents.tool_context.ToolContext] and the arguments as a JSON string, and must return the tool output as a string.
0 commit comments