Class AgentProcessChatbot
-
- All Implemented Interfaces:
-
com.embabel.chat.Chatbot
public final class AgentProcessChatbot implements Chatbot
Chatbot implementation backed by an ongoing AgentProcess The AgentProcess must react to UserMessage and respond on its output channel The AgentProcess can assume that the Conversation will be available in the blackboard, and the latest UserMessage. Action methods will often take precondition being that the last event was a UserMessage. A convenient approach is for the core action methods to return ChatbotReturn, and handle ConversationOver, although that is not required.
-
-
Constructor Summary
Constructors Constructor Description AgentProcessChatbot(AgentPlatform agentPlatform, AgentSource agentSource, ListenerProvider listenerProvider, PlannerType plannerType, Verbosity verbosity)
-
Method Summary
Modifier and Type Method Description ChatSessioncreateSession(User user, OutputChannel outputChannel, String systemMessage)Create a new chat session. ChatSessionfindSession(String conversationId)Get a chat session by conversation id. final static ChatbotutilityFromPlatform(AgentPlatform agentPlatform, Verbosity verbosity, ListenerProvider listenerProvider)Create a chatbot that will use all actions available on the platform, with utility-based planning. final static ChatbotutilityFromPlatform(AgentPlatform agentPlatform, Verbosity verbosity)Create a chatbot that will use all actions available on the platform, with utility-based planning. final static ChatbotutilityFromPlatform(AgentPlatform agentPlatform)Create a chatbot that will use all actions available on the platform, with utility-based planning. -
-
Constructor Detail
-
AgentProcessChatbot
AgentProcessChatbot(AgentPlatform agentPlatform, AgentSource agentSource, ListenerProvider listenerProvider, PlannerType plannerType, Verbosity verbosity)
- Parameters:
agentPlatform- the agent platform to create and manage agent processesagentSource- factory for agents.
-
-
Method Detail
-
createSession
ChatSession createSession(User user, OutputChannel outputChannel, String systemMessage)
Create a new chat session. If user is provided, the session will be associated with that user. Optionally, a system message can be provided to set the context for the session.
- Parameters:
user- the user to associate the session with, or null for anonymousoutputChannel- the output channel to send messages tosystemMessage- optional system message to set the context for the session
-
findSession
ChatSession findSession(String conversationId)
Get a chat session by conversation id.
-
utilityFromPlatform
@JvmOverloads() final static Chatbot utilityFromPlatform(AgentPlatform agentPlatform, Verbosity verbosity, ListenerProvider listenerProvider)
Create a chatbot that will use all actions available on the platform, with utility-based planning.
-
utilityFromPlatform
@JvmOverloads() final static Chatbot utilityFromPlatform(AgentPlatform agentPlatform, Verbosity verbosity)
Create a chatbot that will use all actions available on the platform, with utility-based planning.
-
utilityFromPlatform
@JvmOverloads() final static Chatbot utilityFromPlatform(AgentPlatform agentPlatform)
Create a chatbot that will use all actions available on the platform, with utility-based planning.
-
-
-
-