Class AIMessage
public class AIMessage
extends Object
Represents a message in a conversation with an AI model.
-
Constructor Summary
Constructors
Initializes a new instance of the Message class with the specified role and content.
-
Method Summary
Gets the content of the message.
Gets the role of the message author.
void
Sets the content of the message.
void
Sets the role of the message author.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
AIMessage
Initializes a new instance of the Message class with the specified role and content.
- Parameters:
role - The role of the message author. Common values: "system", "user"
content - The content of the message.
-
Method Details
-
getRole
Gets the role of the message author. Common values: "system", "user"
-
setRole
public void setRole(String role)
Sets the role of the message author. Common values: "system", "user"
-
getContent
Gets the content of the message.
-
setContent
public void setContent(String content)
Sets the content of the message.