Anthropic::OutputConfig
Inherits JSON::Serializable < Struct < Value < Object
Output configuration for controlling effort, format, and task budget.
Used on both top-level and beta messages.create / messages.count_tokens
requests. The task_budget field is beta-only and should only be populated
when calling through client.beta.messages.
# Set effort level
output_config = Anthropic::OutputConfig.new(effort: "high")
# Set effort + structured output format
output_config = Anthropic::OutputConfig.new(effort: "high", format: output_format)
# Beta: set a session-wide token budget
budget = Anthropic::BetaTokenTaskBudget.new(total: 200_000)
output_config = Anthropic::OutputConfig.new(effort: "xhigh", task_budget: budget)
Constructors
new(pull : JSON::PullParser)
Sourcenew(effort : String | Nil = nil, format : OutputFormat | Nil = nil, task_budget : BetaTokenTaskBudget | Nil = nil)
Sourcenew(*, __pull_for_json_serializable pull : JSON::PullParser)
SourceInstance methods
format
Source