Class SystemMessage
java.lang.Object
dev.langchain4j.data.message.SystemMessage
- All Implemented Interfaces:
ChatMessage
Represents a system message, typically defined by a developer.
This type of message usually provides instructions regarding the AI's actions, such as its behavior or response style.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic List<SystemMessage> findAll(List<ChatMessage> messages) static Optional<SystemMessage> findFirst(List<ChatMessage> messages) static Optional<SystemMessage> findLast(List<ChatMessage> messages) static SystemMessageCreates a new system message.inthashCode()static SystemMessagesystemMessage(String text) Creates a new system message.text()Returns the message text.toString()type()The type of the message.
-
Constructor Details
-
SystemMessage
Creates a new system message.- Parameters:
text- the message text.
-
-
Method Details
-
text
-
type
Description copied from interface:ChatMessageThe type of the message.- Specified by:
typein interfaceChatMessage- Returns:
- the type of the message
-
equals
-
hashCode
-
toString
-
from
Creates a new system message.- Parameters:
text- the message text.- Returns:
- the system message.
-
systemMessage
Creates a new system message.- Parameters:
text- the message text.- Returns:
- the system message.
-
findFirst
-
findLast
-
findAll
-