struct

Anthropic::ThinkingConfig

Inherits Struct < Value < Object

Configuration for extended thinking.

Extended thinking allows Claude to show its reasoning process. Set a budget_tokens value to control how many tokens can be used for thinking.

Example:

config = Anthropic::ThinkingConfig.new(budget_tokens: 10000)
request = Anthropic::Messages::Request.new(
  model: Anthropic::Model.sonnet,
  messages: [Anthropic::Message.user("Solve this problem...")],
  max_tokens: 4096,
  thinking: config
)

Constructors

new(budget_tokens : Int32 | Nil = nil)
Source

Instance methods

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