-
Notifications
You must be signed in to change notification settings - Fork 5k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for streaming tool calls #1184
Added support for streaming tool calls #1184
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1184 +/- ##
===========================================
+ Coverage 30.38% 40.47% +10.09%
===========================================
Files 32 32
Lines 4302 4353 +51
Branches 994 1065 +71
===========================================
+ Hits 1307 1762 +455
+ Misses 2901 2464 -437
- Partials 94 127 +33
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@davorrunje It is streaming now, thank you! |
Ok this is streaming output to the terminal, which is great. However, I have AutoGen behind an API, and I want to stream the output back to the requestor. How would I do that using your repo? |
We could easily add a callback to be called, would that work for you? |
I've been doing a lot of work in this area but need to merge it with the latest
At least that's how I spec it. My implementation is pretty rough at this point. I've got it working except that my |
…or-streamed-function-calls
@tyler-suard-parker Can you please open an issue for that and we'll take it from there. I like the proposal, but it is outside of the scope of this PR. This is a cleanup on an already merged PR. |
…or-streamed-function-calls
You'll be able to use a generator if you like. An arbitrary dict can be specified alongside the callback, which is always passed back to it along with the openai responses. The issue I was having with it is resolved. Now to payback a bit of technical debt. |
* added support for streaming tool calls * bug fix: removed tmp assert --------- Co-authored-by: Chi Wang <wang.chi@microsoft.com>
* added support for streaming tool calls * bug fix: removed tmp assert --------- Co-authored-by: Chi Wang <wang.chi@microsoft.com>
This is closing an issue coming from a discussion in PR #1118:
choice.delta.function_call
is deprecated and we should usechoice.delta.tool_calls
instead (https://platform.openai.com/docs/api-reference/chat/streaming). Since tests are passing, we are probably not triggeringtool_calls
but adeprecated function_call
Other than that, some type hints were fixed so that two additional files pass mypy type checks. Mypy configuration is not part of this PR and no type-checking is added here.
Why are these changes needed?
Related issue number
Closes #1178
Checks