Class BetaFunctionTool
-
- All Implemented Interfaces:
public final class BetaFunctionToolDefines a function in your own code the model can choose to call. Learn more about function calling.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classBetaFunctionTool.BuilderA builder for BetaFunctionTool.
public final classBetaFunctionTool.ParametersA JSON schema object describing the parameters of the function.
public final classBetaFunctionTool.AllowedCallerpublic final classBetaFunctionTool.OutputSchemaA JSON schema object describing the JSON value encoded in string outputs for this function.
-
Method Summary
Modifier and Type Method Description final Stringname()The name of the function to call. final Optional<BetaFunctionTool.Parameters>parameters()A JSON schema object describing the parameters of the function. final Optional<Boolean>strict()Whether strict parameter validation is enforced for this function tool. final JsonValue_type()The type of the function tool. final Optional<List<BetaFunctionTool.AllowedCaller>>allowedCallers()The tool invocation context(s). final Optional<Boolean>deferLoading()Whether this function is deferred and loaded via tool search. final Optional<String>description()A description of the function. final Optional<BetaFunctionTool.OutputSchema>outputSchema()A JSON schema object describing the JSON value encoded in string outputs for this function. final JsonField<String>_name()Returns the raw JSON value of name. final JsonField<BetaFunctionTool.Parameters>_parameters()Returns the raw JSON value of parameters. final JsonField<Boolean>_strict()Returns the raw JSON value of strict. final JsonField<List<BetaFunctionTool.AllowedCaller>>_allowedCallers()Returns the raw JSON value of allowedCallers. final JsonField<Boolean>_deferLoading()Returns the raw JSON value of deferLoading. final JsonField<String>_description()Returns the raw JSON value of description. final JsonField<BetaFunctionTool.OutputSchema>_outputSchema()Returns the raw JSON value of outputSchema. final Map<String, JsonValue>_additionalProperties()final BetaFunctionTool.BuildertoBuilder()final BetaFunctionToolvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaFunctionTool.Builderbuilder()Returns a mutable builder for constructing an instance of BetaFunctionTool. -
-
Method Detail
-
parameters
final Optional<BetaFunctionTool.Parameters> parameters()
A JSON schema object describing the parameters of the function.
-
strict
final Optional<Boolean> strict()
Whether strict parameter validation is enforced for this function tool.
-
_type
final JsonValue _type()
The type of the function tool. Always
function.Expected to always return the following:
JsonValue.from("function")However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value).
-
allowedCallers
final Optional<List<BetaFunctionTool.AllowedCaller>> allowedCallers()
The tool invocation context(s).
-
deferLoading
final Optional<Boolean> deferLoading()
Whether this function is deferred and loaded via tool search.
-
description
final Optional<String> description()
A description of the function. Used by the model to determine whether or not to call the function.
-
outputSchema
final Optional<BetaFunctionTool.OutputSchema> outputSchema()
A JSON schema object describing the JSON value encoded in string outputs for this function.
-
_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.
-
_parameters
final JsonField<BetaFunctionTool.Parameters> _parameters()
Returns the raw JSON value of parameters.
Unlike parameters, this method doesn't throw if the JSON field has an unexpected type.
-
_strict
final JsonField<Boolean> _strict()
Returns the raw JSON value of strict.
Unlike strict, this method doesn't throw if the JSON field has an unexpected type.
-
_allowedCallers
final JsonField<List<BetaFunctionTool.AllowedCaller>> _allowedCallers()
Returns the raw JSON value of allowedCallers.
Unlike allowedCallers, this method doesn't throw if the JSON field has an unexpected type.
-
_deferLoading
final JsonField<Boolean> _deferLoading()
Returns the raw JSON value of deferLoading.
Unlike deferLoading, 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.
-
_outputSchema
final JsonField<BetaFunctionTool.OutputSchema> _outputSchema()
Returns the raw JSON value of outputSchema.
Unlike outputSchema, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final BetaFunctionTool.Builder toBuilder()
-
validate
final BetaFunctionTool validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
builder
final static BetaFunctionTool.Builder builder()
Returns a mutable builder for constructing an instance of BetaFunctionTool.
The following fields are required:
.name() .parameters() .strict()
-
-
-
-