Home / Class/ AsyncMessages Class — anthropic-sdk-python Architecture

AsyncMessages Class — anthropic-sdk-python Architecture

Architecture documentation for the AsyncMessages class in _beta_messages.py from the anthropic-sdk-python codebase.

Entity Profile

Dependency Diagram

graph TD
  c5e503a1_4560_6ed8_182b_6b790f24ef7a["AsyncMessages"]
  f98629a5_73f4_23f2_1f7f_c8db837848d1["AsyncAPIResource"]
  c5e503a1_4560_6ed8_182b_6b790f24ef7a -->|extends| f98629a5_73f4_23f2_1f7f_c8db837848d1
  b4641bb5_9dee_e780_9e9c_66a8c11b2481["_beta_messages.py"]
  c5e503a1_4560_6ed8_182b_6b790f24ef7a -->|defined in| b4641bb5_9dee_e780_9e9c_66a8c11b2481
  6515c4c2_1c20_6eb3_9943_bc2d8d246557["with_raw_response()"]
  c5e503a1_4560_6ed8_182b_6b790f24ef7a -->|method| 6515c4c2_1c20_6eb3_9943_bc2d8d246557
  7aed5dc1_5dbe_c61e_02dc_c08448c64e4c["with_streaming_response()"]
  c5e503a1_4560_6ed8_182b_6b790f24ef7a -->|method| 7aed5dc1_5dbe_c61e_02dc_c08448c64e4c

Relationship Graph

Source Code

src/anthropic/lib/vertex/_beta_messages.py lines 39–61

class AsyncMessages(AsyncAPIResource):
    create = FirstPartyAsyncMessagesAPI.create
    stream = FirstPartyAsyncMessagesAPI.stream
    count_tokens = FirstPartyAsyncMessagesAPI.count_tokens

    @cached_property
    def with_raw_response(self) -> AsyncMessagesWithRawResponse:
        """
        This property can be used as a prefix for any HTTP method call to return the
        the raw response object instead of the parsed content.

        For more information, see https://www.github.com/anthropics/anthropic-sdk-python#accessing-raw-response-data-eg-headers
        """
        return AsyncMessagesWithRawResponse(self)

    @cached_property
    def with_streaming_response(self) -> AsyncMessagesWithStreamingResponse:
        """
        An alternative to `.with_raw_response` that doesn't eagerly read the response body.

        For more information, see https://www.github.com/anthropics/anthropic-sdk-python#with_streaming_response
        """
        return AsyncMessagesWithStreamingResponse(self)

Frequently Asked Questions

What is the AsyncMessages class?
AsyncMessages is a class in the anthropic-sdk-python codebase, defined in src/anthropic/lib/vertex/_beta_messages.py.
Where is AsyncMessages defined?
AsyncMessages is defined in src/anthropic/lib/vertex/_beta_messages.py at line 39.
What does AsyncMessages extend?
AsyncMessages extends AsyncAPIResource.

Analyze Your Own Codebase

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

Try Supermodel Free