Freigeben über


ChatRequestMessage Class

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

Implements

public class ChatRequestMessage
implements JsonSerializable<ChatRequestMessage>

An abstract representation of a chat message as provided in a request.

Constructor Summary

Constructor Description
ChatRequestMessage()

Creates an instance of ChatRequestMessage class.

Method Summary

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

Reads an instance of ChatRequestMessage from the JsonReader.

ChatRole getRole()

Get the role property: The chat role associated with this message.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Constructor Details

ChatRequestMessage

public ChatRequestMessage()

Creates an instance of ChatRequestMessage class.

Method Details

fromJson

public static ChatRequestMessage fromJson(JsonReader jsonReader)

Reads an instance of ChatRequestMessage from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

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

getRole

public ChatRole getRole()

Get the role property: The chat role associated with this message.

Returns:

the role value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to