Module: Anthropic::Models::Beta::BetaManagedAgentsAgentToolConfigParams

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

Overview

Configuration override for a specific tool within a toolset.

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

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

Parameters:

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

    Attributes for the chosen variant.

    @option args [Boolean, nil] :enabled Whether this tool is enabled and available to Claude. Overrides the default_conf

    @option args [Anthropic::Models::Beta::BetaManagedAgentsAlwaysAllowPolicy, Anthropic::Models::Beta::BetaManagedAgentsAlwaysAskPolicy, nil] :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 Must be "bash".

    @option args [Array] :allowed_domains Only fetch URLs whose host is one of these domains or a subdomain of one. Each e

    @option args [Array] :blocked_domains Never fetch URLs whose host is one of these domains or a subdomain of one. Each

    @option args [Integer, nil] :max_content_tokens Maximum number of tokens of fetched text content to include in context per call.

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

Returns:

Raises:

  • (ArgumentError)


66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/anthropic/models/beta/beta_managed_agents_agent_tool_config_params.rb', line 66

def self.new(type:, **args)
  case type.to_sym
  when :bash
    Anthropic::Beta::BetaManagedAgentsBashToolConfigParams.new(**args)
  when :edit
    Anthropic::Beta::BetaManagedAgentsEditToolConfigParams.new(**args)
  when :read
    Anthropic::Beta::BetaManagedAgentsReadToolConfigParams.new(**args)
  when :write
    Anthropic::Beta::BetaManagedAgentsWriteToolConfigParams.new(**args)
  when :glob
    Anthropic::Beta::BetaManagedAgentsGlobToolConfigParams.new(**args)
  when :grep
    Anthropic::Beta::BetaManagedAgentsGrepToolConfigParams.new(**args)
  when :web_fetch
    Anthropic::Beta::BetaManagedAgentsWebFetchToolConfigParams.new(**args)
  when :web_search
    Anthropic::Beta::BetaManagedAgentsWebSearchToolConfigParams.new(**args)
  else
    raise ArgumentError, "unknown type: #{type}"
  end
end