Package org.codelibs.fess.llm
Class LlmMessage
java.lang.Object
org.codelibs.fess.llm.LlmMessage
- All Implemented Interfaces:
Serializable
Represents a message in a chat conversation.
- Author:
- FessProject
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.LlmMessage(String role, String content) Creates a new message with the specified role and content. -
Method Summary
Modifier and TypeMethodDescriptionstatic LlmMessageCreates an assistant message with the specified content.Gets the message content.getRole()Gets the message role.voidsetContent(String content) Sets the message content.voidSets the message role.static LlmMessageCreates a system message with the specified content.toString()static LlmMessageCreates a user message with the specified content.
-
Field Details
-
ROLE_SYSTEM
The role identifier for system messages.- See Also:
-
ROLE_USER
The role identifier for user messages.- See Also:
-
ROLE_ASSISTANT
The role identifier for assistant messages.- See Also:
-
-
Constructor Details
-
LlmMessage
public LlmMessage()Default constructor. -
LlmMessage
Creates a new message with the specified role and content.- Parameters:
role- the message rolecontent- the message content
-
-
Method Details
-
system
Creates a system message with the specified content.- Parameters:
content- the message content- Returns:
- a new system message
-
user
Creates a user message with the specified content.- Parameters:
content- the message content- Returns:
- a new user message
-
assistant
Creates an assistant message with the specified content.- Parameters:
content- the message content- Returns:
- a new assistant message
-
getRole
Gets the message role.- Returns:
- the role
-
setRole
Sets the message role.- Parameters:
role- the role
-
getContent
Gets the message content.- Returns:
- the content
-
setContent
Sets the message content.- Parameters:
content- the content
-
toString
-