get_final_message() — anthropic-sdk-python Function Reference
Architecture documentation for the get_final_message() function in _messages.py from the anthropic-sdk-python codebase.
Entity Profile
Dependency Diagram
graph TD f4a46199_2749_e343_7f26_2f26657ae526["get_final_message()"] 4f4cec09_94d5_eeb6_5c17_29d2af98f435["AsyncMessageStream"] f4a46199_2749_e343_7f26_2f26657ae526 -->|defined in| 4f4cec09_94d5_eeb6_5c17_29d2af98f435 f7d7eda3_f48d_9a94_ee86_5e96ba366fee["get_final_message()"] f7d7eda3_f48d_9a94_ee86_5e96ba366fee -->|calls| f4a46199_2749_e343_7f26_2f26657ae526 85eb3149_498e_f553_00e0_c28342315541["get_final_text()"] 85eb3149_498e_f553_00e0_c28342315541 -->|calls| f4a46199_2749_e343_7f26_2f26657ae526 adb888ca_b9bd_2363_ade2_ad24ef72c39d["until_done()"] f4a46199_2749_e343_7f26_2f26657ae526 -->|calls| adb888ca_b9bd_2363_ade2_ad24ef72c39d f7d7eda3_f48d_9a94_ee86_5e96ba366fee["get_final_message()"] f4a46199_2749_e343_7f26_2f26657ae526 -->|calls| f7d7eda3_f48d_9a94_ee86_5e96ba366fee style f4a46199_2749_e343_7f26_2f26657ae526 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
src/anthropic/lib/streaming/_messages.py lines 237–243
async def get_final_message(self) -> ParsedMessage[ResponseFormatT]:
"""Waits until the stream has been read to completion and returns
the accumulated `Message` object.
"""
await self.until_done()
assert self.__final_message_snapshot is not None
return self.__final_message_snapshot
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does get_final_message() do?
get_final_message() is a function in the anthropic-sdk-python codebase, defined in src/anthropic/lib/streaming/_messages.py.
Where is get_final_message() defined?
get_final_message() is defined in src/anthropic/lib/streaming/_messages.py at line 237.
What does get_final_message() call?
get_final_message() calls 2 function(s): get_final_message, until_done.
What calls get_final_message()?
get_final_message() is called by 2 function(s): get_final_message, get_final_text.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free