MCPcopy
hub / github.com/openai/openai-python / iter_bytes

Method iter_bytes

src/openai/_response.py:470–477  ·  view source on GitHub ↗

A byte-iterator over the decoded response content. This automatically handles gzip, deflate and brotli encoded responses.

(self, chunk_size: int | None = None)

Source from the content-addressed store, hash-verified

468 await self.http_response.aclose()
469
470 async def iter_bytes(self, chunk_size: int | None = None) -> AsyncIterator[bytes]:
471 """
472 A byte-iterator over the decoded response content.
473
474 This automatically handles gzip, deflate and brotli encoded responses.
475 """
476 async for chunk in self.http_response.aiter_bytes(chunk_size):
477 yield chunk
478
479 async def iter_text(self, chunk_size: int | None = None) -> AsyncIterator[str]:
480 """A str-iterator over the decoded response content

Callers

nothing calls this directly

Calls 1

aiter_bytesMethod · 0.45

Tested by

no test coverage detected