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

batches.py — anthropic-sdk-python Source File

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

File python AnthropicClient Authentication 16 imports 2 dependents 6 classes

Entity Profile

Dependency Diagram

graph LR
  98cff8d0_3ebf_8e08_3589_f0757068fb58["batches.py"]
  e3f8322e_a98f_c944_cc0d_7a534b66a258["e3f8322e:a98f:c944:cc0d:7a534b66a258"]
  98cff8d0_3ebf_8e08_3589_f0757068fb58 --> e3f8322e_a98f_c944_cc0d_7a534b66a258
  94623843_1314_0bda_bb48_f4bbb255bc20["_types"]
  98cff8d0_3ebf_8e08_3589_f0757068fb58 --> 94623843_1314_0bda_bb48_f4bbb255bc20
  7de2a4bb_4198_83e6_eb79_bcfa0524b2c4["_utils"]
  98cff8d0_3ebf_8e08_3589_f0757068fb58 --> 7de2a4bb_4198_83e6_eb79_bcfa0524b2c4
  792f4562_f3b9_0375_c763_375238742233["_compat"]
  98cff8d0_3ebf_8e08_3589_f0757068fb58 --> 792f4562_f3b9_0375_c763_375238742233
  e883bb8c_5280_1090_3af1_3a6a97aa405b["_resource"]
  98cff8d0_3ebf_8e08_3589_f0757068fb58 --> e883bb8c_5280_1090_3af1_3a6a97aa405b
  4575cbc0_111d_d3b0_9c0c_b6bf44594842["_response"]
  98cff8d0_3ebf_8e08_3589_f0757068fb58 --> 4575cbc0_111d_d3b0_9c0c_b6bf44594842
  c038f89e_62b2_64e1_682d_97efd83c8be0["pagination"]
  98cff8d0_3ebf_8e08_3589_f0757068fb58 --> c038f89e_62b2_64e1_682d_97efd83c8be0
  2bf583e6_c8a2_738c_7adb_9170d1505ef9["_exceptions"]
  98cff8d0_3ebf_8e08_3589_f0757068fb58 --> 2bf583e6_c8a2_738c_7adb_9170d1505ef9
  bbc01727_eeac_de6a_1c54_0bfa2f9a7ed0["_base_client"]
  98cff8d0_3ebf_8e08_3589_f0757068fb58 --> bbc01727_eeac_de6a_1c54_0bfa2f9a7ed0
  f8f13a2e_048b_1c13_239c_c6579b9c3b8c["types.messages"]
  98cff8d0_3ebf_8e08_3589_f0757068fb58 --> f8f13a2e_048b_1c13_239c_c6579b9c3b8c
  c783a6bb_5acb_17d6_1340_02f47003a026["_decoders.jsonl"]
  98cff8d0_3ebf_8e08_3589_f0757068fb58 --> c783a6bb_5acb_17d6_1340_02f47003a026
  2744dd92_eaa1_46cc_226c_47d35305b0f4["types.messages.message_batch"]
  98cff8d0_3ebf_8e08_3589_f0757068fb58 --> 2744dd92_eaa1_46cc_226c_47d35305b0f4
  e6a184e2_8493_5971_1d0a_a3f531d592af["types.messages.deleted_message_batch"]
  98cff8d0_3ebf_8e08_3589_f0757068fb58 --> e6a184e2_8493_5971_1d0a_a3f531d592af
  58aae7b1_8e09_2744_07e6_37c410dd6911["types.messages.message_batch_individual_response"]
  98cff8d0_3ebf_8e08_3589_f0757068fb58 --> 58aae7b1_8e09_2744_07e6_37c410dd6911
  style 98cff8d0_3ebf_8e08_3589_f0757068fb58 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 typing import Iterable

import httpx

from ... import _legacy_response
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
from ..._utils import maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper
from ...pagination import SyncPage, AsyncPage
from ..._exceptions import AnthropicError
from ..._base_client import AsyncPaginator, make_request_options
from ...types.messages import batch_list_params, batch_create_params
from ..._decoders.jsonl import JSONLDecoder, AsyncJSONLDecoder
from ...types.messages.message_batch import MessageBatch
from ...types.messages.deleted_message_batch import DeletedMessageBatch
from ...types.messages.message_batch_individual_response import MessageBatchIndividualResponse

__all__ = ["Batches", "AsyncBatches"]


class Batches(SyncAPIResource):
    @cached_property
    def with_raw_response(self) -> BatchesWithRawResponse:
        """
        This property can be used as a prefix for any HTTP method call to return
        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 BatchesWithRawResponse(self)

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

    def create(
        self,
        *,
        requests: Iterable[batch_create_params.Request],
        # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
        # The extra values given here take precedence over values defined on the client or passed to this method.
        extra_headers: Headers | None = None,
        extra_query: Query | None = None,
        extra_body: Body | None = None,
        timeout: float | httpx.Timeout | None | NotGiven = not_given,
    ) -> MessageBatch:
        """
        Send a batch of Message creation requests.

// ... (655 more lines)

Subdomains

Dependencies

  • _base_client
  • _compat
  • _decoders.jsonl
  • _exceptions
  • _resource
  • _response
  • _types
  • _utils
  • e3f8322e:a98f:c944:cc0d:7a534b66a258
  • httpx
  • pagination
  • types.messages
  • types.messages.deleted_message_batch
  • types.messages.message_batch
  • types.messages.message_batch_individual_response
  • typing

Frequently Asked Questions

What does batches.py do?
batches.py is a source file in the anthropic-sdk-python codebase, written in python. It belongs to the AnthropicClient domain, Authentication subdomain.
What does batches.py depend on?
batches.py imports 16 module(s): _base_client, _compat, _decoders.jsonl, _exceptions, _resource, _response, _types, _utils, and 8 more.
What files import batches.py?
batches.py is imported by 2 file(s): __init__.py, messages.py.
Where is batches.py in the architecture?
batches.py is located at src/anthropic/resources/messages/batches.py (domain: AnthropicClient, subdomain: Authentication, 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