Package com.azure.ai.inference.models
Class FunctionCall
java.lang.Object
com.azure.ai.inference.models.FunctionCall
- All Implemented Interfaces:
com.azure.json.JsonSerializable<FunctionCall>
public final class FunctionCall
extends Object
implements com.azure.json.JsonSerializable<FunctionCall>
The name and arguments of a function that should be called, as generated by the model.
-
Constructor Summary
ConstructorsConstructorDescriptionFunctionCall
(String name, String arguments) Creates an instance of FunctionCall class. -
Method Summary
Modifier and TypeMethodDescriptionstatic FunctionCall
fromJson
(com.azure.json.JsonReader jsonReader) Reads an instance of FunctionCall from the JsonReader.Get the arguments property: The arguments to call the function with, as generated by the model in JSON format.getName()
Get the name 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
-
FunctionCall
Creates an instance of FunctionCall class.- Parameters:
name
- the name value to set.arguments
- the arguments value to set.
-
-
Method Details
-
getName
Get the name property: The name of the function to call.- Returns:
- the name value.
-
getArguments
Get the arguments property: The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.- Returns:
- the arguments value.
-
toJson
- Specified by:
toJson
in interfacecom.azure.json.JsonSerializable<FunctionCall>
- Throws:
IOException
-
fromJson
Reads an instance of FunctionCall from the JsonReader.- Parameters:
jsonReader
- The JsonReader being read.- Returns:
- An instance of FunctionCall 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 FunctionCall.
-