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

The agent completed its turn naturally and is ready for the next user message.

See Also:

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

Defined Under Namespace

Modules: Type

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Internal::Type::Union

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

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:, **args) ⇒ Anthropic::Models::Beta::Sessions::BetaManagedAgentsSessionEndTurn, ...

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.

Parameters:

  • type (Symbol, String)
  • args (Hash{Symbol=>Object})

    Attributes for the chosen variant.

    @option args [Array] :event_ids The ids of events the agent is blocked on. Resolving fewer than all re-emits `se

Returns:

Raises:

  • (ArgumentError)


111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/anthropic/models/beta/sessions/beta_managed_agents_session_thread_status_idle_event.rb', line 111

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)
  else
    raise ArgumentError, "unknown type: #{type}"
  end
end

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


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

Instance Method Details

#self?.variants::Array[Anthropic::Models::Beta::Sessions::BetaManagedAgentsSessionThreadStatusIdleEvent::stop_reason]

Returns:

  • (::Array[Anthropic::Models::Beta::Sessions::BetaManagedAgentsSessionThreadStatusIdleEvent::stop_reason])


72
# File 'sig/anthropic/models/beta/sessions/beta_managed_agents_session_thread_status_idle_event.rbs', line 72

def self?.variants: -> ::Array[Anthropic::Models::Beta::Sessions::BetaManagedAgentsSessionThreadStatusIdleEvent::stop_reason]