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
  fcb8b576_e5db_1acf_9312_20be91e2e300["_beta.py"]
  dcfeea51_e36b_f1d6_e3e7_7a8f2e20bf59["_compat"]
  fcb8b576_e5db_1acf_9312_20be91e2e300 --> dcfeea51_e36b_f1d6_e3e7_7a8f2e20bf59
  a1651524_5e9d_409a_c032_eb26963f0fc6["_resource"]
  fcb8b576_e5db_1acf_9312_20be91e2e300 --> a1651524_5e9d_409a_c032_eb26963f0fc6
  9f8cfa61_f82b_899e_e7b0_4af933553480["_beta_messages.py"]
  fcb8b576_e5db_1acf_9312_20be91e2e300 --> 9f8cfa61_f82b_899e_e7b0_4af933553480
  80a3c9b9_302c_c9e6_2c40_26bda04d511b["Messages"]
  fcb8b576_e5db_1acf_9312_20be91e2e300 --> 80a3c9b9_302c_c9e6_2c40_26bda04d511b
  470d84bd_a3d7_70f8_f019_f873e800d208["AsyncMessages"]
  fcb8b576_e5db_1acf_9312_20be91e2e300 --> 470d84bd_a3d7_70f8_f019_f873e800d208
  e8a1f66f_d884_9d23_5411_ad5f4e9012e4["MessagesWithRawResponse"]
  fcb8b576_e5db_1acf_9312_20be91e2e300 --> e8a1f66f_d884_9d23_5411_ad5f4e9012e4
  35261680_632f_c5cb_4272_4391c3c0ccaf["AsyncMessagesWithRawResponse"]
  fcb8b576_e5db_1acf_9312_20be91e2e300 --> 35261680_632f_c5cb_4272_4391c3c0ccaf
  09578ec8_8572_9284_b153_f43416c91f3e["MessagesWithStreamingResponse"]
  fcb8b576_e5db_1acf_9312_20be91e2e300 --> 09578ec8_8572_9284_b153_f43416c91f3e
  c83d013b_a043_b795_012a_9c4dd1b7ba81["AsyncMessagesWithStreamingResponse"]
  fcb8b576_e5db_1acf_9312_20be91e2e300 --> c83d013b_a043_b795_012a_9c4dd1b7ba81
  cbdd42fd_75f9_7cc6_3f3b_b8d939e4c157["_client.py"]
  cbdd42fd_75f9_7cc6_3f3b_b8d939e4c157 --> fcb8b576_e5db_1acf_9312_20be91e2e300
  style fcb8b576_e5db_1acf_9312_20be91e2e300 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/bedrock/_beta.py (domain: AnthropicClient, subdomain: SyncAPI, directory: src/anthropic/lib/bedrock).

Analyze Your Own Codebase

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

Try Supermodel Free