Package com.embabel.chat
Interface ChatSession
-
- All Implemented Interfaces:
public interface ChatSessionSimplest possible conversation session implementation Responsible for keeping its conversation up to date via Conversation.addMessage(), and for sending messages to the OutputChannel.
-
-
Method Summary
Modifier and Type Method Description abstract UnitonUserMessage(UserMessage userMessage)Update the conversation with a new message and respond to it. BooleanisFinished()Is the conversation finished? UnitsaveAndSend(AssistantMessage message)Convenience method to add a message to the conversation abstract OutputChannelgetOutputChannel()OutputChannel to send messages to. abstract UsergetUser()The Embabel User if known, null if not. abstract ConversationgetConversation()Conversation history. StringgetProcessId()-
-
Method Detail
-
onUserMessage
abstract Unit onUserMessage(UserMessage userMessage)
Update the conversation with a new message and respond to it. Any response messages will be sent to the messageListener, but also should be added to the conversation.
- Parameters:
userMessage- message to send
-
isFinished
Boolean isFinished()
Is the conversation finished?
-
saveAndSend
Unit saveAndSend(AssistantMessage message)
Convenience method to add a message to the conversation
-
getOutputChannel
abstract OutputChannel getOutputChannel()
OutputChannel to send messages to.
-
getConversation
abstract Conversation getConversation()
Conversation history. Kept up to date.
-
getProcessId
String getProcessId()
-
-
-
-