Module: Anthropic::Models::Beta::BetaManagedAgentsAgentToolConfig

Extended by:
Internal::Type::Union
Defined in:
lib/anthropic/models/beta/beta_managed_agents_agent_tool_config.rb

Overview

Configuration for a specific agent tool.

Class 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::BetaManagedAgentsBashToolConfig, ...

Creates a new instance of the variant class whose type matches the given value, passing the remaining arguments to its constructor.

Parameters:

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

    Attributes for the chosen variant.

    @option args [Boolean] :enabled

    @option args [Anthropic::Models::Beta::BetaManagedAgentsAlwaysAllowPolicy, Anthropic::Models::Beta::BetaManagedAgentsAlwaysAskPolicy] :permission_policy Permission policy for tool execution.

    @option args [Symbol, :bash, Symbol, :edit, Symbol, :read, Symbol, :write, Symbol, :glob, Symbol, :grep, Symbol, :web_fetch, Symbol, :web_search] :name

    @option args [Array] :allowed_domains

    @option args [Array] :blocked_domains

    @option args [Integer, nil] :max_content_tokens

    @option args [Anthropic::Models::Beta::BetaManagedAgentsUserLocation, nil] :user_location Approximate user location for search result localization.

Returns:

Raises:

  • (ArgumentError)


62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/anthropic/models/beta/beta_managed_agents_agent_tool_config.rb', line 62

def self.new(type:, **args)
  case type.to_sym
  when :bash
    Anthropic::Beta::BetaManagedAgentsBashToolConfig.new(**args)
  when :edit
    Anthropic::Beta::BetaManagedAgentsEditToolConfig.new(**args)
  when :read
    Anthropic::Beta::BetaManagedAgentsReadToolConfig.new(**args)
  when :write
    Anthropic::Beta::BetaManagedAgentsWriteToolConfig.new(**args)
  when :glob
    Anthropic::Beta::BetaManagedAgentsGlobToolConfig.new(**args)
  when :grep
    Anthropic::Beta::BetaManagedAgentsGrepToolConfig.new(**args)
  when :web_fetch
    Anthropic::Beta::BetaManagedAgentsWebFetchToolConfig.new(**args)
  when :web_search
    Anthropic::Beta::BetaManagedAgentsWebSearchToolConfig.new(**args)
  else
    raise ArgumentError, "unknown type: #{type}"
  end
end