Home / Class/ MessageBatch Class — anthropic-sdk-python Architecture

MessageBatch Class — anthropic-sdk-python Architecture

Architecture documentation for the MessageBatch class in message_batch.py from the anthropic-sdk-python codebase.

Entity Profile

Dependency Diagram

graph TD
  3e107774_1462_d161_d688_0579282f7e10["MessageBatch"]
  17ce5647_6f06_0676_a4a5_e378a3f57cb1["BaseModel"]
  3e107774_1462_d161_d688_0579282f7e10 -->|extends| 17ce5647_6f06_0676_a4a5_e378a3f57cb1
  553ff8b4_6e07_4580_d3f3_a05016158a35["message_batch.py"]
  3e107774_1462_d161_d688_0579282f7e10 -->|defined in| 553ff8b4_6e07_4580_d3f3_a05016158a35

Relationship Graph

Source Code

src/anthropic/types/messages/message_batch.py lines 13–77

class MessageBatch(BaseModel):
    id: str
    """Unique object identifier.

    The format and length of IDs may change over time.
    """

    archived_at: Optional[datetime] = None
    """
    RFC 3339 datetime string representing the time at which the Message Batch was
    archived and its results became unavailable.
    """

    cancel_initiated_at: Optional[datetime] = None
    """
    RFC 3339 datetime string representing the time at which cancellation was
    initiated for the Message Batch. Specified only if cancellation was initiated.
    """

    created_at: datetime
    """
    RFC 3339 datetime string representing the time at which the Message Batch was
    created.
    """

    ended_at: Optional[datetime] = None
    """
    RFC 3339 datetime string representing the time at which processing for the
    Message Batch ended. Specified only once processing ends.

    Processing ends when every request in a Message Batch has either succeeded,
    errored, canceled, or expired.
    """

    expires_at: datetime
    """
    RFC 3339 datetime string representing the time at which the Message Batch will
    expire and end processing, which is 24 hours after creation.
    """

    processing_status: Literal["in_progress", "canceling", "ended"]
    """Processing status of the Message Batch."""

    request_counts: MessageBatchRequestCounts
    """Tallies requests within the Message Batch, categorized by their status.

    Requests start as `processing` and move to one of the other statuses only once
    processing of the entire batch ends. The sum of all values always matches the
    total number of requests in the batch.
    """

    results_url: Optional[str] = None
    """URL to a `.jsonl` file containing the results of the Message Batch requests.

    Specified only once processing ends.

    Results in the file are not guaranteed to be in the same order as requests. Use
    the `custom_id` field to match results to requests.
    """

    type: Literal["message_batch"]
    """Object type.

    For Message Batches, this is always `"message_batch"`.
    """

Extends

Frequently Asked Questions

What is the MessageBatch class?
MessageBatch is a class in the anthropic-sdk-python codebase, defined in src/anthropic/types/messages/message_batch.py.
Where is MessageBatch defined?
MessageBatch is defined in src/anthropic/types/messages/message_batch.py at line 13.
What does MessageBatch extend?
MessageBatch extends BaseModel.

Analyze Your Own Codebase

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

Try Supermodel Free