FunctionCall Class

  • java.lang.Object
    • com.azure.ai.openai.models.FunctionCall

Implements

public final class FunctionCall
implements JsonSerializable<FunctionCall>

The name and arguments of a function that should be called, as generated by the model.

Constructor Summary

Constructor Description
FunctionCall(String name, String arguments)

Creates an instance of FunctionCall class.

Method Summary

Modifier and Type Method and Description
static FunctionCall fromJson(JsonReader jsonReader)

Reads an instance of FunctionCall from the JsonReader.

String getArguments()

Get the arguments property: The arguments to call the function with, as generated by the model in JSON format.

String getName()

Get the name property: The name of the function to call.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

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

fromJson

public static FunctionCall fromJson(JsonReader jsonReader)

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:

IOException

- If the deserialized JSON object was missing any required properties.

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.

getName

public String getName()

Get the name property: The name of the function to call.

Returns:

the name value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to