-
Notifications
You must be signed in to change notification settings - Fork 376
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
Missing stream=True Parameter in _StreamGenerateContent Class of GenerativeServiceRestTransport Causes Non-Streaming Requests #492
Comments
Please let me know if there is another repository that would be more appropriate for suggesting this fix. |
Hi, Maybe you're misunderstanding this code. The The SDK converts This is working as expected:
If you raised this error because in Colab it waits till all the chunks are available before yielding the first one, that's an issue with Colab, not these libraries. |
Hi @MarkDaoust , thank you for your quick reply! I am aware of your example from: https://github.com/google-gemini/cookbook/blob/main/quickstarts/Streaming.ipynb I am referring to the stream parameter of the requests library that is used to make the call within the REST transport implementation
|
Oh, I got it now. Thanks for clarifying. Yeah, you're right and that totally fixes it, thanks! The required change is in the generated client library, |
I can't fix this here, so I've reported the problem over on the |
Thanks! |
Okay, they've merged that into the client library generator. So this will actually be fixed with the next release of google-ai-generativelanguage, (whenever that is). https://pypi.org/project/google-ai-generativelanguage/#history It should work in anything after 6.10 |
Description of the bug:
In the
_StreamGenerateContent
class of theGenerativeServiceRestTransport
implementation for the Google AI Generative Language service, the HTTP request intended for streaming does not include thestream=True
parameter. This omission results in non-streaming behavior, contrary to the expected functionality.Actual vs expected behavior:
Actual Behavior:
The
_StreamGenerateContent
class makes a non-streaming HTTP request using the REST transport.Expected Behavior:
The
_StreamGenerateContent
class should make a streaming HTTP request using the REST transport.Any other information you'd like to share?
Code Location:
/google/ai/generativelanguage_v1beta/services/generative_service/transports/rest.py
Current Code Snippet:
Proposed Fix:
Add the stream=True parameter to the request call:
The text was updated successfully, but these errors were encountered: