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

close() — anthropic-sdk-python Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  5bff697f_abb4_8e35_16b7_0a9a63f52fac["close()"]
  8e652b46_6f9a_daae_5db8_1aa0b9386626["BetaAsyncMessageStream"]
  5bff697f_abb4_8e35_16b7_0a9a63f52fac -->|defined in| 8e652b46_6f9a_daae_5db8_1aa0b9386626
  ebad253b_be4f_1b54_b2e3_1949e019e1a6["close()"]
  ebad253b_be4f_1b54_b2e3_1949e019e1a6 -->|calls| 5bff697f_abb4_8e35_16b7_0a9a63f52fac
  1044cd7b_89c9_dbc5_8621_552b5d8e3bc9["__aexit__()"]
  1044cd7b_89c9_dbc5_8621_552b5d8e3bc9 -->|calls| 5bff697f_abb4_8e35_16b7_0a9a63f52fac
  ebad253b_be4f_1b54_b2e3_1949e019e1a6["close()"]
  5bff697f_abb4_8e35_16b7_0a9a63f52fac -->|calls| ebad253b_be4f_1b54_b2e3_1949e019e1a6
  style 5bff697f_abb4_8e35_16b7_0a9a63f52fac fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/anthropic/lib/streaming/_beta_messages.py lines 233–239

    async def close(self) -> None:
        """
        Close the response and release the connection.

        Automatically called if the response body is read to completion.
        """
        await self._raw_stream.close()

Subdomains

Calls

Called By

Frequently Asked Questions

What does close() do?
close() is a function in the anthropic-sdk-python codebase, defined in src/anthropic/lib/streaming/_beta_messages.py.
Where is close() defined?
close() is defined in src/anthropic/lib/streaming/_beta_messages.py at line 233.
What does close() call?
close() calls 1 function(s): close.
What calls close()?
close() is called by 2 function(s): __aexit__, close.

Analyze Your Own Codebase

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

Try Supermodel Free