Class AssistantsApiToolChoiceOption

java.lang.Object
com.azure.ai.openai.assistants.models.AssistantsApiToolChoiceOption

public class AssistantsApiToolChoiceOption extends Object
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 Details

    • AssistantsApiToolChoiceOption

      public AssistantsApiToolChoiceOption(AssistantsApiToolChoiceOptionMode mode)
      Creates a new instance of AssistantsApiToolChoiceOption.
      Parameters:
      mode - The mode to use.
    • AssistantsApiToolChoiceOption

      public AssistantsApiToolChoiceOption(AssistantsNamedToolChoice toolChoice)
      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

      public AssistantsNamedToolChoice 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.