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, getContent, 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
getContent, 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
-
toString
-
getMedia
Description copied from interface:MediaContent
Get the media associated with the content.- Specified by:
getMedia
in interfaceMediaContent
-
getText
Description copied from class:AbstractMessage
Get the content of the message.- Specified by:
getText
in interfaceContent
- Overrides:
getText
in classAbstractMessage
- Returns:
- the content of the message
-