Home / File/ _beta.py — anthropic-sdk-python Source File

_beta.py — anthropic-sdk-python Source File

Architecture documentation for _beta.py, a python file in the anthropic-sdk-python codebase. 9 imports, 1 dependents.

File python AnthropicClient SyncAPI 9 imports 1 dependents 6 classes

Entity Profile

Dependency Diagram

graph LR
  c67615a5_6c22_f3a8_22e6_6badfeba0703["_beta.py"]
  7b9571c7_f3c7_9081_747d_05b632f1a3e2["_compat"]
  c67615a5_6c22_f3a8_22e6_6badfeba0703 --> 7b9571c7_f3c7_9081_747d_05b632f1a3e2
  69d5d154_63ab_8b70_9a76_075f3a4f6ed3["_resource"]
  c67615a5_6c22_f3a8_22e6_6badfeba0703 --> 69d5d154_63ab_8b70_9a76_075f3a4f6ed3
  b4641bb5_9dee_e780_9e9c_66a8c11b2481["_beta_messages.py"]
  c67615a5_6c22_f3a8_22e6_6badfeba0703 --> b4641bb5_9dee_e780_9e9c_66a8c11b2481
  1d6e787b_ff21_76b6_4d7e_ad965f61fe7e["Messages"]
  c67615a5_6c22_f3a8_22e6_6badfeba0703 --> 1d6e787b_ff21_76b6_4d7e_ad965f61fe7e
  c5e503a1_4560_6ed8_182b_6b790f24ef7a["AsyncMessages"]
  c67615a5_6c22_f3a8_22e6_6badfeba0703 --> c5e503a1_4560_6ed8_182b_6b790f24ef7a
  7a3cf5bb_1f87_42e6_0605_875257692aac["MessagesWithRawResponse"]
  c67615a5_6c22_f3a8_22e6_6badfeba0703 --> 7a3cf5bb_1f87_42e6_0605_875257692aac
  b25213ec_ef7f_98c7_02b2_acd6a2928115["AsyncMessagesWithRawResponse"]
  c67615a5_6c22_f3a8_22e6_6badfeba0703 --> b25213ec_ef7f_98c7_02b2_acd6a2928115
  0874d420_5f26_2bf6_11df_b39ee5c21467["MessagesWithStreamingResponse"]
  c67615a5_6c22_f3a8_22e6_6badfeba0703 --> 0874d420_5f26_2bf6_11df_b39ee5c21467
  a78341d2_8921_0418_11c3_c63067e0bfe3["AsyncMessagesWithStreamingResponse"]
  c67615a5_6c22_f3a8_22e6_6badfeba0703 --> a78341d2_8921_0418_11c3_c63067e0bfe3
  7bcf2a66_49f2_0382_7180_1ee6501f1674["_client.py"]
  7bcf2a66_49f2_0382_7180_1ee6501f1674 --> c67615a5_6c22_f3a8_22e6_6badfeba0703
  style c67615a5_6c22_f3a8_22e6_6badfeba0703 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ._beta_messages import (
    Messages,
    AsyncMessages,
    MessagesWithRawResponse,
    AsyncMessagesWithRawResponse,
    MessagesWithStreamingResponse,
    AsyncMessagesWithStreamingResponse,
)

__all__ = ["Beta", "AsyncBeta"]


class Beta(SyncAPIResource):
    @cached_property
    def messages(self) -> Messages:
        return Messages(self._client)

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

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


class AsyncBeta(AsyncAPIResource):
    @cached_property
    def messages(self) -> AsyncMessages:
        return AsyncMessages(self._client)

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

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


class BetaWithRawResponse:
    def __init__(self, beta: Beta) -> None:
        self._beta = beta

    @cached_property
    def messages(self) -> MessagesWithRawResponse:
        return MessagesWithRawResponse(self._beta.messages)


class AsyncBetaWithRawResponse:
    def __init__(self, beta: AsyncBeta) -> None:
        self._beta = beta

    @cached_property
    def messages(self) -> AsyncMessagesWithRawResponse:
        return AsyncMessagesWithRawResponse(self._beta.messages)


class BetaWithStreamingResponse:
    def __init__(self, beta: Beta) -> None:
        self._beta = beta

    @cached_property
    def messages(self) -> MessagesWithStreamingResponse:
        return MessagesWithStreamingResponse(self._beta.messages)


class AsyncBetaWithStreamingResponse:
    def __init__(self, beta: AsyncBeta) -> None:
        self._beta = beta

    @cached_property
    def messages(self) -> AsyncMessagesWithStreamingResponse:
        return AsyncMessagesWithStreamingResponse(self._beta.messages)

Subdomains

Frequently Asked Questions

What does _beta.py do?
_beta.py is a source file in the anthropic-sdk-python codebase, written in python. It belongs to the AnthropicClient domain, SyncAPI subdomain.
What does _beta.py depend on?
_beta.py imports 9 module(s): AsyncMessages, AsyncMessagesWithRawResponse, AsyncMessagesWithStreamingResponse, Messages, MessagesWithRawResponse, MessagesWithStreamingResponse, _beta_messages.py, _compat, and 1 more.
What files import _beta.py?
_beta.py is imported by 1 file(s): _client.py.
Where is _beta.py in the architecture?
_beta.py is located at src/anthropic/lib/vertex/_beta.py (domain: AnthropicClient, subdomain: SyncAPI, directory: src/anthropic/lib/vertex).

Analyze Your Own Codebase

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

Try Supermodel Free