- Notifications
You must be signed in to change notification settings - Fork2k
Add Streaming of Function Call Arguments to Chat Completions#999
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
Add Streaming of Function Call Arguments to Chat Completions#999
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Hey@seratch@rm-openai! 👋 Would you mind taking a look at this PR? I've implemented real-time streaming for function call arguments (fixes#834). Basically, instead of waiting for the entire function call to complete, users now see the arguments being built up incrementally as the LLM generates them. This should make the experience much smoother for things like code generation and API building. Let me know what you think! 🚀 |
6687ab8
to3ee4d63
CompareThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thanks for your pull request. Left a few comments.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
fe8ba90
to34b1754
Compare@rm-openai@seratch hi there, just wanted to gently check in and see if you had a chance to review the PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Hey@devtalker this looks generally pretty good! However I did some digging and turns out this comment that I wrote is inaccurate in practice:
# Because we don't know the name of the function until the end of the stream, we'll save everything ...
The function name is actually correct the very first time, and doesn't change. AFAICT this applies to all LLM providers.
So you should be able to simplify the code a decent amount!
devtalker commentedJul 14, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@rm-openai Thanks for the feedback! I've simplified the function call name logic based on your observation that function names are correct from the first chunk. Please review the changes when you have a chance |
Hey@rm-openai! 👋 Could you take a quick look? We need this feature ASAP for better UX 🚀 |
00c87ea
intoopenai:mainUh oh!
There was an error while loading.Please reload this page.
Summary
This PR implements real-time streaming of function call arguments as requested in#834. Previously, function call arguments were only emitted after the entire function call was complete, causing poor user experience for large parameter generation.
Changes
ChatCmplStreamHandler
: Added real-time streaming of function call arguments during generationCloses#834