Module: Anthropic::Models::Beta::BetaWebFetchToolResultBlock::Caller

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

Overview

See Also:

  • Anthropic::Models::Beta::BetaWebFetchToolResultBlock#caller_

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:) ⇒ Anthropic::Beta::BetaDirectCaller .new(type:, tool_id:) ⇒ Anthropic::Beta::BetaServerToolCaller .new(type:, tool_id:) ⇒ Anthropic::Beta::BetaServerToolCaller20260120 .new(type:, tool_id:) ⇒ Anthropic::Models::Beta::BetaWebFetchToolResultBlock::caller_

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

Overloads:

  • .new(type:) ⇒ Anthropic::Beta::BetaDirectCaller

    Parameters:

    • type: (:direct, "direct")

    Returns:

    • (Anthropic::Beta::BetaDirectCaller)
  • .new(type:, tool_id:) ⇒ Anthropic::Beta::BetaServerToolCaller

    Parameters:

    • type: (:code_execution_20250825, "code_execution_20250825")
    • tool_id: (String)

    Returns:

    • (Anthropic::Beta::BetaServerToolCaller)
  • .new(type:, tool_id:) ⇒ Anthropic::Beta::BetaServerToolCaller20260120

    Parameters:

    • type: (:code_execution_20260120, "code_execution_20260120")
    • tool_id: (String)

    Returns:

    • (Anthropic::Beta::BetaServerToolCaller20260120)
  • .new(type:, tool_id:) ⇒ Anthropic::Models::Beta::BetaWebFetchToolResultBlock::caller_

    Parameters:

    • type: (Anthropic::Models::Beta::BetaWebFetchToolResultBlock::Caller::type_, String)
    • tool_id: (String)

    Returns:

    • (Anthropic::Models::Beta::BetaWebFetchToolResultBlock::caller_)

Parameters:

Returns:

Raises:

  • (ArgumentError)


88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/anthropic/models/beta/beta_web_fetch_tool_result_block.rb', line 88

def self.new(type:, **args)
  case type.to_sym
  when :direct
    Anthropic::Beta::BetaDirectCaller.new(**args)
  when :code_execution_20250825
    Anthropic::Beta::BetaServerToolCaller.new(**args)
  when :code_execution_20260120
    Anthropic::Beta::BetaServerToolCaller20260120.new(**args)
  else
    raise ArgumentError, "unknown type: #{type}"
  end
end

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/anthropic/models/beta/beta_web_fetch_tool_result_block.rb', line 70

.variants ⇒ Array(Anthropic::Models::Beta::BetaDirectCaller, Anthropic::Models::Beta::BetaServerToolCaller, Anthropic::Models::Beta::BetaServerToolCaller20260120)



# File 'lib/anthropic/models/beta/beta_web_fetch_tool_result_block.rb', line 74