Class FunctionDefinition.Builder
-
- All Implemented Interfaces:
public final class FunctionDefinition.BuilderA builder for FunctionDefinition.
-
-
Method Summary
Modifier and Type Method Description final FunctionDefinition.Buildername(String name)The name of the function to be called. final FunctionDefinition.Buildername(JsonField<String> name)The name of the function to be called. final FunctionDefinition.Builderdescription(String description)A description of what the function does, used by the model to choose when and how to call the function. final FunctionDefinition.Builderdescription(JsonField<String> description)A description of what the function does, used by the model to choose when and how to call the function. final FunctionDefinition.Builderparameters(FunctionParameters parameters)The parameters the functions accepts, described as a JSON Schema object. final FunctionDefinition.Builderparameters(JsonField<FunctionParameters> parameters)The parameters the functions accepts, described as a JSON Schema object. final FunctionDefinition.Builderstrict(Boolean strict)Whether to enable strict schema adherence when generating the function call. final FunctionDefinition.Builderstrict(Boolean strict)Whether to enable strict schema adherence when generating the function call. final FunctionDefinition.Builderstrict(Optional<Boolean> strict)Whether to enable strict schema adherence when generating the function call. final FunctionDefinition.Builderstrict(JsonField<Boolean> strict)Whether to enable strict schema adherence when generating the function call. final FunctionDefinition.BuilderadditionalProperties(Map<String, JsonValue> additionalProperties)final FunctionDefinition.BuilderputAdditionalProperty(String key, JsonValue value)final FunctionDefinition.BuilderputAllAdditionalProperties(Map<String, JsonValue> additionalProperties)final FunctionDefinition.BuilderremoveAdditionalProperty(String key)final FunctionDefinition.BuilderremoveAllAdditionalProperties(Set<String> keys)final FunctionDefinitionbuild()-
-
Method Detail
-
name
final FunctionDefinition.Builder name(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.
-
name
final FunctionDefinition.Builder name(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 FunctionDefinition.Builder description(String description)
A description of what the function does, used by the model to choose when and how to call the function.
-
description
final FunctionDefinition.Builder description(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 FunctionDefinition.Builder parameters(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
parametersdefines a function with an empty parameter list.
-
parameters
final FunctionDefinition.Builder parameters(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
parametersdefines a function with an empty parameter list.
-
strict
final FunctionDefinition.Builder strict(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
parametersfield. Only a subset of JSON Schema is supported whenstrictistrue. Learn more about Structured Outputs in the docs/guides/function-calling.
-
strict
final FunctionDefinition.Builder strict(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
parametersfield. Only a subset of JSON Schema is supported whenstrictistrue. Learn more about Structured Outputs in the docs/guides/function-calling.
-
strict
final FunctionDefinition.Builder strict(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
parametersfield. Only a subset of JSON Schema is supported whenstrictistrue. Learn more about Structured Outputs in the docs/guides/function-calling.
-
strict
final FunctionDefinition.Builder strict(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
parametersfield. Only a subset of JSON Schema is supported whenstrictistrue. Learn more about Structured Outputs in the docs/guides/function-calling.
-
additionalProperties
final FunctionDefinition.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final FunctionDefinition.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final FunctionDefinition.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final FunctionDefinition.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final FunctionDefinition.Builder removeAllAdditionalProperties(Set<String> keys)
-
build
final FunctionDefinition build()
-
-
-
-