Class AbstractMessage
java.lang.Object
org.springframework.ai.chat.messages.AbstractMessage
- All Implemented Interfaces:
Message, org.springframework.ai.content.Content
- Direct Known Subclasses:
AssistantMessage, SystemMessage, ToolResponseMessage, UserMessage
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe key for the message type in the metadata.protected final MessageTypeThe message type of the message.Additional options for the message to influence the response, not a generative map.protected final @Nullable StringThe content of the message. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractMessage(MessageType messageType, @Nullable String textContent, Map<String, Object> metadata) Create a new AbstractMessage with the given message type, text content, and metadata. -
Method Summary
-
Field Details
-
MESSAGE_TYPE
-
messageType
The message type of the message. -
textContent
The content of the message. -
metadata
-
-
Constructor Details
-
AbstractMessage
protected AbstractMessage(MessageType messageType, @Nullable String textContent, Map<String, Object> metadata) Create a new AbstractMessage with the given message type, text content, and metadata.- Parameters:
messageType- the message typetextContent- the text contentmetadata- the metadata
-
-
Method Details
-
getText
Get the content of the message.- Specified by:
getTextin interfaceorg.springframework.ai.content.Content- Returns:
- the content of the message
-
getMetadata
-
getMessageType
Get the message type of the message.- Specified by:
getMessageTypein interfaceMessage- Returns:
- the message type of the message
-
equals
-
hashCode
-