Class BetaToolChoiceAllowed
-
- All Implemented Interfaces:
public final class BetaToolChoiceAllowedConstrains the tools available to the model to a pre-defined set.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classBetaToolChoiceAllowed.BuilderA builder for BetaToolChoiceAllowed.
public final classBetaToolChoiceAllowed.ModeConstrains the tools available to the model to a pre-defined set.
autoallows the model to pick from among the allowed tools and generate a message.requiredrequires the model to call one or more of the allowed tools.public final classBetaToolChoiceAllowed.ToolA tool definition that the model should be allowed to call.
-
Method Summary
Modifier and Type Method Description final BetaToolChoiceAllowed.Modemode()Constrains the tools available to the model to a pre-defined set. final List<BetaToolChoiceAllowed.Tool>tools()A list of tool definitions that the model should be allowed to call. final JsonValue_type()Allowed tool configuration type. final JsonField<BetaToolChoiceAllowed.Mode>_mode()Returns the raw JSON value of mode. final JsonField<List<BetaToolChoiceAllowed.Tool>>_tools()Returns the raw JSON value of tools. final Map<String, JsonValue>_additionalProperties()final BetaToolChoiceAllowed.BuildertoBuilder()final BetaToolChoiceAllowedvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaToolChoiceAllowed.Builderbuilder()Returns a mutable builder for constructing an instance of BetaToolChoiceAllowed. -
-
Method Detail
-
mode
final BetaToolChoiceAllowed.Mode mode()
Constrains the tools available to the model to a pre-defined set.
autoallows the model to pick from among the allowed tools and generate a message.requiredrequires the model to call one or more of the allowed tools.
-
tools
final List<BetaToolChoiceAllowed.Tool> tools()
A list of tool definitions that the model should be allowed to call.
For the Responses API, the list of tool definitions might look like:
[ { "type": "function", "name": "get_weather" }, { "type": "mcp", "server_label": "deepwiki" }, { "type": "image_generation" } ]
-
_type
final JsonValue _type()
Allowed tool configuration type. Always
allowed_tools.Expected to always return the following:
JsonValue.from("allowed_tools")However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value).
-
_mode
final JsonField<BetaToolChoiceAllowed.Mode> _mode()
Returns the raw JSON value of mode.
Unlike mode, this method doesn't throw if the JSON field has an unexpected type.
-
_tools
final JsonField<List<BetaToolChoiceAllowed.Tool>> _tools()
Returns the raw JSON value of tools.
Unlike tools, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final BetaToolChoiceAllowed.Builder toBuilder()
-
validate
final BetaToolChoiceAllowed 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 BetaToolChoiceAllowed.Builder builder()
Returns a mutable builder for constructing an instance of BetaToolChoiceAllowed.
The following fields are required:
.mode() .tools()
-
-
-
-