Package com.embabel.chat
Interface Chatbot
-
- All Implemented Interfaces:
public interface ChatbotA chatbot can conduct multiple chat sessions, each identified by a conversationId.
-
-
Method Summary
Modifier and Type Method Description abstract ChatSessioncreateSession(User user, OutputChannel outputChannel, String contextId, String conversationId)Create a new chat session, or restore an existing one. abstract ChatSessionfindSession(String conversationId)Get a chat session by conversation id. -
-
Method Detail
-
createSession
abstract ChatSession createSession(User user, OutputChannel outputChannel, String contextId, String conversationId)
Create a new chat session, or restore an existing one.
If contextId is provided, objects from that context are loaded into the blackboard (e.g., user preferences, prior state).
If conversationId is provided and a conversation exists in storage, the session will be restored with its message history. Otherwise, a new conversation is created with that ID.
- Parameters:
user- the user to associate the session with, or null for anonymousoutputChannel- the output channel to send messages tocontextId- optional context ID to load prior state fromconversationId- optional ID to restore an existing conversation, or create with specific ID
-
findSession
abstract ChatSession findSession(String conversationId)
Get a chat session by conversation id.
-
-
-
-