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

close() — anthropic-sdk-python Function Reference

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

Function python AnthropicClient AsyncAPI calls 1 called by 5

Entity Profile

Dependency Diagram

graph TD
  ae6ec5e9_59f7_69b5_d385_025941be2db1["close()"]
  3c15a36b_3b82_93a8_fe82_3d955b1934ca["Stream"]
  ae6ec5e9_59f7_69b5_d385_025941be2db1 -->|defined in| 3c15a36b_3b82_93a8_fe82_3d955b1934ca
  969e9f26_ae95_4fc0_cc9f_144e58839977["__exit__()"]
  969e9f26_ae95_4fc0_cc9f_144e58839977 -->|calls| ae6ec5e9_59f7_69b5_d385_025941be2db1
  777716cd_b9ad_01f3_69e3_207b522f7bb6["close()"]
  777716cd_b9ad_01f3_69e3_207b522f7bb6 -->|calls| ae6ec5e9_59f7_69b5_d385_025941be2db1
  4c16bca1_b34e_02e0_293c_b05a82fb3f82["close()"]
  4c16bca1_b34e_02e0_293c_b05a82fb3f82 -->|calls| ae6ec5e9_59f7_69b5_d385_025941be2db1
  e1c1dc57_89ae_cea1_a4a6_084c63e1e1fa["__stream__()"]
  e1c1dc57_89ae_cea1_a4a6_084c63e1e1fa -->|calls| ae6ec5e9_59f7_69b5_d385_025941be2db1
  5d382d51_42db_9755_1edc_01ad6f39c93f["__aexit__()"]
  5d382d51_42db_9755_1edc_01ad6f39c93f -->|calls| ae6ec5e9_59f7_69b5_d385_025941be2db1
  777716cd_b9ad_01f3_69e3_207b522f7bb6["close()"]
  ae6ec5e9_59f7_69b5_d385_025941be2db1 -->|calls| 777716cd_b9ad_01f3_69e3_207b522f7bb6
  style ae6ec5e9_59f7_69b5_d385_025941be2db1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/anthropic/_streaming.py lines 131–137

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

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

Subdomains

Calls

Frequently Asked Questions

What does close() do?
close() is a function in the anthropic-sdk-python codebase, defined in src/anthropic/_streaming.py.
Where is close() defined?
close() is defined in src/anthropic/_streaming.py at line 131.
What does close() call?
close() calls 1 function(s): close.
What calls close()?
close() is called by 5 function(s): __aexit__, __exit__, __stream__, close, close.

Analyze Your Own Codebase

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

Try Supermodel Free