This function creates and submits a batch of messages to the Claude API for asynchronous processing.
send_claude_batch(
.llms,
.model = "claude-3-5-sonnet-20241022",
.max_tokens = 1024,
.temperature = NULL,
.top_k = NULL,
.top_p = NULL,
.stop_sequences = NULL,
.json_schema = NULL,
.thinking = FALSE,
.thinking_budget = 1024,
.api_url = "https://api.anthropic.com/",
.verbose = FALSE,
.dry_run = FALSE,
.overwrite = FALSE,
.max_tries = 3,
.timeout = 60,
.id_prefix = "tidyllm_claude_req_"
)
An updated and named list of .llms
with identifiers that align with batch responses, including a batch_id
attribute.
A list of LLMMessage objects containing conversation histories.
Character string specifying the Claude model version (default: "claude-3-5-sonnet-20241022").
Integer specifying the maximum tokens per response (default: 1024).
Numeric between 0 and 1 controlling response randomness.
Integer for diversity by limiting the top K tokens.
Numeric between 0 and 1 for nucleus sampling.
Character vector of sequences that halt response generation.
A schema to enforce an output structure
Logical; if TRUE, enables Claude's thinking mode for complex reasoning tasks (default: FALSE).
Integer specifying the maximum tokens Claude can spend on thinking (default: 1024). Must be at least 1024.
Defaults to "tidyllm_claude_req_".
Base URL for the Claude API (default: "https://api.anthropic.com/").
Logical; if TRUE, prints a message with the batch ID (default: FALSE).
Logical; if TRUE, returns the prepared request object without executing it (default: FALSE).
Logical; if TRUE, allows overwriting an existing batch ID associated with the request (default: FALSE).
Maximum number of retries to perform the request.
Integer specifying the request timeout in seconds (default: 60).
Character string to specify a prefix for generating custom IDs when names in .llms
are missing.