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
  804494a0_9cfb_3f57_2cc6_c01a157782f6["close()"]
  e621e870_ca7f_408e_c8bb_3d408ede66a4["MessageStream"]
  804494a0_9cfb_3f57_2cc6_c01a157782f6 -->|defined in| e621e870_ca7f_408e_c8bb_3d408ede66a4
  89eeec62_b34b_6669_ea96_d4cf2cb99af8["__exit__()"]
  89eeec62_b34b_6669_ea96_d4cf2cb99af8 -->|calls| 804494a0_9cfb_3f57_2cc6_c01a157782f6
  ff2b34fc_bdb4_76f9_4c6c_9b33a7133ead["close()"]
  ff2b34fc_bdb4_76f9_4c6c_9b33a7133ead -->|calls| 804494a0_9cfb_3f57_2cc6_c01a157782f6
  03308b66_ce9e_06ff_1dec_09a506aec885["__exit__()"]
  03308b66_ce9e_06ff_1dec_09a506aec885 -->|calls| 804494a0_9cfb_3f57_2cc6_c01a157782f6
  ff2b34fc_bdb4_76f9_4c6c_9b33a7133ead["close()"]
  804494a0_9cfb_3f57_2cc6_c01a157782f6 -->|calls| ff2b34fc_bdb4_76f9_4c6c_9b33a7133ead
  style 804494a0_9cfb_3f57_2cc6_c01a157782f6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/anthropic/lib/streaming/_messages.py lines 81–87

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

        Automatically called if the response body is read to completion.
        """
        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 81.
What does close() call?
close() calls 1 function(s): close.
What calls close()?
close() is called by 3 function(s): __exit__, __exit__, close.

Analyze Your Own Codebase

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

Try Supermodel Free