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

close() — anthropic-sdk-python Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  ff2b34fc_bdb4_76f9_4c6c_9b33a7133ead["close()"]
  4f4cec09_94d5_eeb6_5c17_29d2af98f435["AsyncMessageStream"]
  ff2b34fc_bdb4_76f9_4c6c_9b33a7133ead -->|defined in| 4f4cec09_94d5_eeb6_5c17_29d2af98f435
  804494a0_9cfb_3f57_2cc6_c01a157782f6["close()"]
  804494a0_9cfb_3f57_2cc6_c01a157782f6 -->|calls| ff2b34fc_bdb4_76f9_4c6c_9b33a7133ead
  eecd94c8_5a69_9c0c_e45f_89578a735590["__aexit__()"]
  eecd94c8_5a69_9c0c_e45f_89578a735590 -->|calls| ff2b34fc_bdb4_76f9_4c6c_9b33a7133ead
  cef5c823_47b1_ea5d_e607_eb0cb87bf232["__aexit__()"]
  cef5c823_47b1_ea5d_e607_eb0cb87bf232 -->|calls| ff2b34fc_bdb4_76f9_4c6c_9b33a7133ead
  804494a0_9cfb_3f57_2cc6_c01a157782f6["close()"]
  ff2b34fc_bdb4_76f9_4c6c_9b33a7133ead -->|calls| 804494a0_9cfb_3f57_2cc6_c01a157782f6
  style ff2b34fc_bdb4_76f9_4c6c_9b33a7133ead fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/anthropic/lib/streaming/_messages.py lines 229–235

    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

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free