Home / Function/ __init__() — anthropic-sdk-python Function Reference

__init__() — anthropic-sdk-python Function Reference

Architecture documentation for the __init__() function in _response.py from the anthropic-sdk-python codebase.

Entity Profile

Dependency Diagram

graph TD
  e3320dc2_62d3_bc8e_ae86_ed2c72167e98["__init__()"]
  4f52ffb4_64ae_2d69_4dea_c95441688201["StreamAlreadyConsumed"]
  e3320dc2_62d3_bc8e_ae86_ed2c72167e98 -->|defined in| 4f52ffb4_64ae_2d69_4dea_c95441688201
  1462fd68_77f7_ffc4_dac8_6a8db0e245ad["read()"]
  e3320dc2_62d3_bc8e_ae86_ed2c72167e98 -->|calls| 1462fd68_77f7_ffc4_dac8_6a8db0e245ad
  style e3320dc2_62d3_bc8e_ae86_ed2c72167e98 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/anthropic/_response.py lines 626–636

    def __init__(self) -> None:
        message = (
            "Attempted to read or stream some content, but the content has "
            "already been streamed. "
            "This could be due to attempting to stream the response "
            "content more than once."
            "\n\n"
            "You can fix this by manually accumulating the response content while streaming "
            "or by calling `.read()` before starting to stream."
        )
        super().__init__(message)

Subdomains

Calls

Frequently Asked Questions

What does __init__() do?
__init__() is a function in the anthropic-sdk-python codebase, defined in src/anthropic/_response.py.
Where is __init__() defined?
__init__() is defined in src/anthropic/_response.py at line 626.
What does __init__() call?
__init__() calls 1 function(s): read.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free