Skip to content

Commit c23c561

Browse files
add documentation (#187)
1 parent 5ec4103 commit c23c561

11 files changed

+255
-4
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@
44

55

66
AI Chatbot Framework is an open-source, self-hosted, DIY Chatbot building platform built in Python. With this tool, it’s easy to create Natural Language conversational scenarios with no coding efforts whatsoever.
7-
The smooth UI makes it effortless to create and train conversations to the bot. AI Chatbot Framework can live on any channel of your choice (such as Messenger, Slack etc.) by integrating it’s API with that platform.
8-
9-
You don’t need to be an expert at artificial intelligence to create an awesome chatbot that has AI capabilities. With this project you can create an AI powered chatting machine in no time.
7+
The smooth UI makes it effortless to create and train conversations to the bot. AI Chatbot Framework can live on any channel of your choice (such as Messenger, Slack etc.).
108

9+
You don’t need to be an expert at artificial intelligence to create an awesome chatbot that has AI capabilities. With this project you can create an AI powered chatbot in no time. Read the [getting started guide](docs/01-getting-started.md) to get started.
1110

1211
![](docs/screenshots/admin_chat_screenshot.png)
1312

docs/01-getting-started.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Getting started
2+
3+
## Understanding Key Concepts
4+
5+
### Intents
6+
7+
Intents are the building blocks of your chatbot's understanding - they define what your bot can recognize and how it should respond. An intent represents a specific action or request that users might make.
8+
9+
For example, when a user asks "What's the weather like today?", the intent would be "check_weather".
10+
11+
### Entities
12+
13+
Entities are specific pieces of information that you want to extract from user messages. For example, in the message "Book a table for 4 people at 7 PM", "4" (number of people) and "7 PM" (time) are entities.
14+
15+
### Channels
16+
17+
Channels are the platforms where your chatbot can be accessed. They can be web, or social media platforms like Facebook Messenger.
18+
19+
## Admin Panel
20+
21+
The admin panel serves as the central hub for managing your chatbot. You can use it for following:
22+
23+
- Configure and manage intents
24+
- Create and edit entities
25+
- Train your chatbot
26+
- Test conversations in real-time
27+
- Monitor conversation logs
28+
- Manage Channel integrations
29+
30+
Access the admin panel at [http://localhost:3000](http://localhost:3000) after starting the application.
31+
32+
## Next Steps
33+
- [Create your first intent](02-creating-order-status-check.md)
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# Creating Order Status Check Bot
2+
3+
This guide walks you through creating a practical example of implementing order status check functionality in your chatbot.
4+
5+
For a quick start, you can find a pre-configured bot in the [examples folder](../examples/order_status.json). Import it through Settings/Data Management, then train the model via the "Train Models" button in the Intents page. Once done, you can proceed directly to the [testing](#testing) section.
6+
7+
## Configuration
8+
9+
### 1. Create Order Number Entity
10+
11+
1. Go to the Entities section
12+
2. Create a new entity named "order_number"
13+
14+
### 2. Create the Intent
15+
16+
1. Navigate to the Intents section in the admin interface
17+
2. Click "Create Intent"
18+
3. Configure the basic intent information:
19+
- **Intent Name**: "Check Order Status"
20+
- **Intent ID**: "check_order_status"
21+
22+
#### Configure Parameters
23+
24+
Add the following parameter:
25+
- **Name**: "order_number"
26+
- **Type**: Select your order number entity type
27+
- **Required**: Yes
28+
- **Prompt**: "Please provide your order number"
29+
30+
[![intent_configuration_1.png](screenshots/intent_configuration_1.png)](screenshots/intent_configuration_1.png)
31+
32+
### 3. Set Up API Integration
33+
34+
We'll use a free dummy order status API for this example:
35+
36+
```
37+
https://fake-store-api.mock.beeceptor.com/api/orders/status?order_id=ORD1234
38+
```
39+
40+
Example API Response:
41+
```json
42+
{
43+
"order_id": 1,
44+
"user_id": 1,
45+
"status": "Shipped",
46+
"total_price": 849.97,
47+
"items": [ { "product_id": 1, "quantity": 2 }, { "product_id": 3, "quantity": 1 } ]
48+
}
49+
```
50+
51+
Configuration steps:
52+
1. Enable "Trigger API"
53+
2. Add the API URL with parameter templating:
54+
```
55+
https://fake-store-api.mock.beeceptor.com/api/orders/status?order_id={{ parameters['name'] }}
56+
```
57+
3. Choose method as GET
58+
4. Leave the headers and JSON payload configurations as default
59+
60+
[![API Trigger](screenshots/intent_configuration_api_trigger.png)](screenshots/intent_configuration_api_trigger.png)
61+
62+
### 4. Configure Response Template
63+
64+
In the response section of the intent, customize the response using the API result:
65+
```
66+
Your order status is {{ result['status'] }}
67+
```
68+
69+
## Training
70+
71+
### 1. Add Training Phrases
72+
73+
1. Go to Intents Page and click on the training icon
74+
[![Training](screenshots/training_icon.png)](screenshots/training_icon.png)
75+
76+
2. Add the following example phrases:
77+
- Tell me order status
78+
- What's the status of my order ORD123456?
79+
- Track order ORDER789012
80+
- Where is my order ORD123456?
81+
- Can you check order ORD789012 for me?
82+
- I want to know about order ORD123456
83+
- What is my order status
84+
85+
### 2. Label Entities
86+
87+
1. In each training phrase, highlight the order numbers
88+
2. Select the "order_number" entity type
89+
3. Ensure all variations are properly labeled
90+
91+
[![Entity Labeling](screenshots/training_entity_label.png)](screenshots/training_entity_label.png)
92+
93+
### 3. Train the Model
94+
95+
1. Return to the Intents Page
96+
2. Click "Train Models"
97+
3. Wait for training completion
98+
4. Test the intent with sample queries
99+
100+
## Testing
101+
102+
1. Navigate to the Chat Page
103+
2. Test with different variations:
104+
- "What is my order status?"
105+
- "Track my order ORD123456"
106+
- "Where is ORDER789012?"
107+
3. Verify the following:
108+
- Intent is correctly identified
109+
- Order number is properly extracted
110+
- API is triggered with correct parameters
111+
112+
[![Testing](screenshots/testing.png)](screenshots/testing.png)
113+
114+
## Next Steps
115+
- [Integrate with other channels](03-integrating-with-channels.md)
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Integrating with Channels
2+
3+
This guide explains how to integrate your chatbot with different communication channels to make it accessible to your users.
4+
5+
## Chat Widget
6+
7+
### Setting Up the Widget
8+
1. Navigate to the Integrations section under Settings
9+
2. Enable the chat widget integration
10+
3. Configure widget settings:
11+
- Set base URL (`iky_base_url`)
12+
- Add custom context (`chat_context`)
13+
14+
### Implementation
15+
1. Copy the widget code snippet
16+
2. Paste it into your website's HTML:
17+
```html
18+
<html>
19+
<head>...</head>
20+
<body>
21+
...
22+
</body>
23+
<script type="text/javascript">
24+
!function(win,doc){"use strict";var script_loader=()=>{try
25+
{var head=doc.head||doc.getElementsByTagName("head")[0],script=doc.createElement("script");script.setAttribute("type","text/javascript"),script.setAttribute("src","https://alfredfrancis.in/ai-chatbot-framework/app/static/widget/script.js"),head.appendChild(script)}
26+
catch(e){}};win.chat_context={"username":"John"},win.iky_base_url="http://localhost:8080/admin/",script_loader()}(window,document);
27+
</script>
28+
</html>
29+
```
30+
31+
## REST API
32+
33+
### Authentication
34+
1. Generate an API key from the admin dashboard
35+
2. Include the key in your API requests:
36+
```
37+
Authorization: Bearer YOUR_API_KEY
38+
```
39+
40+
### Making Requests
41+
- Endpoint: `POST /api/chat`
42+
- Request format:
43+
```json
44+
{
45+
"thread_id":"123456",
46+
"text": "hello world",
47+
"context": {
48+
"Name": "Alfred",
49+
// additional context data
50+
}
51+
}
52+
```
53+
- Response Format:
54+
```json
55+
[{"text":"Hello Alfred 👋 "},{"text":" What can i do for you ?"}]
56+
```
57+
58+
Sample cURL request:
59+
```sh
60+
curl 'http://localhost:8080/bots/channels/rest/webbook' \
61+
-H 'Content-Type: application/json' \
62+
--data-raw '{"thread_id":"test-user","text":"/init_conversation","context":{"username":"Admin"}}'
63+
```
64+
65+
## Facebook Messenger
66+
67+
### Prerequisites
68+
- Facebook Developer Account
69+
- Facebook Page for your chatbot
70+
71+
### Configuration Steps
72+
1. Create a Facebook App
73+
2. Enable Messenger integration
74+
3. In your chatbot admin panel:
75+
- Enable Facebook integration
76+
- Configure webhook URL
77+
- Set up authentication:
78+
- Verify token
79+
- App secret
80+
- Page access token
81+
82+
### Testing the Integration
83+
1. Send a test message to your Facebook Page
84+
2. Verify the chatbot responds correctly
85+
3. Check webhook events in the Facebook Developer Console

docs/README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,19 @@
1-
# Docs
1+
# AI Chatbot Framework Documentation
2+
3+
Welcome to the AI Chatbot Framework documentation. This documentation provides comprehensive guidance on setting up, developing, and deploying your chatbot.
4+
5+
## Table of Contents
6+
7+
1. [Getting Started](01-getting-started.md)
8+
- [Understanding Key Concepts](01-getting-started.md#understanding-key-concepts)
9+
- [Admin Panel](01-getting-started.md#admin-panel)
10+
11+
2. [Creating Order Status Check Bot](02-creating-order-status-check.md)
12+
- [Configuration](02-creating-order-status-check.md#configuration)
13+
- [Training the Intent and Entities](02-creating-order-status-check.md#training)
14+
- [Testing](02-creating-order-status-check.md#testing)
15+
16+
3. [Integrating with Channels](03-integrating-with-channels.md)
17+
- [Chat Widget](03-integrating-with-channels.md#chat-widget)
18+
- [REST API](03-integrating-with-channels.md#rest-api)
19+
- [Facebook Messenger](03-integrating-with-channels.md#facebook-messenger)
134 KB
Loading
77.4 KB
Loading

docs/screenshots/testing.png

356 KB
Loading
172 KB
Loading

docs/screenshots/training_icon.png

197 KB
Loading

0 commit comments

Comments
 (0)