Configure custom intent detection to enhance your chatbot's ability to recognize and respond to specific user needs.
Intentions are predefined patterns of user queries that trigger specific responses or actions. They allow your chatbot to:
When an intention is detected, the system can return a predefined response or trigger a special action, such as routing to a human agent or retrieving specific information.
You can configure intentions through the Project Dashboard under "Intentions" in the project menu. This gives you full control over creating custom intentions that meet your specific needs.
Intentions are configured using a JSON structure with the following format:
{
"intentions": [
{
"name": "human_assistance",
"samples": [
"I need to speak with a human",
"Can I talk to a real person",
"Connect me with support",
"I want to speak to a representative"
],
"response_code": "HUMAN_ASSIST_REQUESTED"
},
{
"name": "pricing_inquiry",
"samples": [
"What are your prices",
"How much does it cost",
"Can you tell me about pricing",
"Do you have payment plans",
"What are the subscription fees",
"I want to know about payment options"
],
"response_code": "SALES_DEPARTMENT_REDIRECT"
}
]
}
Property | Type | Description |
---|---|---|
intentions | array | Array of intention objects |
name | string | Unique identifier for the intention |
samples | array | Example phrases that should trigger this intention |
response_code | string | Custom identifier for your response or action to trigger |
Response codes are fully customizable. You can create any response code that makes sense for your application. Here are some examples of how you might use custom response codes:
Example Response Code | Possible Use |
---|---|
HUMAN_ASSIST_REQUESTED | For handling requests to speak with a human agent |
SALES_DEPARTMENT_REDIRECT | For redirecting pricing and payment questions to the sales team |
SUPPORT_REQUESTED | For directing users to support resources |
ORDER_STATUS_CHECK | For handling order status inquiries |
The response codes you define are used within your application to determine how to handle specific user intentions. You have complete freedom to create any response codes that align with your business needs.
When an intention is detected through the Chat API, the response will include is_intention: true
and return the specified response code. Your application is responsible for handling this response code and providing the appropriate user-facing message:
{
"status": "success",
"message": {
"question": "Can I speak to a human agent?",
"answer": "HUMAN_ASSIST_REQUESTED",
"source": []
},
"execution_time": 0.3,
"call_cost": 0,
"total_tokens": 1,
"is_intention": true
}
Your integration should check for is_intention: true
and handle the response code in the answer
field accordingly. This allows you to customize how each intention is presented to your users.