Class CustomTool
-
- All Implemented Interfaces:
public final class CustomTool
A custom tool that processes input using a specified format. Learn more about custom tools.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
CustomTool.Builder
A builder for CustomTool.
-
Method Summary
Modifier and Type Method Description final String
name()
The name of the custom tool, used to identify it in tool calls. final JsonValue
_type()
The type of the custom tool. final Optional<String>
description()
Optional description of the custom tool, used to provide more context. final Optional<CustomToolInputFormat>
format()
The input format for the custom tool. final JsonField<String>
_name()
Returns the raw JSON value of name. final JsonField<String>
_description()
Returns the raw JSON value of description. final JsonField<CustomToolInputFormat>
_format()
Returns the raw JSON value of format. final Map<String, JsonValue>
_additionalProperties()
final CustomTool.Builder
toBuilder()
final CustomTool
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static CustomTool.Builder
builder()
Returns a mutable builder for constructing an instance of CustomTool. -
-
Method Detail
-
_type
final JsonValue _type()
The type of the custom tool. Always
custom
.Expected to always return the following:
JsonValue.from("custom")
However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value).
-
description
final Optional<String> description()
Optional description of the custom tool, used to provide more context.
-
format
final Optional<CustomToolInputFormat> format()
The input format for the custom tool. Default is unconstrained text.
-
_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.
-
_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.
-
_format
final JsonField<CustomToolInputFormat> _format()
Returns the raw JSON value of format.
Unlike format, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final CustomTool.Builder toBuilder()
-
validate
final CustomTool validate()
-
builder
final static CustomTool.Builder builder()
Returns a mutable builder for constructing an instance of CustomTool.
The following fields are required:
.name()
-
-
-
-