Module: Anthropic::Models::Beta::Sessions::BetaManagedAgentsSessionThreadStatusIdleEvent::StopReason

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

Overview

See Also:

  • Anthropic::Models::Beta::Sessions::BetaManagedAgentsSessionThreadStatusIdleEvent#stop_reason

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::Sessions::BetaManagedAgentsSessionEndTurn .new(type:, event_ids:) ⇒ Anthropic::Beta::Sessions::BetaManagedAgentsSessionRequiresAction .new(type:) ⇒ Anthropic::Beta::Sessions::BetaManagedAgentsSessionRetriesExhausted .new(type:) ⇒ Anthropic::Beta::Sessions::BetaManagedAgentsSessionBudgetReached .new(type:) ⇒ Anthropic::Beta::Sessions::BetaManagedAgentsSessionRefusal .new(type:, event_ids:) ⇒ Anthropic::Models::Beta::Sessions::BetaManagedAgentsSessionThreadStatusIdleEvent::stop_reason

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::Sessions::BetaManagedAgentsSessionThreadStatusIdleEvent::StopReason for more details.

Overloads:

  • .new(type:) ⇒ Anthropic::Beta::Sessions::BetaManagedAgentsSessionEndTurn

    Parameters:

    • type: (:end_turn, "end_turn")

    Returns:

    • (Anthropic::Beta::Sessions::BetaManagedAgentsSessionEndTurn)
  • .new(type:, event_ids:) ⇒ Anthropic::Beta::Sessions::BetaManagedAgentsSessionRequiresAction

    Parameters:

    • type: (:requires_action, "requires_action")
    • event_ids: (::Array[String])

    Returns:

    • (Anthropic::Beta::Sessions::BetaManagedAgentsSessionRequiresAction)
  • .new(type:) ⇒ Anthropic::Beta::Sessions::BetaManagedAgentsSessionRetriesExhausted

    Parameters:

    • type: (:retries_exhausted, "retries_exhausted")

    Returns:

    • (Anthropic::Beta::Sessions::BetaManagedAgentsSessionRetriesExhausted)
  • .new(type:) ⇒ Anthropic::Beta::Sessions::BetaManagedAgentsSessionBudgetReached

    Parameters:

    • type: (:budget_reached, "budget_reached")

    Returns:

    • (Anthropic::Beta::Sessions::BetaManagedAgentsSessionBudgetReached)
  • .new(type:) ⇒ Anthropic::Beta::Sessions::BetaManagedAgentsSessionRefusal

    Parameters:

    • type: (:refusal, "refusal")

    Returns:

    • (Anthropic::Beta::Sessions::BetaManagedAgentsSessionRefusal)
  • .new(type:, event_ids:) ⇒ Anthropic::Models::Beta::Sessions::BetaManagedAgentsSessionThreadStatusIdleEvent::stop_reason

    Parameters:

    • type: (Anthropic::Models::Beta::Sessions::BetaManagedAgentsSessionThreadStatusIdleEvent::StopReason::type_, String)
    • event_ids: (::Array[String])

    Returns:

    • (Anthropic::Models::Beta::Sessions::BetaManagedAgentsSessionThreadStatusIdleEvent::stop_reason)

Parameters:

Returns:

Raises:

  • (ArgumentError)


126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/anthropic/models/beta/sessions/beta_managed_agents_session_thread_status_idle_event.rb', line 126

def self.new(type:, **args)
  case type.to_sym
  when :end_turn
    Anthropic::Beta::Sessions::BetaManagedAgentsSessionEndTurn.new(**args)
  when :requires_action
    Anthropic::Beta::Sessions::BetaManagedAgentsSessionRequiresAction.new(**args)
  when :retries_exhausted
    Anthropic::Beta::Sessions::BetaManagedAgentsSessionRetriesExhausted.new(**args)
  when :budget_reached
    Anthropic::Beta::Sessions::BetaManagedAgentsSessionBudgetReached.new(**args)
  when :refusal
    Anthropic::Beta::Sessions::BetaManagedAgentsSessionRefusal.new(**args)
  else
    raise ArgumentError, "unknown type: #{type}"
  end
end

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/anthropic/models/beta/sessions/beta_managed_agents_session_thread_status_idle_event.rb', line 104