akvo-rag-js 1.0.5 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -9
- package/package.json +49 -40
- package/dist/1e59d2330b4c6deb84b3.ttf +0 -0
- package/dist/20fd1704ea223900efa9.woff2 +0 -0
- package/dist/8b43027f47b20503057d.eot +0 -0
- package/dist/akvo-rag.css +0 -2339
- package/dist/akvo-rag.js +0 -1
- package/dist/c1e38fd9e0e74ba58f7a.svg +0 -2671
- package/dist/f691f37e57f04c152e23.woff +0 -0
- package/dist/index.html +0 -1
package/README.md
CHANGED
|
@@ -24,11 +24,14 @@ npm install akvo-rag-js
|
|
|
24
24
|
Example Usage:
|
|
25
25
|
|
|
26
26
|
```javascript
|
|
27
|
-
import { initChat } from 'akvo-rag';
|
|
27
|
+
import { initChat } from 'akvo-rag-js';
|
|
28
28
|
import 'akvo-rag-js/dist/akvo-rag.css';
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
initChat({
|
|
31
31
|
title: 'Support Bot',
|
|
32
|
+
token: "<auth-token>",
|
|
33
|
+
kb_id: 39,
|
|
34
|
+
wsURL: "ws://localhost:81/ws/chat",
|
|
32
35
|
});
|
|
33
36
|
|
|
34
37
|
```
|
|
@@ -53,6 +56,9 @@ initChatbot({
|
|
|
53
56
|
<script>
|
|
54
57
|
AkvoRAG.initChat({
|
|
55
58
|
title: 'Support Bot',
|
|
59
|
+
token: "<auth-token>",
|
|
60
|
+
kb_id: 39,
|
|
61
|
+
wsURL: "ws://localhost:81/ws/chat",
|
|
56
62
|
});
|
|
57
63
|
</script>
|
|
58
64
|
|
|
@@ -60,16 +66,29 @@ initChatbot({
|
|
|
60
66
|
</html>
|
|
61
67
|
```
|
|
62
68
|
|
|
63
|
-
##
|
|
69
|
+
## ⚙️ `initChat` Parameters
|
|
64
70
|
|
|
65
|
-
|
|
71
|
+
The `initChat` function accepts a configuration object to customize the chat widget behavior:
|
|
66
72
|
|
|
67
|
-
|
|
73
|
+
| Parameter | Type | Required | Description |
|
|
74
|
+
| --------- | -------- | -------- | -------------------------------------------------------- |
|
|
75
|
+
| `title` | `string` | ✅ Yes | The title displayed at the top of the chat window. |
|
|
76
|
+
| `token` | `string` | ✅ Yes | JWT or access token used for authenticating the user. |
|
|
77
|
+
| `kb_id` | `number` | ✅ Yes | The Knowledge Base ID to be used in the RAG backend. |
|
|
78
|
+
| `wsURL` | `string` | ✅ Yes | WebSocket endpoint URL for real-time chat communication. |
|
|
68
79
|
|
|
69
|
-
|
|
80
|
+
💡 Additional configuration options may be added in future releases to support themes, positioning, or additional behaviors.
|
|
81
|
+
|
|
82
|
+
## 🎨 Styling
|
|
83
|
+
|
|
84
|
+
All styles are scoped under `#akvo-rag`. You can override CSS variables or extend the SCSS if needed.
|
|
85
|
+
|
|
86
|
+
## 🧱 Development
|
|
87
|
+
|
|
88
|
+
To develop locally:
|
|
70
89
|
|
|
71
90
|
```bash
|
|
72
|
-
git clone https://github.com/akvo/akvo-rag-js.git
|
|
91
|
+
git clone https://github.com/akvo/akvo-rag-js.git
|
|
73
92
|
cd akvo-rag-js
|
|
74
93
|
npm install
|
|
75
94
|
npm run dev
|
|
@@ -80,9 +99,9 @@ Build for production:
|
|
|
80
99
|
npm run build
|
|
81
100
|
```
|
|
82
101
|
|
|
83
|
-
## 🤝 Contributing
|
|
102
|
+
## 🤝 Contributing
|
|
84
103
|
|
|
85
|
-
Contributions are welcome! Please open an issue or submit a PR.
|
|
104
|
+
Contributions are welcome! Please open an issue or submit a PR.
|
|
86
105
|
|
|
87
106
|
## 📄 License
|
|
88
107
|
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
|
package/package.json
CHANGED
|
@@ -1,42 +1,51 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
2
|
+
"name": "akvo-rag-js",
|
|
3
|
+
"version": "1.0.7",
|
|
4
|
+
"description": "An embeddable chatbot widget for Akvo RAG.",
|
|
5
|
+
"main": "dist/index.cjs.js",
|
|
6
|
+
"module": "dist/index.esm.js",
|
|
7
|
+
"browser": "dist/akvo-rag.js",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "webpack --mode production",
|
|
13
|
+
"dev": "webpack serve",
|
|
14
|
+
"publish": "npm publish --access public"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/akvo/akvo-rag-js.git"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"chatbot",
|
|
22
|
+
"widget",
|
|
23
|
+
"akvo",
|
|
24
|
+
"rag"
|
|
25
|
+
],
|
|
26
|
+
"author": "Akvo",
|
|
27
|
+
"license": "AGPL-3.0",
|
|
28
|
+
"bugs": {
|
|
29
|
+
"url": "https://github.com/akvo/akvo-rag-js/issues"
|
|
30
|
+
},
|
|
31
|
+
"homepage": "https://github.com/akvo/akvo-rag-js#readme",
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@babel/core": "^7.27.1",
|
|
34
|
+
"@babel/preset-env": "^7.27.2",
|
|
35
|
+
"babel-loader": "^10.0.0",
|
|
36
|
+
"css-loader": "^7.1.2",
|
|
37
|
+
"html-webpack-plugin": "^5.6.3",
|
|
38
|
+
"mini-css-extract-plugin": "^2.9.2",
|
|
39
|
+
"sass": "^1.88.0",
|
|
40
|
+
"sass-loader": "^16.0.5",
|
|
41
|
+
"terser-webpack-plugin": "^5.3.14",
|
|
42
|
+
"webpack": "^5.99.8",
|
|
43
|
+
"webpack-cli": "^6.0.1",
|
|
44
|
+
"webpack-dev-server": "^5.2.1"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"dompurify": "^3.2.5",
|
|
48
|
+
"font-awesome": "^4.7.0",
|
|
49
|
+
"marked": "^15.0.11"
|
|
50
|
+
}
|
|
42
51
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|