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

Messages Class — anthropic-sdk-python Architecture

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

Entity Profile

Dependency Diagram

graph TD
  1d6e787b_ff21_76b6_4d7e_ad965f61fe7e["Messages"]
  32bd9d9e_8b62_b229_7718_45771b424c40["SyncAPIResource"]
  1d6e787b_ff21_76b6_4d7e_ad965f61fe7e -->|extends| 32bd9d9e_8b62_b229_7718_45771b424c40
  b4641bb5_9dee_e780_9e9c_66a8c11b2481["_beta_messages.py"]
  1d6e787b_ff21_76b6_4d7e_ad965f61fe7e -->|defined in| b4641bb5_9dee_e780_9e9c_66a8c11b2481
  ffa28681_827f_818a_08e7_ea3fe26e56db["with_raw_response()"]
  1d6e787b_ff21_76b6_4d7e_ad965f61fe7e -->|method| ffa28681_827f_818a_08e7_ea3fe26e56db
  0aab8a11_1557_73bd_ae48_ec1cd7937aff["with_streaming_response()"]
  1d6e787b_ff21_76b6_4d7e_ad965f61fe7e -->|method| 0aab8a11_1557_73bd_ae48_ec1cd7937aff

Relationship Graph

Source Code

src/anthropic/lib/vertex/_beta_messages.py lines 14–36

class Messages(SyncAPIResource):
    create = FirstPartyMessagesAPI.create
    stream = FirstPartyMessagesAPI.stream
    count_tokens = FirstPartyMessagesAPI.count_tokens

    @cached_property
    def with_raw_response(self) -> MessagesWithRawResponse:
        """
        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 MessagesWithRawResponse(self)

    @cached_property
    def with_streaming_response(self) -> MessagesWithStreamingResponse:
        """
        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 MessagesWithStreamingResponse(self)

Extends

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free