Class: Anthropic::Models::Beta::BetaWebFetchTool20260309

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/anthropic/models/beta/beta_web_fetch_tool_20260309.rb

Defined Under Namespace

Modules: AllowedCaller

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(allowed_callers: nil, allowed_domains: nil, blocked_domains: nil, cache_control: nil, citations: nil, defer_loading: nil, max_content_tokens: nil, max_uses: nil, strict: nil, use_cache: nil, name: :web_fetch, type: :web_fetch_20260309) ⇒ void

Some parameter documentations has been truncated, see Anthropic::Models::Beta::BetaWebFetchTool20260309 for more details.

Web fetch tool with use_cache parameter for bypassing cached content.

Parameters:

  • allowed_callers (Array<Symbol, Anthropic::Models::Beta::BetaWebFetchTool20260309::AllowedCaller>) (defaults to: nil)
  • allowed_domains (Array<String>, nil) (defaults to: nil)

    List of domains to allow fetching from

  • blocked_domains (Array<String>, nil) (defaults to: nil)

    List of domains to block fetching from

  • cache_control (Anthropic::Models::Beta::BetaCacheControlEphemeral, nil) (defaults to: nil)

    Create a cache control breakpoint at this content block.

  • citations (Anthropic::Models::Beta::BetaCitationsConfigParam, nil) (defaults to: nil)

    Citations configuration for fetched documents. Citations are disabled by default

  • defer_loading (Boolean) (defaults to: nil)

    If true, tool will not be included in initial system prompt. Only loaded when re

  • max_content_tokens (Integer, nil) (defaults to: nil)

    Maximum number of tokens used by including web page text content in the context.

  • max_uses (Integer, nil) (defaults to: nil)

    Maximum number of times the tool can be used in the API request.

  • strict (Boolean) (defaults to: nil)

    When true, guarantees schema validation on tool names and inputs

  • use_cache (Boolean) (defaults to: nil)

    Whether to use cached content. Set to false to bypass the cache and fetch fresh

  • name (Symbol, :web_fetch) (defaults to: :web_fetch)

    Name of the tool.

  • type (Symbol, :web_fetch_20260309) (defaults to: :web_fetch_20260309)


# File 'lib/anthropic/models/beta/beta_web_fetch_tool_20260309.rb', line 85

Instance Attribute Details

#allowed_callersArray<Symbol, Anthropic::Models::Beta::BetaWebFetchTool20260309::AllowedCaller>?



23
24
# File 'lib/anthropic/models/beta/beta_web_fetch_tool_20260309.rb', line 23

optional :allowed_callers,
-> { Anthropic::Internal::Type::ArrayOf[enum: Anthropic::Beta::BetaWebFetchTool20260309::AllowedCaller] }

#allowed_domainsArray<String>?

List of domains to allow fetching from

Returns:

  • (Array<String>, nil)


30
# File 'lib/anthropic/models/beta/beta_web_fetch_tool_20260309.rb', line 30

optional :allowed_domains, Anthropic::Internal::Type::ArrayOf[String], nil?: true

#blocked_domainsArray<String>?

List of domains to block fetching from

Returns:

  • (Array<String>, nil)


36
# File 'lib/anthropic/models/beta/beta_web_fetch_tool_20260309.rb', line 36

optional :blocked_domains, Anthropic::Internal::Type::ArrayOf[String], nil?: true

#cache_controlAnthropic::Models::Beta::BetaCacheControlEphemeral?

Create a cache control breakpoint at this content block.



42
# File 'lib/anthropic/models/beta/beta_web_fetch_tool_20260309.rb', line 42

optional :cache_control, -> { Anthropic::Beta::BetaCacheControlEphemeral }, nil?: true

#citationsAnthropic::Models::Beta::BetaCitationsConfigParam?

Citations configuration for fetched documents. Citations are disabled by default.



49
# File 'lib/anthropic/models/beta/beta_web_fetch_tool_20260309.rb', line 49

optional :citations, -> { Anthropic::Beta::BetaCitationsConfigParam }, nil?: true

#defer_loadingBoolean?

If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

Returns:



56
# File 'lib/anthropic/models/beta/beta_web_fetch_tool_20260309.rb', line 56

optional :defer_loading, Anthropic::Internal::Type::Boolean

#max_content_tokensInteger?

Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.

Returns:

  • (Integer, nil)


63
# File 'lib/anthropic/models/beta/beta_web_fetch_tool_20260309.rb', line 63

optional :max_content_tokens, Integer, nil?: true

#max_usesInteger?

Maximum number of times the tool can be used in the API request.

Returns:

  • (Integer, nil)


69
# File 'lib/anthropic/models/beta/beta_web_fetch_tool_20260309.rb', line 69

optional :max_uses, Integer, nil?: true

#nameSymbol, :web_fetch

Name of the tool.

This is how the tool will be called by the model and in tool_use blocks.

Returns:

  • (Symbol, :web_fetch)


13
# File 'lib/anthropic/models/beta/beta_web_fetch_tool_20260309.rb', line 13

required :name, const: :web_fetch

#strictBoolean?

When true, guarantees schema validation on tool names and inputs

Returns:



75
# File 'lib/anthropic/models/beta/beta_web_fetch_tool_20260309.rb', line 75

optional :strict, Anthropic::Internal::Type::Boolean

#typeSymbol, :web_fetch_20260309

Returns:

  • (Symbol, :web_fetch_20260309)


18
# File 'lib/anthropic/models/beta/beta_web_fetch_tool_20260309.rb', line 18

required :type, const: :web_fetch_20260309

#use_cacheBoolean?

Whether to use cached content. Set to false to bypass the cache and fetch fresh content. Only set to false when the user explicitly requests fresh content or when fetching rapidly-changing sources.

Returns:



83
# File 'lib/anthropic/models/beta/beta_web_fetch_tool_20260309.rb', line 83

optional :use_cache, Anthropic::Internal::Type::Boolean