MCPcopy
hub / github.com/anthropics/anthropic-sdk-python / read

Method read

src/anthropic/_response.py:360–368  ·  view source on GitHub ↗

Read and return the binary response content.

(self)

Source from the content-addressed store, hash-verified

358 return cast(R, parsed)
359
360 def read(self) -> bytes:
361 """Read and return the binary response content."""
362 try:
363 return self.http_response.read()
364 except httpx.StreamConsumed as exc:
365 # The default error raised by httpx isn't very
366 # helpful in our case so we re-raise it with
367 # a different error message.
368 raise StreamAlreadyConsumed() from exc
369
370 def text(self) -> str:
371 """Read and decode the response content into a string."""

Callers 15

parseMethod · 0.95
textMethod · 0.95
jsonMethod · 0.95
requestMethod · 0.45
_format_dataFunction · 0.45
_async_format_dataFunction · 0.45
scanFunction · 0.45
_prepare_requestMethod · 0.45
_prepare_requestMethod · 0.45
_prepare_requestMethod · 0.45
_prepare_requestMethod · 0.45
_read_jsonFunction · 0.45

Calls 1