Class UserMessage
java.lang.Object
org.springframework.ai.chat.messages.AbstractMessage
org.springframework.ai.chat.messages.UserMessage
- All Implemented Interfaces:
Message
,Content
,MediaContent
A message of the type 'user' passed as input Messages with the user role are from the
end-user or developer. They represent questions, prompts, or any input that you want
the generative to respond to.
-
Field Summary
Fields inherited from class org.springframework.ai.chat.messages.AbstractMessage
MESSAGE_TYPE, messageType, metadata, textContent
-
Constructor Summary
ConstructorDescriptionUserMessage
(String textContent) UserMessage
(String textContent, Collection<Media> mediaList, Map<String, Object> metadata) UserMessage
(String textContent, List<Media> media) UserMessage
(String textContent, Media... media) UserMessage
(MessageType messageType, String textContent, Collection<Media> media, Map<String, Object> metadata) UserMessage
(org.springframework.core.io.Resource resource) -
Method Summary
Methods inherited from class org.springframework.ai.chat.messages.AbstractMessage
equals, getMessageType, getMetadata, hashCode
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.ai.model.Content
getMetadata
-
Field Details
-
media
-
-
Constructor Details
-
UserMessage
-
UserMessage
public UserMessage(org.springframework.core.io.Resource resource) -
UserMessage
-
UserMessage
-
UserMessage
-
UserMessage
public UserMessage(MessageType messageType, String textContent, Collection<Media> media, Map<String, Object> metadata)
-
-
Method Details
-
getMedia
-
toString
-
getMedia
Description copied from interface:MediaContent
Get the media associated with the content.- Specified by:
getMedia
in interfaceMediaContent
-
getContent
Description copied from interface:Content
Get the content of the message.- Specified by:
getContent
in interfaceContent
- Overrides:
getContent
in classAbstractMessage
-