Class AssistantMessage
java.lang.Object
org.springframework.ai.chat.messages.AbstractMessage
org.springframework.ai.chat.messages.AssistantMessage
- All Implemented Interfaces:
Message
,Content
,MediaContent
Lets the generative know the content was generated as a response to the user. This role
indicates messages that the generative has previously generated in the conversation. By
including assistant messages in the series, you provide context to the generative about
prior exchanges in the conversation.
- Since:
- 1.0.0
- Author:
- Mark Pollack, Christian Tzolov
-
Nested Class Summary
-
Field Summary
Fields inherited from class org.springframework.ai.chat.messages.AbstractMessage
MESSAGE_TYPE, messageType, metadata, textContent
-
Constructor Summary
ConstructorDescriptionAssistantMessage
(String content) AssistantMessage
(String content, Map<String, Object> properties) AssistantMessage
(String content, Map<String, Object> properties, List<AssistantMessage.ToolCall> toolCalls) AssistantMessage
(String content, Map<String, Object> properties, List<AssistantMessage.ToolCall> toolCalls, List<Media> media) -
Method Summary
Methods inherited from class org.springframework.ai.chat.messages.AbstractMessage
getContent, getMessageType, getMetadata, getText
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, getText
-
Field Details
-
media
-
-
Constructor Details
-
AssistantMessage
-
AssistantMessage
-
AssistantMessage
-
AssistantMessage
-
-
Method Details
-
getToolCalls
-
hasToolCalls
public boolean hasToolCalls() -
getMedia
Description copied from interface:MediaContent
Get the media associated with the content.- Specified by:
getMedia
in interfaceMediaContent
-
equals
- Overrides:
equals
in classAbstractMessage
-
hashCode
public int hashCode()- Overrides:
hashCode
in classAbstractMessage
-
toString
-