Class AbstractMessage
java.lang.Object
org.springframework.ai.chat.messages.AbstractMessage
- Direct Known Subclasses:
AssistantMessage
,SystemMessage
,ToolResponseMessage
,UserMessage
The AbstractMessage class is an abstract implementation of the Message interface. It
provides a base implementation for message content, media attachments, metadata, and
message type.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
protected final MessageType
Additional options for the message to influence the response, not a generative map.protected final String
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractMessage
(MessageType messageType, String textContent, Map<String, Object> metadata) protected
AbstractMessage
(MessageType messageType, org.springframework.core.io.Resource resource, Map<String, Object> metadata) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Get the content of the message.return Get the metadata associated with the content.int
hashCode()
-
Field Details
-
MESSAGE_TYPE
- See Also:
-
messageType
-
textContent
-
metadata
Additional options for the message to influence the response, not a generative map.
-
-
Constructor Details
-
AbstractMessage
-
AbstractMessage
protected AbstractMessage(MessageType messageType, org.springframework.core.io.Resource resource, Map<String, Object> metadata)
-
-
Method Details
-
getContent
Description copied from interface:Content
Get the content of the message.- Specified by:
getContent
in interfaceContent
-
getMetadata
Description copied from interface:Content
return Get the metadata associated with the content.- Specified by:
getMetadata
in interfaceContent
-
getMessageType
- Specified by:
getMessageType
in interfaceMessage
-
equals
-
hashCode
public int hashCode()
-