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
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected final MessageTypeAdditional options for the message to influence the response, not a generative map.protected final String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractMessage(MessageType messageType, String textContent, Map<String, Object> metadata) protectedAbstractMessage(MessageType messageType, org.springframework.core.io.Resource resource, Map<String, Object> metadata) -
Method Summary
Modifier and TypeMethodDescriptionbooleanGet the content of the message.return Get the metadata associated with the content.inthashCode()
-
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:ContentGet the content of the message.- Specified by:
getContentin interfaceContent
-
getMetadata
Description copied from interface:Contentreturn Get the metadata associated with the content.- Specified by:
getMetadatain interfaceContent
-
getMessageType
- Specified by:
getMessageTypein interfaceMessage
-
equals
-
hashCode
public int hashCode()
-