@beltoinc/slyos-sdk 1.5.4 → 1.5.6
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 +434 -434
- package/{slyos-chatbot/app.mjs → create-chatbot.sh} +728 -370
- package/dist/index.js +26 -4
- package/package.json +35 -35
- package/src/index.ts +2147 -0
- package/tsconfig.json +15 -0
- package/slyos-chatbot/.env +0 -4
- package/slyos-chatbot/.env.example +0 -4
- package/slyos-chatbot/README.md +0 -89
- package/slyos-chatbot/package-lock.json +0 -1408
- package/slyos-chatbot/package.json +0 -23
package/tsconfig.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"module": "ES2020",
|
|
5
|
+
"lib": ["ES2020", "DOM"],
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"outDir": "./dist",
|
|
8
|
+
"strict": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"moduleResolution": "node"
|
|
12
|
+
},
|
|
13
|
+
"include": ["src/**/*"],
|
|
14
|
+
"exclude": ["node_modules", "dist"]
|
|
15
|
+
}
|
package/slyos-chatbot/.env
DELETED
package/slyos-chatbot/README.md
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
# Slyos Interactive Chatbot
|
|
2
|
-
|
|
3
|
-
A simple yet powerful interactive chatbot powered by the Slyos SDK.
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
- Interactive command-line interface with colored output
|
|
8
|
-
- Conversation history management
|
|
9
|
-
- Easy API configuration
|
|
10
|
-
- Cross-platform support (Mac, Windows, Linux)
|
|
11
|
-
|
|
12
|
-
## Installation
|
|
13
|
-
|
|
14
|
-
1. Clone or download this project
|
|
15
|
-
2. Install dependencies: `npm install`
|
|
16
|
-
3. Configure your API key (see Configuration)
|
|
17
|
-
|
|
18
|
-
## Configuration
|
|
19
|
-
|
|
20
|
-
### Environment Variables
|
|
21
|
-
|
|
22
|
-
Set these environment variables before running:
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
export SLYOS_API_KEY=your_api_key_here
|
|
26
|
-
export SLYOS_MODEL=quantum-1.7b
|
|
27
|
-
export SLYOS_SERVER=https://api.slyos.world
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
Or create a `.env` file based on `.env.example`.
|
|
31
|
-
|
|
32
|
-
## Running the Chatbot
|
|
33
|
-
|
|
34
|
-
### Direct Method
|
|
35
|
-
```bash
|
|
36
|
-
npm start
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
### With Environment Variables
|
|
40
|
-
```bash
|
|
41
|
-
SLYOS_API_KEY=your_key npm start
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
### Manual
|
|
45
|
-
```bash
|
|
46
|
-
node app.mjs
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## Usage
|
|
50
|
-
|
|
51
|
-
Once the chatbot starts:
|
|
52
|
-
|
|
53
|
-
- **Chat**: Type your message and press Enter
|
|
54
|
-
- **Clear History**: Type `clear` to reset conversation
|
|
55
|
-
- **Exit**: Type `exit` or `quit` to end session
|
|
56
|
-
- **Interrupt**: Press Ctrl+C to exit anytime
|
|
57
|
-
|
|
58
|
-
## API Response Format
|
|
59
|
-
|
|
60
|
-
The chatbot supports multiple response formats from the SDK:
|
|
61
|
-
|
|
62
|
-
- `response.content` - Primary response text
|
|
63
|
-
- `response.text` - Alternative response field
|
|
64
|
-
- Direct string response - Fallback format
|
|
65
|
-
|
|
66
|
-
## Troubleshooting
|
|
67
|
-
|
|
68
|
-
### "Error initializing SDK"
|
|
69
|
-
- Check that your API key is valid
|
|
70
|
-
- Verify the Slyos server is accessible
|
|
71
|
-
- Ensure internet connection is active
|
|
72
|
-
|
|
73
|
-
### "Cannot find module '@beltoinc/slyos-sdk'"
|
|
74
|
-
- Run `npm install` to install dependencies
|
|
75
|
-
- Check npm log: `npm list`
|
|
76
|
-
|
|
77
|
-
### Placeholder API Key Warning
|
|
78
|
-
- Set the `SLYOS_API_KEY` environment variable with your actual key
|
|
79
|
-
- Or update `config.apiKey` in `app.mjs`
|
|
80
|
-
|
|
81
|
-
## System Requirements
|
|
82
|
-
|
|
83
|
-
- Node.js 14+ (14.17.0 or higher recommended)
|
|
84
|
-
- npm 6+
|
|
85
|
-
- Internet connection for API access
|
|
86
|
-
|
|
87
|
-
## License
|
|
88
|
-
|
|
89
|
-
MIT
|