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 SyncAPI calls 1 called by 2

Entity Profile

Dependency Diagram

graph TD
  777716cd_b9ad_01f3_69e3_207b522f7bb6["close()"]
  03fc0a8b_1c63_1aee_ef30_754aeebc2ff6["AsyncStream"]
  777716cd_b9ad_01f3_69e3_207b522f7bb6 -->|defined in| 03fc0a8b_1c63_1aee_ef30_754aeebc2ff6
  ae6ec5e9_59f7_69b5_d385_025941be2db1["close()"]
  ae6ec5e9_59f7_69b5_d385_025941be2db1 -->|calls| 777716cd_b9ad_01f3_69e3_207b522f7bb6
  5d382d51_42db_9755_1edc_01ad6f39c93f["__aexit__()"]
  5d382d51_42db_9755_1edc_01ad6f39c93f -->|calls| 777716cd_b9ad_01f3_69e3_207b522f7bb6
  ae6ec5e9_59f7_69b5_d385_025941be2db1["close()"]
  777716cd_b9ad_01f3_69e3_207b522f7bb6 -->|calls| ae6ec5e9_59f7_69b5_d385_025941be2db1
  style 777716cd_b9ad_01f3_69e3_207b522f7bb6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/anthropic/_streaming.py lines 249–255

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

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

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/_streaming.py.
Where is close() defined?
close() is defined in src/anthropic/_streaming.py at line 249.
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