Class FunctionDefinition
-
- All Implemented Interfaces:
public final class FunctionDefinition
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
FunctionDefinition.Builder
-
Method Summary
Modifier and Type Method Description final String
name()
The name of the function to be called. final Optional<String>
description()
A description of what the function does, used by the model to choose when and how to call the function. final Optional<FunctionParameters>
parameters()
The parameters the functions accepts, described as a JSON Schema object. final Optional<Boolean>
strict()
Whether to enable strict schema adherence when generating the function call. final JsonField<String>
_name()
The name of the function to be called. final JsonField<String>
_description()
A description of what the function does, used by the model to choose when and how to call the function. final JsonField<FunctionParameters>
_parameters()
The parameters the functions accepts, described as a JSON Schema object. final JsonField<Boolean>
_strict()
Whether to enable strict schema adherence when generating the function call. final Map<String, JsonValue>
_additionalProperties()
final FunctionDefinition
validate()
final FunctionDefinition.Builder
toBuilder()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static FunctionDefinition.Builder
builder()
-
-
Method Detail
-
name
final String name()
The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
-
description
final Optional<String> description()
A description of what the function does, used by the model to choose when and how to call the function.
-
parameters
final Optional<FunctionParameters> parameters()
The parameters the functions accepts, described as a JSON Schema object. See the guide for examples, and the JSON Schema reference for documentation about the format.
Omitting
parameters
defines a function with an empty parameter list.
-
strict
final Optional<Boolean> strict()
Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the
parameters
field. Only a subset of JSON Schema is supported whenstrict
istrue
. Learn more about Structured Outputs in the docs/guides/function-calling.
-
_name
final JsonField<String> _name()
The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
-
_description
final JsonField<String> _description()
A description of what the function does, used by the model to choose when and how to call the function.
-
_parameters
final JsonField<FunctionParameters> _parameters()
The parameters the functions accepts, described as a JSON Schema object. See the guide for examples, and the JSON Schema reference for documentation about the format.
Omitting
parameters
defines a function with an empty parameter list.
-
_strict
final JsonField<Boolean> _strict()
Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the
parameters
field. Only a subset of JSON Schema is supported whenstrict
istrue
. Learn more about Structured Outputs in the docs/guides/function-calling.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
validate
final FunctionDefinition validate()
-
toBuilder
final FunctionDefinition.Builder toBuilder()
-
builder
final static FunctionDefinition.Builder builder()
-
-
-
-