Module: Anthropic::Models::Beta::BetaMessageParam
- Extended by:
- Internal::Type::Union
- Defined in:
- lib/anthropic/models/beta/beta_message_param.rb,
sig/anthropic/models/beta/beta_message_param.rbs
Defined Under Namespace
Modules: Role
Class Method Summary collapse
-
.new(role:, **args) ⇒ Anthropic::Models::Beta::BetaUserMessageParam, ...
Creates a new instance of the variant class whose
rolematches the given value, passing the remaining arguments to its constructor. - .values ⇒ Array<Symbol>
- .variants ⇒ Array(Anthropic::Models::Beta::BetaUserMessageParam, Anthropic::Models::Beta::BetaAssistantMessageParam, Anthropic::Models::Beta::BetaSystemMessageParam)
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(role:, content:) ⇒ Anthropic::Beta::BetaUserMessageParam .new(role:, content:) ⇒ Anthropic::Beta::BetaAssistantMessageParam .new(role:, clear_at:, content:, output_config:) ⇒ Anthropic::Beta::BetaSystemMessageParam .new(role:, content:, clear_at:, output_config:) ⇒ Anthropic::Models::Beta::beta_message_param
Creates a new instance of the variant class whose role matches the given
value, passing the remaining arguments to its constructor.
Some parameter documentations has been truncated, see Anthropic::Models::Beta::BetaMessageParam for more details.
49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/anthropic/models/beta/beta_message_param.rb', line 49 def self.new(role:, **args) case role.to_sym when :user Anthropic::Beta::BetaUserMessageParam.new(**args) when :assistant Anthropic::Beta::BetaAssistantMessageParam.new(**args) when :system Anthropic::Beta::BetaSystemMessageParam.new(**args) else raise ArgumentError, "unknown role: #{role}" end end |
.values ⇒ Array<Symbol>
|
|
# File 'lib/anthropic/models/beta/beta_message_param.rb', line 24
|
.variants ⇒ Array(Anthropic::Models::Beta::BetaUserMessageParam, Anthropic::Models::Beta::BetaAssistantMessageParam, Anthropic::Models::Beta::BetaSystemMessageParam)
|
|
# File 'lib/anthropic/models/beta/beta_message_param.rb', line 28
|