ChatCompletionsToolCall Class

  • java.lang.Object
    • com.azure.ai.inference.models.ChatCompletionsToolCall

Implements

public class ChatCompletionsToolCall
implements JsonSerializable<ChatCompletionsToolCall>

A function tool call requested by the AI model.

Constructor Summary

Constructor Description
ChatCompletionsToolCall(String id, FunctionCall function)

Creates an instance of ChatCompletionsToolCall class.

Method Summary

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

Reads an instance of ChatCompletionsToolCall from the JsonReader.

FunctionCall getFunction()

Get the function property: The details of the function call requested by the AI model.

String getId()

Get the id property: The ID of the tool call.

String getType()

Get the type property: The type of tool call.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Constructor Details

ChatCompletionsToolCall

public ChatCompletionsToolCall(String id, FunctionCall function)

Creates an instance of ChatCompletionsToolCall class.

Parameters:

id - the id value to set.
function - the function value to set.

Method Details

fromJson

public static ChatCompletionsToolCall fromJson(JsonReader jsonReader)

Reads an instance of ChatCompletionsToolCall from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of ChatCompletionsToolCall 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.

getFunction

public FunctionCall getFunction()

Get the function property: The details of the function call requested by the AI model.

Returns:

the function value.

getId

public String getId()

Get the id property: The ID of the tool call.

Returns:

the id value.

getType

public String getType()

Get the type property: The type of tool call. Currently, only `function` is supported.

Returns:

the type value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to