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 Summary
ConstructorsConstructorDescriptionCreates an instance of AssistantsNamedToolChoice class. -
Method Summary
Modifier and TypeMethodDescriptionstatic AssistantsNamedToolChoice
fromJson
(com.azure.json.JsonReader jsonReader) Reads an instance of AssistantsNamedToolChoice from the JsonReader.Get the function property: The name of the function to call.getType()
Get the type property: the type of tool.setFunction
(FunctionName function) Set the function property: The name of the function to call.com.azure.json.JsonWriter
toJson
(com.azure.json.JsonWriter jsonWriter) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
AssistantsNamedToolChoice
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
Get the function property: The name of the function to call.- Returns:
- the function value.
-
setFunction
Set the function property: The name of the function to call.- Parameters:
function
- the function value to set.- Returns:
- the AssistantsNamedToolChoice object itself.
-
toJson
- Specified by:
toJson
in interfacecom.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.
-