Class: Anthropic::Models::Tool
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- Anthropic::Models::Tool
- Defined in:
- lib/anthropic/models/tool.rb
Defined Under Namespace
Modules: AllowedCaller, Type Classes: InputSchema
Instance Attribute Summary collapse
- #allowed_callers ⇒ Array<Symbol, Anthropic::Models::Tool::AllowedCaller>?
-
#cache_control ⇒ Anthropic::Models::CacheControlEphemeral?
Create a cache control breakpoint at this content block.
-
#defer_loading ⇒ Boolean?
If true, tool will not be included in initial system prompt.
-
#description ⇒ String?
Description of what this tool does.
-
#eager_input_streaming ⇒ Boolean?
Enable eager input streaming for this tool.
- #input_examples ⇒ Array<Hash{Symbol=>Object}>?
-
#input_schema ⇒ Anthropic::Models::Tool::InputSchema
JSON schema for this tool's input.
-
#name ⇒ String
Name of the tool.
-
#strict ⇒ Boolean?
When true, guarantees schema validation on tool names and inputs.
- #type ⇒ Symbol, ...
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(properties: nil, required: nil, type: :object) ⇒ void
constructor
JSON schema for this tool's input.
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(properties: nil, required: nil, type: :object) ⇒ void
JSON schema for this tool's input.
This defines the shape of the input that your tool accepts and that the model
will produce.
|
|
# File 'lib/anthropic/models/tool.rb', line 79
|
Instance Attribute Details
#allowed_callers ⇒ Array<Symbol, Anthropic::Models::Tool::AllowedCaller>?
26 |
# File 'lib/anthropic/models/tool.rb', line 26 optional :allowed_callers, -> { Anthropic::Internal::Type::ArrayOf[enum: Anthropic::Tool::AllowedCaller] } |
#cache_control ⇒ Anthropic::Models::CacheControlEphemeral?
Create a cache control breakpoint at this content block.
32 |
# File 'lib/anthropic/models/tool.rb', line 32 optional :cache_control, -> { Anthropic::CacheControlEphemeral }, 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.
39 |
# File 'lib/anthropic/models/tool.rb', line 39 optional :defer_loading, Anthropic::Internal::Type::Boolean |
#description ⇒ String?
Description of what this tool does.
Tool descriptions should be as detailed as possible. The more information that the model has about what the tool is and how to use it, the better it will perform. You can use natural language descriptions to reinforce important aspects of the tool input JSON schema.
50 |
# File 'lib/anthropic/models/tool.rb', line 50 optional :description, String |
#eager_input_streaming ⇒ Boolean?
Enable eager input streaming for this tool. When true, tool input parameters will be streamed incrementally as they are generated, and types will be inferred on-the-fly rather than buffering the full JSON output. When false, streaming is disabled for this tool even if the fine-grained-tool-streaming beta is active. When null (default), uses the default behavior based on beta headers.
60 |
# File 'lib/anthropic/models/tool.rb', line 60 optional :eager_input_streaming, Anthropic::Internal::Type::Boolean, nil?: true |
#input_examples ⇒ Array<Hash{Symbol=>Object}>?
65 66 |
# File 'lib/anthropic/models/tool.rb', line 65 optional :input_examples, Anthropic::Internal::Type::ArrayOf[Anthropic::Internal::Type::HashOf[Anthropic::Internal::Type::Unknown]] |
#input_schema ⇒ Anthropic::Models::Tool::InputSchema
JSON schema for this tool's input.
This defines the shape of the input that your tool accepts and that the model
will produce.
13 |
# File 'lib/anthropic/models/tool.rb', line 13 required :input_schema, -> { Anthropic::Tool::InputSchema } |
#name ⇒ String
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
21 |
# File 'lib/anthropic/models/tool.rb', line 21 required :name, String |
Class Method Details
.values ⇒ Array<Symbol>
|
|
# File 'lib/anthropic/models/tool.rb', line 140
|