Class: Anthropic::Models::Beta::BetaCodeExecutionTool20260120
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- Anthropic::Models::Beta::BetaCodeExecutionTool20260120
- Defined in:
- lib/anthropic/models/beta/beta_code_execution_tool_20260120.rb,
sig/anthropic/models/beta/beta_code_execution_tool_20260120.rbs
Defined Under Namespace
Modules: AllowedCaller
Instance Attribute Summary collapse
- #allowed_callers ⇒ Array<Symbol, Anthropic::Models::Beta::BetaCodeExecutionTool20260120::AllowedCaller>?
-
#cache_control ⇒ Anthropic::Models::Beta::BetaCacheControlEphemeral?
Create a cache control breakpoint at this content block.
-
#defer_loading ⇒ Boolean?
If true, tool will not be included in initial system prompt.
-
#name ⇒ Symbol, :code_execution
Name of the tool.
-
#strict ⇒ Boolean?
When true, guarantees schema validation on tool names and inputs.
- #type ⇒ Symbol, :code_execution_20260120
Instance Method Summary collapse
-
#initialize(allowed_callers: nil, cache_control: nil, defer_loading: nil, strict: nil, name: :code_execution, type: :code_execution_20260120) ⇒ BetaCodeExecutionTool20260120
constructor
A
toolsentry for the code execution tool, versioncode_execution_20260120. - #to_hash ⇒ { name: :code_execution, type: :code_execution_20260120, allowed_callers: ::Array[Anthropic::Models::Beta::BetaCodeExecutionTool20260120::allowed_caller], cache_control: Anthropic::Beta::BetaCacheControlEphemeral?, defer_loading: bool, strict: bool }
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_20260120) ⇒ BetaCodeExecutionTool20260120
A tools entry for the code execution tool, version code_execution_20260120.
It adds REPL state persistence to version code_execution_20250825.
REPL state persistence applies with programmatic tool calling. With it, the Python interpreter state, such as variable bindings, persists across requests that reuse the container.
See the code execution tool guide to learn what each tool version adds.
Some parameter documentations has been truncated, see Anthropic::Models::Beta::BetaCodeExecutionTool20260120 for more details.
|
|
# File 'lib/anthropic/models/beta/beta_code_execution_tool_20260120.rb', line 45
|
Instance Attribute Details
#allowed_callers ⇒ Array<Symbol, Anthropic::Models::Beta::BetaCodeExecutionTool20260120::AllowedCaller>?
23 24 |
# File 'lib/anthropic/models/beta/beta_code_execution_tool_20260120.rb', line 23 optional :allowed_callers, -> { Anthropic::Internal::Type::ArrayOf[enum: Anthropic::Beta::BetaCodeExecutionTool20260120::AllowedCaller] } |
#cache_control ⇒ Anthropic::Models::Beta::BetaCacheControlEphemeral?
Create a cache control breakpoint at this content block.
30 |
# File 'lib/anthropic/models/beta/beta_code_execution_tool_20260120.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.
37 |
# File 'lib/anthropic/models/beta/beta_code_execution_tool_20260120.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.
13 |
# File 'lib/anthropic/models/beta/beta_code_execution_tool_20260120.rb', line 13 required :name, const: :code_execution |
#strict ⇒ Boolean?
When true, guarantees schema validation on tool names and inputs
43 |
# File 'lib/anthropic/models/beta/beta_code_execution_tool_20260120.rb', line 43 optional :strict, Anthropic::Internal::Type::Boolean |
#type ⇒ Symbol, :code_execution_20260120
18 |
# File 'lib/anthropic/models/beta/beta_code_execution_tool_20260120.rb', line 18 required :type, const: :code_execution_20260120 |
Instance Method Details
#to_hash ⇒ { name: :code_execution, type: :code_execution_20260120, allowed_callers: ::Array[Anthropic::Models::Beta::BetaCodeExecutionTool20260120::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_20260120.rbs', line 46
def to_hash: -> {
name: :code_execution,
type: :code_execution_20260120,
allowed_callers: ::Array[Anthropic::Models::Beta::BetaCodeExecutionTool20260120::allowed_caller],
cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
defer_loading: bool,
strict: bool
}
|