openkbs 0.0.20 → 0.0.21

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/Docs.md CHANGED
@@ -77,7 +77,7 @@ export const handler = async (event) => {
77
77
  const actions = getActions({
78
78
  _meta_actions: event?.payload?.messages?.length > maxSelfInvokeMessagesCount
79
79
  ? ["REQUEST_CHAT_MODEL_EXCEEDED"]
80
- : []
80
+ : ["REQUEST_CHAT_MODEL"]
81
81
  });
82
82
 
83
83
  for (let [regex, action] of actions) {
@@ -393,7 +393,7 @@ The `openkbs` object provides a set of utility functions and services to interac
393
393
 
394
394
  * **`openkbs.detectLanguage(text, params)`:** Detects the language of the provided text.
395
395
 
396
- * **`openkbs.textToSpeech(text, params)`:** Converts text to speech.
396
+ * **`openkbs.textToSpeech(text, params)`:** Converts text to speech. Returns `response.audioContent` which automatically plays in the chat interface.
397
397
 
398
398
  * **`openkbs.encrypt(plaintext)`:** Encrypts data using the provided AES key.
399
399
 
package/INSTALL.md ADDED
@@ -0,0 +1,36 @@
1
+ - **Download CLI Binary**
2
+
3
+ - **Linux (x64):**
4
+
5
+ ```bash
6
+
7
+ wget -O ~/Downloads/openkbs https://downloads.openkbs.com/cli/linux/openkbs && chmod +x ~/Downloads/openkbs && sudo mv ~/Downloads/openkbs /usr/local/bin/openkbs
8
+
9
+ ```
10
+
11
+ - **Windows (x64):**
12
+
13
+ ```powershell
14
+
15
+ Invoke-WebRequest -Uri "https://downloads.openkbs.com/cli/windows/openkbs.exe" -OutFile "$Env:USERPROFILE\Downloads\openkbs.exe"
16
+
17
+ $Env:Path += ";$Env:USERPROFILE\Downloads"
18
+
19
+ ```
20
+
21
+
22
+ - **Mac (new M series):**
23
+
24
+ ```bash
25
+
26
+ curl -o ~/Downloads/openkbs https://downloads.openkbs.com/cli/macos/openkbs && mkdir -p /usr/local/bin && chmod +x ~/Downloads/openkbs && sudo mv ~/Downloads/openkbs /usr/local/bin/openkbs
27
+
28
+ ```
29
+
30
+ - **Mac (old models):**
31
+
32
+ ```bash
33
+
34
+ curl -o ~/Downloads/openkbs https://downloads.openkbs.com/cli/macos/openkbs-x64 && mkdir -p /usr/local/bin && chmod +x ~/Downloads/openkbs && sudo mv ~/Downloads/openkbs /usr/local/bin/openkbs
35
+
36
+ ```
package/README.md CHANGED
@@ -1,75 +1,41 @@
1
1
  # OpenKBS · [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/open-kbs/openkbs-chat/blob/main/LICENSE) [![npm version](https://img.shields.io/badge/npm-v0.0.20-orange.svg)](https://www.npmjs.com/package/openkbs)
2
2
 
3
- OpenKBS is an extendable open-source platform designed to build, deploy and integrate AI agents anywhere - from websites to IoT devices. Its event-driven architecture enables full customization of backend and frontend components, while the LLM abstraction layer allows seamless switching between language models.
4
- ### Last Updates
3
+ OpenKBS is an extendable open-source platform designed to build, deploy and integrate AI agents anywhere, from websites to IoT devices. Its event-driven architecture enables full customization of backend and frontend components, while the LLM abstraction layer allows seamless switching between language models.
5
4
 
6
- ### Table of Contents
5
+ ## Table of Contents
7
6
 
8
7
  - [Install CLI](#install-cli)
9
- - [Create new Application](#create-new-application)
10
- - [Deploy Your Application](#deploy-your-application)
11
- - [Enhance Your Application](#enhance-your-application)
12
- - [Local Development](#local-development)
13
- - [Use Built-in MUI Components](#use-built-in-mui-components)
8
+ - [Create App](#create-app)
9
+ - [Deploy](#deploy)
10
+ - [Extend Frontend](#extend-frontend)
11
+ - [Setup Local Development](#setup-local-development)
12
+ - [Use Built-in MUI Components](#use-built-in-mui-components)
13
+ - [AI-Powered Generation](#ai-powered-frontend-generation)
14
+ - [Extend Backend](#extend-backend)
15
+ - [Framework Documentation](#framework-documentation)
14
16
  - [License](#license)
15
17
  - [Contributing](#contributing)
16
18
  - [Contact](#contact)
17
19
 
18
- ## Creating Your First AI Agent Manually
19
-
20
- Follow these steps to create and deploy your first OpenKBS app using React and Node.js,
21
-
22
- ### Install CLI
20
+ ## Install CLI
23
21
 
24
22
  First, ensure you have the OpenKBS CLI installed globally:
25
23
 
26
- - **Option 1: using NPM**
27
24
  ```bash
28
25
  npm install -g openkbs
29
26
  ```
30
27
 
31
- - **Option 2: Download Binary**
32
-
33
- - **Linux (x64):**
34
- ```bash
35
- wget -O ~/Downloads/openkbs https://downloads.openkbs.com/cli/linux/openkbs && chmod +x ~/Downloads/openkbs && sudo mv ~/Downloads/openkbs /usr/local/bin/openkbs
36
- ```
37
- - **Windows (x64):**
38
- ```powershell
39
- Invoke-WebRequest -Uri "https://downloads.openkbs.com/cli/windows/openkbs.exe" -OutFile "$Env:USERPROFILE\Downloads\openkbs.exe"
40
- $Env:Path += ";$Env:USERPROFILE\Downloads"
41
- ```
42
-
43
- - **Mac (new M series):**
44
- ```bash
45
- curl -o ~/Downloads/openkbs https://downloads.openkbs.com/cli/macos/openkbs && mkdir -p /usr/local/bin && chmod +x ~/Downloads/openkbs && sudo mv ~/Downloads/openkbs /usr/local/bin/openkbs
46
- ```
47
- - **Mac (old models):**
48
- ```bash
49
- curl -o ~/Downloads/openkbs https://downloads.openkbs.com/cli/macos/openkbs-x64 && mkdir -p /usr/local/bin && chmod +x ~/Downloads/openkbs && sudo mv ~/Downloads/openkbs /usr/local/bin/openkbs
50
- ```
51
-
52
-
53
-
54
- ### Create New Application
28
+ ## Create App
55
29
 
56
30
  Create a new application using the OpenKBS CLI:
57
31
 
58
32
  ```bash
59
- openkbs create my-pc-agent
60
- ```
61
-
62
- Navigate into your newly created application directory:
33
+ openkbs create my-agent
63
34
 
64
- ```bash
65
- cd my-pc-agent
35
+ cd my-agent
66
36
  ```
67
37
 
68
- ### Deploy Your Application
69
-
70
- You have two options for deployment: OpenKBS Cloud or LocalStack.
71
-
72
- #### Deploy to OpenKBS Cloud
38
+ ## Deploy
73
39
 
74
40
  1. Log in to OpenKBS:
75
41
 
@@ -77,7 +43,7 @@ You have two options for deployment: OpenKBS Cloud or LocalStack.
77
43
  openkbs login
78
44
  ```
79
45
 
80
- 2. Push your application to OpenKBS Cloud:
46
+ 2. Push your application to OpenKBS:
81
47
 
82
48
  ```bash
83
49
  openkbs push
@@ -87,9 +53,9 @@ You have two options for deployment: OpenKBS Cloud or LocalStack.
87
53
 
88
54
  3. Open the provided URL and interact with your application.
89
55
 
90
- ### Enhance Your Application
56
+ ## Extend Frontend
91
57
 
92
- To improve your application's rendering, you can use libraries like `react-markdown` for example.
58
+ To improve your application's user interface, you can use libraries like `react-markdown` for example.
93
59
 
94
60
  1. Add `react-markdown` to your dependencies:
95
61
 
@@ -122,7 +88,7 @@ To improve your application's rendering, you can use libraries like `react-markd
122
88
  openkbs push
123
89
  ```
124
90
 
125
- ### Local Development
91
+ ### Setup Local Development
126
92
 
127
93
  For faster frontend development, run the OpenKBS UI dev server locally:
128
94
 
@@ -148,13 +114,13 @@ Enhance your UI with Material-UI components:
148
114
 
149
115
  ```js
150
116
  return (
151
- <AppBar position="absolute" style={{ zIndex: 2000, flexGrow: 1, textAlign: 'left' }}>
117
+ <AppBar position="absolute" style={{ zIndex: 1300, flexGrow: 1, textAlign: 'left' }}>
152
118
  <Toolbar>
153
119
  <IconButton edge="start" color="inherit" aria-label="menu" style={{ marginRight: '16px' }}>
154
120
  <MenuIcon />
155
121
  </IconButton>
156
122
  <Typography variant="h6" style={{ flexGrow: 1 }}>
157
- My PC Agent
123
+ My Agent
158
124
  </Typography>
159
125
  <IconButton edge="end" color="inherit" aria-label="account">
160
126
  <AccountIcon />
@@ -166,7 +132,7 @@ Enhance your UI with Material-UI components:
166
132
 
167
133
  3. Observe real-time rendering by refreshing your browser at http://{kbId}.apps.localhost:38593/
168
134
 
169
- 4. Push the changes to your remote KB:
135
+ 4. Push the changes to your remote app instance:
170
136
 
171
137
  ```bash
172
138
  openkbs push
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openkbs",
3
- "version": "0.0.20",
3
+ "version": "0.0.21",
4
4
  "description": "OpenKBS - Command Line Interface",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/utils.js CHANGED
@@ -370,7 +370,7 @@ async function modifyKB(kbToken, kbData, prompt, files, options) {
370
370
 
371
371
  const sendMessage = async (message) => {
372
372
  return makePostRequest(url, {
373
- rootToken: kbToken,
373
+ token: kbToken,
374
374
  message: encrypt(message, key),
375
375
  chatId: createdChatId,
376
376
  encrypted: true,