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

messages.py — anthropic-sdk-python Source File

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

File python AnthropicClient SyncAPI 42 imports 1 dependents 6 classes

Entity Profile

Dependency Diagram

graph LR
  05fc3602_684b_cc2f_c460_4a8d7984a874["messages.py"]
  e3f8322e_a98f_c944_cc0d_7a534b66a258["e3f8322e:a98f:c944:cc0d:7a534b66a258"]
  05fc3602_684b_cc2f_c460_4a8d7984a874 --> e3f8322e_a98f_c944_cc0d_7a534b66a258
  97e907cd_be61_8d00_139f_dc21f218033d["types"]
  05fc3602_684b_cc2f_c460_4a8d7984a874 --> 97e907cd_be61_8d00_139f_dc21f218033d
  98cff8d0_3ebf_8e08_3589_f0757068fb58["batches.py"]
  05fc3602_684b_cc2f_c460_4a8d7984a874 --> 98cff8d0_3ebf_8e08_3589_f0757068fb58
  2a025d5d_3057_7bf3_fea3_d693a30b85ec["Batches"]
  05fc3602_684b_cc2f_c460_4a8d7984a874 --> 2a025d5d_3057_7bf3_fea3_d693a30b85ec
  c731f4b8_455b_5488_a095_755b0070aedd["AsyncBatches"]
  05fc3602_684b_cc2f_c460_4a8d7984a874 --> c731f4b8_455b_5488_a095_755b0070aedd
  0988d88d_bc07_09ef_de6f_137f8c96fe2c["BatchesWithRawResponse"]
  05fc3602_684b_cc2f_c460_4a8d7984a874 --> 0988d88d_bc07_09ef_de6f_137f8c96fe2c
  bc4e8e2f_916c_f414_9927_145ba0366051["AsyncBatchesWithRawResponse"]
  05fc3602_684b_cc2f_c460_4a8d7984a874 --> bc4e8e2f_916c_f414_9927_145ba0366051
  1570cac6_7fe3_49d6_d571_62d22389db1b["BatchesWithStreamingResponse"]
  05fc3602_684b_cc2f_c460_4a8d7984a874 --> 1570cac6_7fe3_49d6_d571_62d22389db1b
  e384ddc2_b256_f306_4fc0_a0c99109411f["AsyncBatchesWithStreamingResponse"]
  05fc3602_684b_cc2f_c460_4a8d7984a874 --> e384ddc2_b256_f306_4fc0_a0c99109411f
  94623843_1314_0bda_bb48_f4bbb255bc20["_types"]
  05fc3602_684b_cc2f_c460_4a8d7984a874 --> 94623843_1314_0bda_bb48_f4bbb255bc20
  7de2a4bb_4198_83e6_eb79_bcfa0524b2c4["_utils"]
  05fc3602_684b_cc2f_c460_4a8d7984a874 --> 7de2a4bb_4198_83e6_eb79_bcfa0524b2c4
  792f4562_f3b9_0375_c763_375238742233["_compat"]
  05fc3602_684b_cc2f_c460_4a8d7984a874 --> 792f4562_f3b9_0375_c763_375238742233
  c62734ca_fb37_8613_dd06_954674e9ae59["_models"]
  05fc3602_684b_cc2f_c460_4a8d7984a874 --> c62734ca_fb37_8613_dd06_954674e9ae59
  e883bb8c_5280_1090_3af1_3a6a97aa405b["_resource"]
  05fc3602_684b_cc2f_c460_4a8d7984a874 --> e883bb8c_5280_1090_3af1_3a6a97aa405b
  style 05fc3602_684b_cc2f_c460_4a8d7984a874 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

import warnings
from typing import Type, Union, Iterable, Optional, cast
from functools import partial
from typing_extensions import Literal, overload

import httpx
import pydantic

from ... import _legacy_response
from ...types import (
    ThinkingConfigParam,
    message_create_params,
    message_count_tokens_params,
)
from .batches import (
    Batches,
    AsyncBatches,
    BatchesWithRawResponse,
    AsyncBatchesWithRawResponse,
    BatchesWithStreamingResponse,
    AsyncBatchesWithStreamingResponse,
)
from ..._types import NOT_GIVEN, Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
from ..._utils import is_given, required_args, maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._models import TypeAdapter
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper
from ..._constants import DEFAULT_TIMEOUT, MODEL_NONSTREAMING_TOKENS
from ..._streaming import Stream, AsyncStream
from ..._base_client import make_request_options
from ..._utils._utils import is_dict
from ...lib.streaming import MessageStreamManager, AsyncMessageStreamManager
from ...types.message import Message
from ...types.model_param import ModelParam
from ...types.message_param import MessageParam
from ...lib._parse._response import ResponseFormatT, parse_response
from ...types.metadata_param import MetadataParam
from ...types.parsed_message import ParsedMessage
from ...lib._parse._transform import transform_schema
from ...types.text_block_param import TextBlockParam
from ...types.tool_union_param import ToolUnionParam
from ...types.tool_choice_param import ToolChoiceParam
from ...types.output_config_param import OutputConfigParam
from ...types.message_tokens_count import MessageTokensCount
from ...types.thinking_config_param import ThinkingConfigParam
from ...types.json_output_format_param import JSONOutputFormatParam
from ...types.raw_message_stream_event import RawMessageStreamEvent
from ...types.message_count_tokens_tool_param import MessageCountTokensToolParam

__all__ = ["Messages", "AsyncMessages"]


DEPRECATED_MODELS = {
    "claude-1.3": "November 6th, 2024",
    "claude-1.3-100k": "November 6th, 2024",
// ... (2914 more lines)

Subdomains

Dependencies

  • AsyncBatches
  • AsyncBatchesWithRawResponse
  • AsyncBatchesWithStreamingResponse
  • Batches
  • BatchesWithRawResponse
  • BatchesWithStreamingResponse
  • _base_client
  • _compat
  • _constants
  • _models
  • _resource
  • _response
  • _streaming
  • _types
  • _utils
  • _utils._utils
  • batches.py
  • e3f8322e:a98f:c944:cc0d:7a534b66a258
  • functools
  • httpx
  • lib._parse._response
  • lib._parse._transform
  • lib.streaming
  • pydantic
  • types
  • types.json_output_format_param
  • types.message
  • types.message_count_tokens_tool_param
  • types.message_param
  • types.message_tokens_count
  • types.metadata_param
  • types.model_param
  • types.output_config_param
  • types.parsed_message
  • types.raw_message_stream_event
  • types.text_block_param
  • types.thinking_config_param
  • types.tool_choice_param
  • types.tool_union_param
  • typing
  • typing_extensions
  • warnings

Frequently Asked Questions

What does messages.py do?
messages.py is a source file in the anthropic-sdk-python codebase, written in python. It belongs to the AnthropicClient domain, SyncAPI subdomain.
What does messages.py depend on?
messages.py imports 42 module(s): AsyncBatches, AsyncBatchesWithRawResponse, AsyncBatchesWithStreamingResponse, Batches, BatchesWithRawResponse, BatchesWithStreamingResponse, _base_client, _compat, and 34 more.
What files import messages.py?
messages.py is imported by 1 file(s): __init__.py.
Where is messages.py in the architecture?
messages.py is located at src/anthropic/resources/messages/messages.py (domain: AnthropicClient, subdomain: SyncAPI, directory: src/anthropic/resources/messages).

Analyze Your Own Codebase

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

Try Supermodel Free