Class FunctionDefinition
java.lang.Object
com.azure.ai.openai.assistants.models.FunctionDefinition
- All Implemented Interfaces:
com.azure.json.JsonSerializable<FunctionDefinition>
public final class FunctionDefinition
extends Object
implements com.azure.json.JsonSerializable<FunctionDefinition>
The input definition information for a function.
-
Constructor Summary
ConstructorsConstructorDescriptionFunctionDefinition
(String name, com.azure.core.util.BinaryData parameters) Creates an instance of FunctionDefinition class. -
Method Summary
Modifier and TypeMethodDescriptionstatic FunctionDefinition
fromJson
(com.azure.json.JsonReader jsonReader) Reads an instance of FunctionDefinition from the JsonReader.Get the description property: A description of what the function does, used by the model to choose when and how to call the function.getName()
Get the name property: The name of the function to be called.com.azure.core.util.BinaryData
Get the parameters property: The parameters the functions accepts, described as a JSON Schema object.setDescription
(String description) Set the description property: A description of what the function does, used by the model to choose when and how to call the function.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
-
FunctionDefinition
Creates an instance of FunctionDefinition class.- Parameters:
name
- the name value to set.parameters
- the parameters value to set.
-
-
Method Details
-
getName
Get the name property: The name of the function to be called.- Returns:
- the name value.
-
getDescription
Get the description property: A description of what the function does, used by the model to choose when and how to call the function.- Returns:
- the description value.
-
getParameters
public com.azure.core.util.BinaryData getParameters()Get the parameters property: The parameters the functions accepts, described as a JSON Schema object.- Returns:
- the parameters value.
-
setDescription
Set the description property: A description of what the function does, used by the model to choose when and how to call the function.- Parameters:
description
- the description value to set.- Returns:
- the FunctionDefinition object itself.
-
toJson
- Specified by:
toJson
in interfacecom.azure.json.JsonSerializable<FunctionDefinition>
- Throws:
IOException
-
fromJson
Reads an instance of FunctionDefinition from the JsonReader.- Parameters:
jsonReader
- The JsonReader being read.- Returns:
- An instance of FunctionDefinition 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 FunctionDefinition.
-