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

beta_raw_message_delta_event.py — anthropic-sdk-python Source File

Architecture documentation for beta_raw_message_delta_event.py, a python file in the anthropic-sdk-python codebase. 10 imports, 2 dependents.

File python AnthropicClient 10 imports 2 dependents 2 classes

Entity Profile

Dependency Diagram

graph LR
  339f07e3_2bd0_16c7_42fe_8e14d08926ee["beta_raw_message_delta_event.py"]
  c14e2467_291d_6c7c_2b25_9a24e81f8565["_models"]
  339f07e3_2bd0_16c7_42fe_8e14d08926ee --> c14e2467_291d_6c7c_2b25_9a24e81f8565
  e9543bf1_1f1f_84b9_ccad_4cb082af52ba["beta_container.py"]
  339f07e3_2bd0_16c7_42fe_8e14d08926ee --> e9543bf1_1f1f_84b9_ccad_4cb082af52ba
  e0df8d12_9c52_fb4c_4723_0f25b7e213b4["BetaContainer"]
  339f07e3_2bd0_16c7_42fe_8e14d08926ee --> e0df8d12_9c52_fb4c_4723_0f25b7e213b4
  8e392c44_353c_2801_bc9a_bb37fb428417["beta_stop_reason.py"]
  339f07e3_2bd0_16c7_42fe_8e14d08926ee --> 8e392c44_353c_2801_bc9a_bb37fb428417
  97dd8438_3d35_5356_8fdc_49ec321a6e2b["beta_message_delta_usage.py"]
  339f07e3_2bd0_16c7_42fe_8e14d08926ee --> 97dd8438_3d35_5356_8fdc_49ec321a6e2b
  f97f5e05_eb54_210b_8a35_62c38a15cbaf["BetaMessageDeltaUsage"]
  339f07e3_2bd0_16c7_42fe_8e14d08926ee --> f97f5e05_eb54_210b_8a35_62c38a15cbaf
  8e1097b4_ba7a_e261_a11e_6ec41bfd39d6["beta_context_management_response.py"]
  339f07e3_2bd0_16c7_42fe_8e14d08926ee --> 8e1097b4_ba7a_e261_a11e_6ec41bfd39d6
  fb494fe0_770a_241b_61ec_74d1fc570b97["BetaContextManagementResponse"]
  339f07e3_2bd0_16c7_42fe_8e14d08926ee --> fb494fe0_770a_241b_61ec_74d1fc570b97
  89ddcdd7_3ae1_4c7b_41bb_9f1e25f16875["typing"]
  339f07e3_2bd0_16c7_42fe_8e14d08926ee --> 89ddcdd7_3ae1_4c7b_41bb_9f1e25f16875
  37c05070_ca59_d596_7250_de9d1939227f["typing_extensions"]
  339f07e3_2bd0_16c7_42fe_8e14d08926ee --> 37c05070_ca59_d596_7250_de9d1939227f
  65f3d77c_c1b2_82e1_f9d7_1e7e05f3fdfd["__init__.py"]
  65f3d77c_c1b2_82e1_f9d7_1e7e05f3fdfd --> 339f07e3_2bd0_16c7_42fe_8e14d08926ee
  39ef89db_0f06_5b47_301b_3e0ce9d755cb["beta_raw_message_stream_event.py"]
  39ef89db_0f06_5b47_301b_3e0ce9d755cb --> 339f07e3_2bd0_16c7_42fe_8e14d08926ee
  style 339f07e3_2bd0_16c7_42fe_8e14d08926ee fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

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

from typing import Optional
from typing_extensions import Literal

from ..._models import BaseModel
from .beta_container import BetaContainer
from .beta_stop_reason import BetaStopReason
from .beta_message_delta_usage import BetaMessageDeltaUsage
from .beta_context_management_response import BetaContextManagementResponse

__all__ = ["BetaRawMessageDeltaEvent", "Delta"]


class Delta(BaseModel):
    container: Optional[BetaContainer] = None
    """
    Information about the container used in the request (for the code execution
    tool)
    """

    stop_reason: Optional[BetaStopReason] = None

    stop_sequence: Optional[str] = None


class BetaRawMessageDeltaEvent(BaseModel):
    context_management: Optional[BetaContextManagementResponse] = None
    """Information about context management strategies applied during the request"""

    delta: Delta

    type: Literal["message_delta"]

    usage: BetaMessageDeltaUsage
    """Billing and rate-limit usage.

    Anthropic's API bills and rate-limits by token counts, as tokens represent the
    underlying cost to our systems.

    Under the hood, the API transforms requests into a format suitable for the
    model. The model's output then goes through a parsing stage before becoming an
    API response. As a result, the token counts in `usage` will not match one-to-one
    with the exact visible content of an API request or response.

    For example, `output_tokens` will be non-zero, even for an empty string response
    from Claude.

    Total input tokens in a request is the summation of `input_tokens`,
    `cache_creation_input_tokens`, and `cache_read_input_tokens`.
    """

Frequently Asked Questions

What does beta_raw_message_delta_event.py do?
beta_raw_message_delta_event.py is a source file in the anthropic-sdk-python codebase, written in python. It belongs to the AnthropicClient domain.
What does beta_raw_message_delta_event.py depend on?
beta_raw_message_delta_event.py imports 10 module(s): BetaContainer, BetaContextManagementResponse, BetaMessageDeltaUsage, _models, beta_container.py, beta_context_management_response.py, beta_message_delta_usage.py, beta_stop_reason.py, and 2 more.
What files import beta_raw_message_delta_event.py?
beta_raw_message_delta_event.py is imported by 2 file(s): __init__.py, beta_raw_message_stream_event.py.
Where is beta_raw_message_delta_event.py in the architecture?
beta_raw_message_delta_event.py is located at src/anthropic/types/beta/beta_raw_message_delta_event.py (domain: AnthropicClient, directory: src/anthropic/types/beta).

Analyze Your Own Codebase

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

Try Supermodel Free