Module: Anthropic::Models::Beta::BetaFallbackParam::Thinking

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

Overview

The thinking configuration for the fallback attempt that uses this fallbacks entry's model. If you leave it out, the attempt uses the request's thinking when model supports that thinking type.

If you leave it out and the request's thinking type is between_tools but model doesn't support between_tools, the attempt uses disabled if model supports it. Otherwise, if model doesn't support the request's thinking type, if the request doesn't set thinking, or if you set this field to null, the attempt uses the thinking type that model uses when a request leaves out thinking. The request's thinking.display still applies where model allows it.

These rules apply with the server-side-fallback-2026-07-01 beta header.

See Also:

  • Anthropic::Models::Beta::BetaFallbackParam#thinking

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::BetaFallbackParam::thinking

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::BetaFallbackParam::Thinking 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::BetaFallbackParam::thinking

    Parameters:

    • type: (Anthropic::Models::Beta::BetaFallbackParam::Thinking::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::BetaFallbackParam::thinking)

Parameters:

  • type (Symbol, Anthropic::Models::Beta::BetaFallbackParam::Thinking::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)


186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/anthropic/models/beta/beta_fallback_param.rb', line 186

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_fallback_param.rb', line 161


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



# File 'lib/anthropic/models/beta/beta_fallback_param.rb', line 165