AgentPlatformChatSession

class AgentPlatformChatSession(val user: User?, val outputChannel: OutputChannel, planLister: PlanLister, val processOptions: ProcessOptions = ProcessOptions(), val responseGenerator: ResponseGenerator, val conversation: Conversation = InMemoryConversation()) : ChatSession

Support for chat sessions leveraging an AgentPlatform.

Constructors

Link copied to clipboard
constructor(user: User?, outputChannel: OutputChannel, planLister: PlanLister, processOptions: ProcessOptions = ProcessOptions(), responseGenerator: ResponseGenerator, conversation: Conversation = InMemoryConversation())

Properties

Link copied to clipboard
open override val conversation: Conversation

Conversation history. Kept up to date.

Link copied to clipboard
open override val outputChannel: OutputChannel
Link copied to clipboard
open val processId: String?

Subclasses should override this to provide a process ID if available.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val user: User?

The Embabel User if known, null if not.

Functions

Link copied to clipboard
open fun isFinished(): Boolean

Is the conversation finished?

Link copied to clipboard
open override fun 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.

Link copied to clipboard
open fun saveAndSend(message: AssistantMessage)

Convenience method to add a message to the conversation