Module: Anthropic::Models::Beta::Sessions::BetaManagedAgentsSessionStatusIdleEvent::StopReason

Extended by:
Internal::Type::Union
Defined in:
lib/anthropic/models/beta/sessions/beta_managed_agents_session_status_idle_event.rb,
sig/anthropic/models/beta/sessions/beta_managed_agents_session_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::BetaManagedAgentsSessionStatusIdleEvent#stop_reason

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::BetaManagedAgentsSessionStatusIdleEvent::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)


81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/anthropic/models/beta/sessions/beta_managed_agents_session_status_idle_event.rb', line 81

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

Instance Method Details

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

Returns:

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


45
# File 'sig/anthropic/models/beta/sessions/beta_managed_agents_session_status_idle_event.rbs', line 45

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