Interface IChatMessage
- All Known Implementing Classes:
OpenAIChatMessage
public interface IChatMessage
Represents a message exchanged in a chat interaction with an AI model.
Implementations of this interface encapsulate the content of the message and
its associated role (e.g., user, system, assistant).
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the content of the chat message.getRole()
Retrieves the role associated with the message.
-
Method Details
-
getMessage
String getMessage()Retrieves the content of the chat message.- Returns:
- the message content as a
String
.
-
getRole
Role getRole()Retrieves the role associated with the message. Roles define the context of the message within the chat, such as:Role.USER
: The end user sending a message.Role.SYSTEM
: System-provided instructions or context.Role.ASSISTANT
: The AI assistant's response.
- Returns:
- the
Role
of the message.
-