Class Tool
-
- All Implemented Interfaces:
public final class Tool
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classTool.BuilderA builder for Tool.
public final classTool.InputSchemaJSON schema for this tool's input.
This defines the shape of the
inputthat your tool accepts and that the model will produce.public final classTool.Type
-
Method Summary
Modifier and Type Method Description final Tool.InputSchemainputSchema()JSON schema for this tool's input. final Stringname()Name of the tool. final Optional<CacheControlEphemeral>cacheControl()Create a cache control breakpoint at this content block. final Optional<String>description()Description of what this tool does. final Optional<Tool.Type>type()final JsonField<Tool.InputSchema>_inputSchema()Returns the raw JSON value of inputSchema. final JsonField<String>_name()Returns the raw JSON value of name. final JsonField<CacheControlEphemeral>_cacheControl()Returns the raw JSON value of cacheControl. final JsonField<String>_description()Returns the raw JSON value of description. final JsonField<Tool.Type>_type()Returns the raw JSON value of type. final Map<String, JsonValue>_additionalProperties()final Tool.BuildertoBuilder()final Toolvalidate()final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static Tool.Builderbuilder()Returns a mutable builder for constructing an instance of Tool. -
-
Method Detail
-
inputSchema
final Tool.InputSchema inputSchema()
JSON schema for this tool's input.
This defines the shape of the
inputthat your tool accepts and that the model will produce.
-
name
final String name()
Name of the tool.
This is how the tool will be called by the model and in
tool_useblocks.
-
cacheControl
final Optional<CacheControlEphemeral> cacheControl()
Create a cache control breakpoint at this content block.
-
description
final Optional<String> description()
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.
-
_inputSchema
final JsonField<Tool.InputSchema> _inputSchema()
Returns the raw JSON value of inputSchema.
Unlike inputSchema, this method doesn't throw if the JSON field has an unexpected type.
-
_name
final JsonField<String> _name()
Returns the raw JSON value of name.
Unlike name, this method doesn't throw if the JSON field has an unexpected type.
-
_cacheControl
final JsonField<CacheControlEphemeral> _cacheControl()
Returns the raw JSON value of cacheControl.
Unlike cacheControl, this method doesn't throw if the JSON field has an unexpected type.
-
_description
final JsonField<String> _description()
Returns the raw JSON value of description.
Unlike description, this method doesn't throw if the JSON field has an unexpected type.
-
_type
final JsonField<Tool.Type> _type()
Returns the raw JSON value of type.
Unlike type, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final Tool.Builder toBuilder()
-
builder
final static Tool.Builder builder()
Returns a mutable builder for constructing an instance of Tool.
The following fields are required:
.inputSchema() .name()
-
-
-
-