Skip to content

fix(client) await httpx async responses #1079

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

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/openai/_legacy_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,16 +372,16 @@ async def aread(self) -> bytes:
return await self.response.aread()

async def aiter_bytes(self, chunk_size: int | None = None) -> AsyncIterator[bytes]:
return self.response.aiter_bytes(chunk_size)
return await self.response.aiter_bytes(chunk_size)

async def aiter_text(self, chunk_size: int | None = None) -> AsyncIterator[str]:
return self.response.aiter_text(chunk_size)
return await self.response.aiter_text(chunk_size)

async def aiter_lines(self) -> AsyncIterator[str]:
return self.response.aiter_lines()
return await self.response.aiter_lines()

async def aiter_raw(self, chunk_size: int | None = None) -> AsyncIterator[bytes]:
return self.response.aiter_raw(chunk_size)
return await self.response.aiter_raw(chunk_size)

@deprecated(
"Due to a bug, this method doesn't actually stream the response content, `.with_streaming_response.method()` should be used instead"
Expand Down