Class FunctionDefinition.Builder
-
- All Implemented Interfaces:
public final class FunctionDefinition.Builder
-
-
Constructor Summary
Constructors Constructor Description FunctionDefinition.Builder()
-
Method Summary
Modifier and Type Method Description final FunctionDefinition.Builder
name(String name)
The name of the function to be called. final FunctionDefinition.Builder
name(JsonField<String> name)
The name of the function to be called. 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. 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. final FunctionDefinition.Builder
parameters(FunctionParameters parameters)
The parameters the functions accepts, described as a JSON Schema object. final FunctionDefinition.Builder
parameters(JsonField<FunctionParameters> parameters)
The parameters the functions accepts, described as a JSON Schema object. final FunctionDefinition.Builder
strict(Boolean strict)
Whether to enable strict schema adherence when generating the function call. final FunctionDefinition.Builder
strict(Boolean strict)
Whether to enable strict schema adherence when generating the function call. final FunctionDefinition.Builder
strict(Optional<Boolean> strict)
Whether to enable strict schema adherence when generating the function call. final FunctionDefinition.Builder
strict(JsonField<Boolean> strict)
Whether to enable strict schema adherence when generating the function call. final FunctionDefinition.Builder
additionalProperties(Map<String, JsonValue> additionalProperties)
final FunctionDefinition.Builder
putAdditionalProperty(String key, JsonValue value)
final FunctionDefinition.Builder
putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
final FunctionDefinition.Builder
removeAdditionalProperty(String key)
final FunctionDefinition.Builder
removeAllAdditionalProperties(Set<String> keys)
final FunctionDefinition
build()
-
-
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
parameters
defines 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
parameters
defines 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
parameters
field. Only a subset of JSON Schema is supported whenstrict
istrue
. 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
parameters
field. Only a subset of JSON Schema is supported whenstrict
istrue
. 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
parameters
field. Only a subset of JSON Schema is supported whenstrict
istrue
. 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
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 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()
-
-
-
-