struct

Anthropic::CreateMessageBatchRequest

Inherits Struct < Value < Object

Request to create a message batch.

Constructors

from_requests(batch_items : Array(Tuple(String, Anthropic::Messages::Request))) : CreateMessageBatchRequest

Convenience method to create a batch from typed Messages::Request objects.

Example:

items = [
  {"req-1", Anthropic::Messages::Request.new(model: Anthropic::Model.sonnet, messages: [...], max_tokens: 1024)},
  {"req-2", Anthropic::Messages::Request.new(model: Anthropic::Model.sonnet, messages: [...], max_tokens: 512)},
]
batch = Anthropic::CreateMessageBatchRequest.from_requests(items)
Source
new(requests : Array(BatchRequest))
Source

Instance methods

to_json(json : JSON::Builder) : Nil
Source

Nested types