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 ebad253b_be4f_1b54_b2e3_1949e019e1a6["close()"] fa27ef0f_31e3_cd5e_ffa3_12becd4b426b["BetaMessageStream"] ebad253b_be4f_1b54_b2e3_1949e019e1a6 -->|defined in| fa27ef0f_31e3_cd5e_ffa3_12becd4b426b cec6357f_9d99_49da_edeb_dead71ddbfac["__exit__()"] cec6357f_9d99_49da_edeb_dead71ddbfac -->|calls| ebad253b_be4f_1b54_b2e3_1949e019e1a6 5bff697f_abb4_8e35_16b7_0a9a63f52fac["close()"] 5bff697f_abb4_8e35_16b7_0a9a63f52fac -->|calls| ebad253b_be4f_1b54_b2e3_1949e019e1a6 022770a7_09be_44a2_c8a9_056d4a3a749e["__exit__()"] 022770a7_09be_44a2_c8a9_056d4a3a749e -->|calls| ebad253b_be4f_1b54_b2e3_1949e019e1a6 1044cd7b_89c9_dbc5_8621_552b5d8e3bc9["__aexit__()"] 1044cd7b_89c9_dbc5_8621_552b5d8e3bc9 -->|calls| ebad253b_be4f_1b54_b2e3_1949e019e1a6 6b148dd1_c821_c1d9_619b_8727da38e1f7["__aexit__()"] 6b148dd1_c821_c1d9_619b_8727da38e1f7 -->|calls| ebad253b_be4f_1b54_b2e3_1949e019e1a6 5bff697f_abb4_8e35_16b7_0a9a63f52fac["close()"] ebad253b_be4f_1b54_b2e3_1949e019e1a6 -->|calls| 5bff697f_abb4_8e35_16b7_0a9a63f52fac style ebad253b_be4f_1b54_b2e3_1949e019e1a6 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
src/anthropic/lib/streaming/_beta_messages.py lines 84–90
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()
Domain
Subdomains
Calls
Source
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 84.
What does close() call?
close() calls 1 function(s): close.
What calls close()?
close() is called by 5 function(s): __aexit__, __aexit__, __exit__, __exit__, close.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free