Anthropic::ToolDefinition
Inherits JSON::Serializable < Struct < Value < Object
Tool definition for API requests
Represents a tool in the format expected by the Anthropic API.
definition = ToolDefinition.new(
name: "get_weather",
description: "Get weather for a location",
input_schema: InputSchema.build(
properties: {"location" => Schema.string("City name")},
required: ["location"]
)
)
Constructors
new(name : String, description : String, input_schema : InputSchema, type : String | Nil = nil, strict : Bool | Nil = nil, cache_control : CacheControl | Nil = nil, allowed_callers : Array(String) | Nil = nil, defer_loading : Bool | Nil = nil, input_examples : Array(JSON::Any) | Nil = nil, eager_input_streaming : Bool | Nil = nil)
Sourcenew(pull : JSON::PullParser)
Sourcenew(*, __pull_for_json_serializable pull : JSON::PullParser)
SourceInstance methods
allowed_callers
Sourcecache_control
Sourcedefer_loading?
Sourcedescription
Sourceeager_input_streaming
Sourceinput_examples
Sourceinput_schema
Sourcename
Sourcestrict
Sourcetype
Source