Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

enhancement: Add tool_name to ToolContext to support shared tool handlers#1043

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

vrtnis
Copy link
Contributor

This adds atool_name field toToolContext, which gets passed into theon_invoke_tool handler. Helpful for scenarios where we dynamically register multiple tools that all share a single generic handler e.g.in multi-agent setups.

As such, by including the name of the tool that was invoked, the handler can now easily branch logic or route requests accordingly.

Resolves#1030

All tests pass. and here is a script to test it outhttps://gist.github.com/vrtnis/ca354244f7a5ecd9a73c0a2d34cb194b

Copy link
Member

@seratchseratch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks for quickly working on this!

vrtnis reacted with thumbs up emoji
@seratchseratch added enhancementNew feature or request feature:core labelsJul 10, 2025
@vrtnis
Copy link
ContributorAuthor

Thanks for the thoughtful feedback@seratch! I've pushed an update that addresses it..if any changes are needed further, please lmk!

Copy link
Member

@seratchseratch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Once the added### Tool context document section is deleted and#1048 gets merged, this looks good to me.

@rm-openai Can you take a quick look and share thoughts if you have any?

@seratchseratch requested a review fromrm-openaiJuly 10, 2025 06:41
Co-authored-by: Kazuhiro Sera <seratch@openai.com>
@rm-openairm-openai merged commitbefe19d intoopenai:mainJul 14, 2025
5 checks passed
rm-openai added a commit that referenced this pull requestJul 14, 2025
rm-openai added a commit that referenced this pull requestJul 14, 2025
… tool handlers (#1043)" (#1105)Original commit changeset:befe19dcausing test failures, so reverting
rm-openai pushed a commit that referenced this pull requestJul 15, 2025
This is a follow-up to pr#1043 The original changes were reverted dueto missing updates in RealtimeSession, which caused runtime testfailures.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-versionPython 3.9) pass cleanly.Closes#1030---------Co-authored-by: Kazuhiro Sera <seratch@openai.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@seratchseratchseratch approved these changes

@rm-openairm-openaiAwaiting requested review from rm-openai

Assignees
No one assigned
Labels
enhancementNew feature or requestfeature:core
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Addtool_name toToolContext for generic tool handlers
3 participants
@vrtnis@seratch@rm-openai

[8]ページ先頭

©2009-2025 Movatter.jp