Class Message
java.lang.Object
com.developer.nefarious.zjoule.plugin.chat.models.Message
Represents a single chat message with a role and content.
This class is used to encapsulate a message's metadata, including its role
(e.g., user, assistant, system) and its textual content.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the content of the message.getRole()
Retrieves the role of the message.void
setContent
(String content) Sets the content of the message.void
Sets the role of the message.
-
Constructor Details
-
Message
public Message()Default constructor for creating an emptyMessage
. -
Message
Constructs aMessage
with the specified role and content.- Parameters:
role
- the role of the message (e.g.,Role.USER
,Role.SYSTEM
).content
- the textual content of the message.
-
-
Method Details
-
getContent
Retrieves the content of the message.- Returns:
- the content of the message as a
String
.
-
setContent
Sets the content of the message.- Parameters:
content
- the new content of the message.
-
getRole
Retrieves the role of the message.- Returns:
- the role of the message as a
Role
.
-
setRole
Sets the role of the message.- Parameters:
role
- the new role of the message (e.g.,Role.USER
,Role.ASSISTANT
).
-