Package com.embabel.chat
Interface Conversation
-
- All Implemented Interfaces:
-
com.embabel.common.core.Identified,com.embabel.common.core.StableIdentified,com.embabel.common.core.types.HasInfoString
public interface Conversation implements StableIdentified, HasInfoStringConversation shim for agent system. Mutable.
-
-
Method Summary
Modifier and Type Method Description UserMessagelastMessageIfBeFromUser()Non-null if the conversation has messages and the last message is from the user. abstract MessageaddMessage(Message message)Modify the state of this conversation Return the newly added message for convenience PromptContributorpromptContributor(ConversationFormatter conversationFormatter)Prompt contributor that represents the conversation so far. StringinfoString(Boolean verbose, Integer indent)abstract Conversationlast(Integer n)Create a nonpersistent conversation with the last n messages from this conversation. abstract List<Message>getMessages()Messages in the conversation in chronological order. abstract AssetTrackergetAssetTracker()Assets tracked in the conversation. -
-
Method Detail
-
lastMessageIfBeFromUser
UserMessage lastMessageIfBeFromUser()
Non-null if the conversation has messages and the last message is from the user.
-
addMessage
abstract Message addMessage(Message message)
Modify the state of this conversation Return the newly added message for convenience
-
promptContributor
PromptContributor promptContributor(ConversationFormatter conversationFormatter)
Prompt contributor that represents the conversation so far. Usually we will want to add messages from the conversation to a prompt instead of formatting the conversation
-
infoString
String infoString(Boolean verbose, Integer indent)
-
last
abstract Conversation last(Integer n)
Create a nonpersistent conversation with the last n messages from this conversation.
-
getMessages
abstract List<Message> getMessages()
Messages in the conversation in chronological order. Visible to user.
-
getAssetTracker
abstract AssetTracker getAssetTracker()
Assets tracked in the conversation.
-
-
-
-