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

Feat: separate tool_call_item and tool_call_output_item in stream events#974

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

Open
gdisk wants to merge2 commits intoopenai:main
base:main
Choose a base branch
Loading
fromgdisk:main

Conversation

gdisk
Copy link

Summary

During my analysis of the streaming API (run_streamed) results, I noticed that tool_call_item and tool_call_output_item events are currently being emitted concurrently upon tool call completion (as evidenced in #831). This implementation conflates what should logically be distinct events. The current PR addresses this by properly separating these event triggers to better reflect the actual workflow.

Test plan

The test file is created intests namedtest_stream_events.py.Run the test script below to test.

pytest -s test_stream_events.py

The test result is:

======================================================================== test session starts ======================================================================== platform win32 -- Python 3.12.10, pytest-8.3.5, pluggy-1.5.0rootdir: D:\moon\projects\openai-agents-pythonconfigfile: pyproject.tomlplugins: anyio-4.9.0, inline-snapshot-0.22.3, asyncio-0.26.0, mock-3.14.0asyncio: mode=Mode.AUTO, asyncio_default_fixture_loop_scope=session, asyncio_default_test_loop_scope=functioncollected 1 item                                                                                                                                                      tests\test_stream_events.py === Run starting ===Agent updated: Joker-- Message output: a_message-- Tool was called at 1751271106971851300-- Tool output: success! at 1751271109987313900-- Message output: done=== Run complete ===.========================================================================= 1 passed in 3.07s =========================================================================

Issue number

#831

Checks

  • I've added new tests (if relevant)
  • I've runmake lint andmake format
  • I've made sure tests pass

Suneel5 reacted with thumbs up emoji
@legeRise
Copy link

hi i was just trying to get an effect of calling a tool with its name displays with a spinner and then after sometime the output
and
noticed both events are emitting at the same time

so is it fixed Now? can i use it

@gdisk
Copy link
Author

hi i was just trying to get an effect of calling a tool with its name displays with a spinner and then after sometime the output and noticed both events are emitting at the same time

so is it fixed Now? can i use it

Yeah, just check out this PR and run the tests to verify.

legeRise reacted with thumbs up emoji

@legeRise
Copy link

legeRise commentedJul 1, 2025
edited
Loading

hi i was just trying to get an effect of calling a tool with its name displays with a spinner and then after sometime the output and noticed both events are emitting at the same time
so is it fixed Now? can i use it

Yeah, just check out this PR and run the tests to verify.

thank you so much. it works. hope it gets merged soon

@Suneel5
Copy link

Waiting for it to get merged soon

@seratchseratch added bugSomething isn't working enhancementNew feature or request feature:core labelsJul 8, 2025
@mattmorgis
Copy link

mattmorgis commentedJul 16, 2025
edited
Loading

@gdisk thank you for this PR 🙏 hoping they merge soon

cc/@rm-openai in case you haven't seen yet.

Suneel5 reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
bugSomething isn't workingenhancementNew feature or requestfeature:core
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@gdisk@legeRise@Suneel5@mattmorgis@seratch

[8]ページ先頭

©2009-2025 Movatter.jp