Class AssistantsApiToolChoiceOption
java.lang.Object
com.azure.ai.openai.assistants.models.AssistantsApiToolChoiceOption
Controls which (if any) tool is called by the model.
- `none` means the model will not call any tools and instead generates a message.
- `auto` is the default value and means the model can pick between generating a message or calling a tool.
Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}`
forces the model to call that tool.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of AssistantsApiToolChoiceOption.Creates a new instance of AssistantsApiToolChoiceOption. -
Method Summary
Modifier and TypeMethodDescriptionfromBinaryData
(com.azure.core.util.BinaryData toolChoiceBinaryData) Deserializes the BinaryData into either type this model holds.getMode()
Gets the mode of the model will handle tool choices.Gets the tool choice to use.
-
Constructor Details
-
AssistantsApiToolChoiceOption
Creates a new instance of AssistantsApiToolChoiceOption.- Parameters:
mode
- The mode to use.
-
AssistantsApiToolChoiceOption
Creates a new instance of AssistantsApiToolChoiceOption.- Parameters:
toolChoice
- The tool choice to use.
-
-
Method Details
-
getMode
Gets the mode of the model will handle tool choices.- Returns:
- The serialized JSON string.
-
getToolChoice
Gets the tool choice to use.- Returns:
- The tool choice to use.
-
fromBinaryData
public static AssistantsApiToolChoiceOption fromBinaryData(com.azure.core.util.BinaryData toolChoiceBinaryData) Deserializes the BinaryData into either type this model holds. Note that mode and toolChoice are mutually exclusive.- Parameters:
toolChoiceBinaryData
- The binary data to deserialize.- Returns:
- The deserialized model.
- Throws:
IllegalArgumentException
- If the provided JSON string does not match the expected format.
-