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

    Constructors
    Constructor
    Description
    FunctionCall(String name, String arguments)
    Creates an instance of FunctionCall class.
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    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

      public FunctionCall(String name, String arguments)
      Creates an instance of FunctionCall class.
      Parameters:
      name - the name value to set.
      arguments - the arguments value to set.
  • Method Details

    • getName

      public String getName()
      Get the name property: The name of the function to call.
      Returns:
      the name value.
    • getArguments

      public String 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

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

      public static FunctionCall fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      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.