Freigeben über


ChatCompletionsResponseFormat Class

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

Implements

public class ChatCompletionsResponseFormat
implements JsonSerializable<ChatCompletionsResponseFormat>

Represents the format that the model must output. Use this to enable JSON mode instead of the default text mode. Note that to enable JSON mode, some AI models may also require you to instruct the model to produce JSON via a system or user message.

Constructor Summary

Constructor Description
ChatCompletionsResponseFormat()

Creates an instance of ChatCompletionsResponseFormat class.

Method Summary

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

Reads an instance of ChatCompletionsResponseFormat from the JsonReader.

String getType()

Get the type property: The response format type to use for chat completions.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Constructor Details

ChatCompletionsResponseFormat

public ChatCompletionsResponseFormat()

Creates an instance of ChatCompletionsResponseFormat class.

Method Details

fromJson

public static ChatCompletionsResponseFormat fromJson(JsonReader jsonReader)

Reads an instance of ChatCompletionsResponseFormat from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of ChatCompletionsResponseFormat if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If an error occurs while reading the ChatCompletionsResponseFormat.

getType

public String getType()

Get the type property: The response format type to use for chat completions.

Returns:

the type value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to