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

Method read

src/anthropic/_response.py:467–475  ·  view source on GitHub ↗

Read and return the binary response content.

(self)

Source from the content-addressed store, hash-verified

465 return cast(R, parsed)
466
467 async def read(self) -> bytes:
468 """Read and return the binary response content."""
469 try:
470 return await self.http_response.aread()
471 except httpx.StreamConsumed as exc:
472 # the default error raised by httpx isn't very
473 # helpful in our case so we re-raise it with
474 # a different error message
475 raise StreamAlreadyConsumed() from exc
476
477 async def text(self) -> str:
478 """Read and decode the response content into a string."""

Callers 3

parseMethod · 0.95
textMethod · 0.95
jsonMethod · 0.95

Calls 2

areadMethod · 0.80

Tested by

no test coverage detected