Module: Anthropic::Models::Beta::Sessions::BetaManagedAgentsEventParams

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

Overview

Union type for event parameters 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::BetaManagedAgentsUserMessageEventParams, ...

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

Parameters:

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

    Attributes for the chosen variant.

    @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 for the user message.

    @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::BetaManagedAgentsUserToolConfirmationEventParams::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. This is the task specification.

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

    @option args [Integer, nil] :max_iterations Eval→revision cycles before giving up. Default 3, max 20.

Returns:

Raises:

  • (ArgumentError)


73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/anthropic/models/beta/sessions/beta_managed_agents_event_params.rb', line 73

def self.new(type:, **args)
  case type.to_sym
  when :"user.message"
    Anthropic::Beta::Sessions::BetaManagedAgentsUserMessageEventParams.new(**args)
  when :"user.interrupt"
    Anthropic::Beta::Sessions::BetaManagedAgentsUserInterruptEventParams.new(**args)
  when :"user.tool_confirmation"
    Anthropic::Beta::Sessions::BetaManagedAgentsUserToolConfirmationEventParams.new(**args)
  when :"user.custom_tool_result"
    Anthropic::Beta::Sessions::BetaManagedAgentsUserCustomToolResultEventParams.new(**args)
  when :"user.define_outcome"
    Anthropic::Beta::Sessions::BetaManagedAgentsUserDefineOutcomeEventParams.new(**args)
  when :"user.tool_result"
    Anthropic::Beta::Sessions::BetaManagedAgentsUserToolResultEventParams.new(**args)
  when :"system.message"
    Anthropic::Beta::Sessions::BetaManagedAgentsSystemMessageEventParams.new(**args)
  else
    raise ArgumentError, "unknown type: #{type}"
  end
end

Instance Method Details

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

Returns:

  • (::Array[Anthropic::Models::Beta::Sessions::beta_managed_agents_event_params])


17
# File 'sig/anthropic/models/beta/sessions/beta_managed_agents_event_params.rbs', line 17

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