Module: Anthropic::Models::Beta::BetaThinkingConfigParam

Extended by:
Internal::Type::Union
Defined in:
lib/anthropic/models/beta/beta_thinking_config_param.rb,
sig/anthropic/models/beta/beta_thinking_config_param.rbs

Overview

Configuration for Claude's thinking.

With {"type": "adaptive"}, Claude decides when and how much to think. With {"type": "enabled"} (manual extended thinking), you set a budget_tokens of at least 1,024. Thinking tokens count toward your max_tokens limit.

Which type values are accepted, and what happens when you omit thinking, depend on the model. See thinking for each model's behavior.

Defined Under Namespace

Modules: Type

Class Method Summary collapse

Methods included from Internal::Type::Union

==, ===, coerce, derefed_variants, dump, hash, inspect, to_sorbet_type

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Class Method Details

.new(type:, budget_tokens:, block_binding:, display_:) ⇒ Anthropic::Beta::BetaThinkingConfigEnabled .new(type:) ⇒ Anthropic::Beta::BetaThinkingConfigDisabled .new(type:) ⇒ Anthropic::Beta::BetaThinkingConfigBetweenTools .new(type:, block_binding:, display_:) ⇒ Anthropic::Beta::BetaThinkingConfigAdaptive .new(type:, budget_tokens:, block_binding:, display_:) ⇒ Anthropic::Models::Beta::beta_thinking_config_param

Creates a new instance of the variant class whose type matches the given value, passing the remaining arguments to its constructor.

Some parameter documentations has been truncated, see Anthropic::Models::Beta::BetaThinkingConfigParam for more details.

Overloads:

  • .new(type:, budget_tokens:, block_binding:, display_:) ⇒ Anthropic::Beta::BetaThinkingConfigEnabled

    Parameters:

    • type: (:enabled, "enabled")
    • budget_tokens: (Integer)
    • block_binding: (Anthropic::Beta::BetaThinkingBlockBinding, nil)
    • display_: (Anthropic::Models::Beta::BetaThinkingConfigEnabled::display_, nil)

    Returns:

    • (Anthropic::Beta::BetaThinkingConfigEnabled)
  • .new(type:) ⇒ Anthropic::Beta::BetaThinkingConfigDisabled

    Parameters:

    • type: (:disabled, "disabled")

    Returns:

    • (Anthropic::Beta::BetaThinkingConfigDisabled)
  • .new(type:) ⇒ Anthropic::Beta::BetaThinkingConfigBetweenTools

    Parameters:

    • type: (:between_tools, "between_tools")

    Returns:

    • (Anthropic::Beta::BetaThinkingConfigBetweenTools)
  • .new(type:, block_binding:, display_:) ⇒ Anthropic::Beta::BetaThinkingConfigAdaptive

    Parameters:

    • type: (:adaptive, "adaptive")
    • block_binding: (Anthropic::Beta::BetaThinkingBlockBinding, nil)
    • display_: (Anthropic::Models::Beta::BetaThinkingConfigAdaptive::display_, nil)

    Returns:

    • (Anthropic::Beta::BetaThinkingConfigAdaptive)
  • .new(type:, budget_tokens:, block_binding:, display_:) ⇒ Anthropic::Models::Beta::beta_thinking_config_param

    Parameters:

    • type: (Anthropic::Models::Beta::BetaThinkingConfigParam::type_, String)
    • budget_tokens: (Integer)
    • block_binding: (Anthropic::Beta::BetaThinkingBlockBinding, nil)
    • display_: (Anthropic::Models::Beta::BetaThinkingConfigEnabled::display_?, Anthropic::Models::Beta::BetaThinkingConfigAdaptive::display_, nil)

    Returns:

    • (Anthropic::Models::Beta::beta_thinking_config_param)

Parameters:

  • type (Symbol, Anthropic::Models::Beta::BetaThinkingConfigParam::Type, String)
  • args (Hash{Symbol=>Object}) —

    Attributes for the chosen variant.

    @option args [Integer] :budget_tokens Determines how many tokens Claude can use for its internal reasoning process. La

    @option args [Anthropic::Models::Beta::BetaThinkingBlockBinding, nil] :block_binding Controls for block binding: what happens when a thinking block this request send

    @option args [Symbol, Anthropic::Models::Beta::BetaThinkingConfigEnabled::Display, nil, Symbol, Anthropic::Models::Beta::BetaThinkingConfigAdaptive::Display, nil] :display_ Controls how thinking content appears in the response. When set to summarized,

Returns:

Raises:

  • (ArgumentError)


62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/anthropic/models/beta/beta_thinking_config_param.rb', line 62

def self.new(type:, **args)
  case type.to_sym
  when :enabled
    Anthropic::Beta::BetaThinkingConfigEnabled.new(**args)
  when :disabled
    Anthropic::Beta::BetaThinkingConfigDisabled.new(**args)
  when :between_tools
    Anthropic::Beta::BetaThinkingConfigBetweenTools.new(**args)
  when :adaptive
    Anthropic::Beta::BetaThinkingConfigAdaptive.new(**args)
  else
    raise ArgumentError, "unknown type: #{type}"
  end
end

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/anthropic/models/beta/beta_thinking_config_param.rb', line 37

.variants ⇒ Array(Anthropic::Models::Beta::BetaThinkingConfigEnabled, Anthropic::Models::Beta::BetaThinkingConfigDisabled, Anthropic::Models::Beta::BetaThinkingConfigBetweenTools, Anthropic::Models::Beta::BetaThinkingConfigAdaptive)



# File 'lib/anthropic/models/beta/beta_thinking_config_param.rb', line 41