Skip to content
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

_stream in async client raises RuntimeError when processing HTTP errors #266

Merged
merged 1 commit into from
Aug 29, 2024

Conversation

Oneirag
Copy link
Contributor

@Oneirag Oneirag commented Aug 28, 2024

When response received in AsyncClient._stream has an HTTP error, the process raises a RuntimeError("Attempted to call a sync iterator on an async stream.") due to the use of e.response.read() instead of await e.response.aread()

Fixes a bug processing errors in async client. When response in _stream has an HTTP error, the process raises a RuntimeError("Attempted to call a sync iterator on an async stream.") due to use of e.response.read() instead of await e.response.aread()
Copy link
Collaborator

@mxyng mxyng 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 the fix!

@mxyng mxyng merged commit 81edab1 into ollama:main Aug 29, 2024
5 checks passed
@WikiLucas00
Copy link

Hello @mxyng I don't think this fix is included in the latest release. Do you have a estimated date for the next release please?

@mxyng
Copy link
Collaborator

mxyng commented Sep 9, 2024

I just created a new release. Thanks for the reminder.

@WikiLucas00
Copy link

You're welcome! Thanks a lot for your responsiveness 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants