Creating a conversation
Create a conversation handler insrc/conversations/:
Channel matching
Thechannel property determines which integration channels the Conversation handles:
Conversation handler
The handler function receives context about the incoming message and provides APIs to execute your agent’s logic:Using knowledge bases
Provide knowledge to your agent’s AI model:Using hooks
Add hooks to customize behavior at different stages:Conversation instance
Thehandler receives a conversation object that provides methods to interact with the current conversation:
Sending messages
Send a message to the conversation:Typing indicators
Control typing indicators:Conversation tags
Access and modify conversation tags:Trigger subscriptions
Subscribe a conversation to triggers:Multiple conversations
You can create multiple conversation handlers for different channels or use cases:Reference
Conversation props
Handler parameters
The handler function receives different parameters depending on the incoming request type. The handler uses a discriminated union based on thetype field:
Message handler
Whentype is "message":
Event handler
Whentype is "event":
Workflow request handler
Whentype is "workflow_request":