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

Method read

src/openai/_response.py:336–344  ·  view source on GitHub ↗

Read and return the binary response content.

(self)

Source from the content-addressed store, hash-verified

334 return cast(R, parsed)
335
336 def read(self) -> bytes:
337 """Read and return the binary response content."""
338 try:
339 return self.http_response.read()
340 except httpx.StreamConsumed as exc:
341 # The default error raised by httpx isn't very
342 # helpful in our case so we re-raise it with
343 # a different error message.
344 raise StreamAlreadyConsumed() from exc
345
346 def text(self) -> str:
347 """Read and decode the response content into a string."""

Callers 15

parseMethod · 0.95
textMethod · 0.95
jsonMethod · 0.95
requestMethod · 0.45
upload_file_chunkedMethod · 0.45
upload_file_chunkedMethod · 0.45
_format_dataFunction · 0.45
_async_format_dataFunction · 0.45
get_tokenFunction · 0.45
read_any_formatFunction · 0.45
format_fileFunction · 0.45
mainFunction · 0.45

Calls 1

Tested by 4

mock_handlerMethod · 0.36
_on_responseFunction · 0.36