Class: Anthropic::Models::Beta::BetaCodeExecutionTool20250522

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/anthropic/models/beta/beta_code_execution_tool_20250522.rb,
sig/anthropic/models/beta/beta_code_execution_tool_20250522.rbs

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, cache_control: nil, defer_loading: nil, strict: nil, name: :code_execution, type: :code_execution_20250522) ⇒ BetaCodeExecutionTool20250522

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

Parameters:

  • allowed_callers (Array<Symbol, Anthropic::Models::Beta::BetaCodeExecutionTool20250522::AllowedCaller>) (defaults to: nil)
  • cache_control (Anthropic::Models::Beta::BetaCacheControlEphemeral, nil) (defaults to: nil) —

    Create a cache control breakpoint at this content block.

  • defer_loading (Boolean) (defaults to: nil) —

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

  • strict (Boolean) (defaults to: nil) —

    When true, guarantees schema validation on tool names and inputs

  • name (Symbol, :code_execution) (defaults to: :code_execution) —

    Name of the tool.

  • type (Symbol, :code_execution_20250522) (defaults to: :code_execution_20250522)
  • allowed_callers: (::Array[Anthropic::Models::Beta::BetaCodeExecutionTool20250522::allowed_caller]) (defaults to: nil)
  • cache_control: (Anthropic::Beta::BetaCacheControlEphemeral, nil) (defaults to: nil)
  • defer_loading: (Boolean) (defaults to: nil)
  • strict: (Boolean) (defaults to: nil)
  • name: (:code_execution) (defaults to: :code_execution)
  • type: (:code_execution_20250522) (defaults to: :code_execution_20250522)


# File 'lib/anthropic/models/beta/beta_code_execution_tool_20250522.rb', line 45

Instance Attribute Details

#allowed_callers ⇒ Array<Symbol, Anthropic::Models::Beta::BetaCodeExecutionTool20250522::AllowedCaller>?

Parameters:

  • (::Array[Anthropic::Models::Beta::BetaCodeExecutionTool20250522::allowed_caller])

Returns:



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

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

#cache_control ⇒ Anthropic::Models::Beta::BetaCacheControlEphemeral?

Create a cache control breakpoint at this content block.

Parameters:

  • value (Anthropic::Beta::BetaCacheControlEphemeral, nil)

Returns:



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

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

#defer_loading ⇒ Boolean?

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

Parameters:

Returns:



37
# File 'lib/anthropic/models/beta/beta_code_execution_tool_20250522.rb', line 37

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

#name ⇒ Symbol, :code_execution

Name of the tool.

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

Parameters:

  • value (:code_execution)

Returns:

  • (Symbol, :code_execution)


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

required :name, const: :code_execution

#strict ⇒ Boolean?

When true, guarantees schema validation on tool names and inputs

Parameters:

Returns:



43
# File 'lib/anthropic/models/beta/beta_code_execution_tool_20250522.rb', line 43

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

#type ⇒ Symbol, :code_execution_20250522

Parameters:

  • value (:code_execution_20250522)

Returns:

  • (Symbol, :code_execution_20250522)


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

required :type, const: :code_execution_20250522

Instance Method Details

#to_hash ⇒ { name: :code_execution, type: :code_execution_20250522, allowed_callers: ::Array[Anthropic::Models::Beta::BetaCodeExecutionTool20250522::allowed_caller], cache_control: Anthropic::Beta::BetaCacheControlEphemeral?, defer_loading: bool, strict: bool }

Returns:

  • ({ name: :code_execution, type: :code_execution_20250522, allowed_callers: ::Array[Anthropic::Models::Beta::BetaCodeExecutionTool20250522::allowed_caller], cache_control: Anthropic::Beta::BetaCacheControlEphemeral?, defer_loading: bool, strict: bool })


46
47
48
49
50
51
52
53
# File 'sig/anthropic/models/beta/beta_code_execution_tool_20250522.rbs', line 46

def to_hash: -> {
  name: :code_execution,
  type: :code_execution_20250522,
  allowed_callers: ::Array[Anthropic::Models::Beta::BetaCodeExecutionTool20250522::allowed_caller],
  cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
  defer_loading: bool,
  strict: bool
}