Package com.azure.ai.inference.models
Class ChatRequestMessage
java.lang.Object
com.azure.ai.inference.models.ChatRequestMessage
- All Implemented Interfaces:
com.azure.json.JsonSerializable<ChatRequestMessage>
- Direct Known Subclasses:
ChatRequestAssistantMessage
,ChatRequestDeveloperMessage
,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 ChatRequestMessage
fromJson
(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.JsonWriter
toJson
(com.azure.json.JsonWriter jsonWriter) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
toJson
in 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.
-