Class ToolChoiceAllowed.Builder
-
- All Implemented Interfaces:
public final class ToolChoiceAllowed.Builder
A builder for ToolChoiceAllowed.
-
-
Method Summary
-
-
Method Detail
-
mode
final ToolChoiceAllowed.Builder mode(ToolChoiceAllowed.Mode mode)
Constrains the tools available to the model to a pre-defined set.
auto
allows the model to pick from among the allowed tools and generate a message.required
requires the model to call one or more of the allowed tools.
-
mode
final ToolChoiceAllowed.Builder mode(JsonField<ToolChoiceAllowed.Mode> mode)
Sets Builder.mode to an arbitrary JSON value.
You should usually call Builder.mode with a well-typed Mode value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
tools
final ToolChoiceAllowed.Builder tools(List<ToolChoiceAllowed.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" } ]
-
tools
final ToolChoiceAllowed.Builder tools(JsonField<List<ToolChoiceAllowed.Tool>> tools)
Sets Builder.tools to an arbitrary JSON value.
You should usually call Builder.tools with a well-typed
List<Tool>
value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
addTool
final ToolChoiceAllowed.Builder addTool(ToolChoiceAllowed.Tool tool)
-
type
final ToolChoiceAllowed.Builder type(JsonValue type)
Sets the field to an arbitrary JSON value.
It is usually unnecessary to call this method because the field defaults to the following:
JsonValue.from("allowed_tools")
This method is primarily for setting the field to an undocumented or not yet supported value.
-
additionalProperties
final ToolChoiceAllowed.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final ToolChoiceAllowed.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final ToolChoiceAllowed.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final ToolChoiceAllowed.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final ToolChoiceAllowed.Builder removeAllAdditionalProperties(Set<String> keys)
-
build
final ToolChoiceAllowed build()
Returns an immutable instance of ToolChoiceAllowed.
Further updates to this Builder will not mutate the returned instance.
The following fields are required:
.mode() .tools()
-
-
-
-