Package com.azure.ai.openai.models
Class ChatRequestMessage
java.lang.Object
com.azure.ai.openai.models.ChatRequestMessage
- All Implemented Interfaces:
com.azure.json.JsonSerializable<ChatRequestMessage>
- Direct Known Subclasses:
ChatRequestAssistantMessage,ChatRequestFunctionMessage,ChatRequestSystemMessage,ChatRequestToolMessage,ChatRequestUserMessage
public class ChatRequestMessage
extends Object
implements com.azure.json.JsonSerializable<ChatRequestMessage>
An abstract representation of a chat message as provided in a request.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ChatRequestMessagefromJson(com.azure.json.JsonReader jsonReader) Reads an instance of ChatRequestMessage from the JsonReader.getRole()Get the role property: The chat role associated with this message.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
ChatRequestMessage
public ChatRequestMessage()Creates an instance of ChatRequestMessage class.
-
-
Method Details
-
getRole
Get the role property: The chat role associated with this message.- Returns:
- the role value.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<ChatRequestMessage>- Throws:
IOException
-
fromJson
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.
-