Module: Anthropic::Models::Beta::Sessions::BetaManagedAgentsSendSessionEvents::Data

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

Overview

Union type for events that can be sent to a session.

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::BetaManagedAgentsUserMessageEvent, ...

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::BetaManagedAgentsSendSessionEvents::Data for more details.

Parameters:

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

    Attributes for the chosen variant.

    @option args [String] :id Unique identifier for this event.

    @option args [Array<Anthropic::Models::Beta::Sessions::BetaManagedAgentsTextBlock, Anthropic::Models::Beta::Sessions::BetaManagedAgentsImageBlock, Anthropic::Models::Beta::Sessions::BetaManagedAgentsDocumentBlock, Anthropic::Models::Beta::Sessions::BetaManagedAgentsRedactedBlock>, Array<Anthropic::Models::Beta::Sessions::BetaManagedAgentsTextBlock, Anthropic::Models::Beta::Sessions::BetaManagedAgentsImageBlock, Anthropic::Models::Beta::Sessions::BetaManagedAgentsDocumentBlock, Anthropic::Models::Beta::Sessions::BetaManagedAgentsSearchResultBlock>, ArrayAnthropic::Models::Beta::BetaManagedAgentsSystemContentBlock] :content Array of content blocks comprising the user message.

    @option args [Time, nil, Time] :processed_at A timestamp in RFC 3339 format

    @option args [String, nil] :session_thread_id If absent, interrupts every non-archived thread in a multiagent session (or the

    @option args [Symbol, Anthropic::Models::Beta::Sessions::BetaManagedAgentsUserToolConfirmationEvent::Result] :result UserToolConfirmationResult enum

    @option args [String] :tool_use_id The id of the agent.tool_use or agent.mcp_tool_use event this result corresp

    @option args [String, nil] :deny_message Optional message providing context for a 'deny' decision. Only allowed when resu

    @option args [String] :custom_tool_use_id The id of the agent.custom_tool_use event this result corresponds to, which ca

    @option args [Boolean, nil] :is_error Whether the tool execution resulted in an error.

    @option args [String] :description What the agent should produce. Copied from the input event.

    @option args [Integer, nil] :max_iterations Evaluate-then-revise cycles before giving up. Default 3, max 20.

    @option args [String] :outcome_id Server-generated outc_ ID for this outcome. Referenced by `span.outcome_evalua

    @option args [Anthropic::Models::Beta::Sessions::BetaManagedAgentsFileRubric, Anthropic::Models::Beta::Sessions::BetaManagedAgentsTextRubric] :rubric Rubric for grading the quality of an outcome.

Returns:

Raises:

  • (ArgumentError)


92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/anthropic/models/beta/sessions/beta_managed_agents_send_session_events.rb', line 92

def self.new(type:, **args)
  case type.to_sym
  when :"user.message"
    Anthropic::Beta::Sessions::BetaManagedAgentsUserMessageEvent.new(**args)
  when :"user.interrupt"
    Anthropic::Beta::Sessions::BetaManagedAgentsUserInterruptEvent.new(**args)
  when :"user.tool_confirmation"
    Anthropic::Beta::Sessions::BetaManagedAgentsUserToolConfirmationEvent.new(**args)
  when :"user.custom_tool_result"
    Anthropic::Beta::Sessions::BetaManagedAgentsUserCustomToolResultEvent.new(**args)
  when :"user.define_outcome"
    Anthropic::Beta::Sessions::BetaManagedAgentsUserDefineOutcomeEvent.new(**args)
  when :"user.tool_result"
    Anthropic::Beta::BetaManagedAgentsUserToolResultEvent.new(**args)
  when :"system.message"
    Anthropic::Beta::BetaManagedAgentsSystemMessageEvent.new(**args)
  else
    raise ArgumentError, "unknown type: #{type}"
  end
end

Instance Method Details

#self?.variants::Array[Anthropic::Models::Beta::Sessions::BetaManagedAgentsSendSessionEvents::data]

Returns:

  • (::Array[Anthropic::Models::Beta::Sessions::BetaManagedAgentsSendSessionEvents::data])


37
# File 'sig/anthropic/models/beta/sessions/beta_managed_agents_send_session_events.rbs', line 37

def self?.variants: -> ::Array[Anthropic::Models::Beta::Sessions::BetaManagedAgentsSendSessionEvents::data]