Class AssistantsNamedToolChoice

java.lang.Object
com.azure.ai.openai.assistants.models.AssistantsNamedToolChoice
All Implemented Interfaces:
com.azure.json.JsonSerializable<AssistantsNamedToolChoice>

public final class AssistantsNamedToolChoice extends Object implements com.azure.json.JsonSerializable<AssistantsNamedToolChoice>
Specifies a tool the model should use. Use to force the model to call a specific tool.
  • Constructor Details

    • AssistantsNamedToolChoice

      public AssistantsNamedToolChoice(AssistantsNamedToolChoiceType type)
      Creates an instance of AssistantsNamedToolChoice class.
      Parameters:
      type - the type value to set.
  • Method Details

    • getType

      Get the type property: the type of tool. If type is `function`, the function name must be set.
      Returns:
      the type value.
    • getFunction

      public FunctionName getFunction()
      Get the function property: The name of the function to call.
      Returns:
      the function value.
    • setFunction

      public AssistantsNamedToolChoice setFunction(FunctionName function)
      Set the function property: The name of the function to call.
      Parameters:
      function - the function value to set.
      Returns:
      the AssistantsNamedToolChoice object itself.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<AssistantsNamedToolChoice>
      Throws:
      IOException
    • fromJson

      public static AssistantsNamedToolChoice fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of AssistantsNamedToolChoice from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of AssistantsNamedToolChoice if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IllegalStateException - If the deserialized JSON object was missing any required properties.
      IOException - If an error occurs while reading the AssistantsNamedToolChoice.