struct

Anthropic::CreateMessageBatchRequest::BatchRequest

Inherits JSON::Serializable < Struct < Value < Object

Constructors

new(custom_id : String, params : Hash(String, JSON::Any))

Original constructor for raw params (backward compatible).

Source
new(custom_id : String, request : Anthropic::Messages::Request)

Typed constructor from a Messages::Request.

This allows callers to build batch items from typed Request objects without hand-assembling Hash(String, JSON::Any).

Example:

request = Anthropic::Messages::Request.new(
  model: Anthropic::Model.sonnet,
  messages: [Anthropic::Message.user("Hello")],
  max_tokens: 1024
)
batch_req = Anthropic::CreateMessageBatchRequest::BatchRequest.new(
  custom_id: "req-1",
  request: request
)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

custom_id
Source
params
Source