agenticaichat 1.0.3 → 1.0.4
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 +140 -15
- package/bin/cli.js +120 -49
- package/dist/adapters/angular.d.ts +9 -0
- package/dist/adapters/angular.js +6 -0
- package/dist/adapters/react.d.ts +1 -0
- package/dist/adapters/react.js +8 -0
- package/dist/adapters/vue.d.ts +9 -0
- package/dist/adapters/vue.js +6 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +20 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,11 +13,11 @@ AI-powered chatbot for business analytics with natural language database queries
|
|
|
13
13
|
## Requirements
|
|
14
14
|
|
|
15
15
|
- Node.js 18+ and npm 9+
|
|
16
|
-
- React 18+ and Next.js 13+ (app router recommended)
|
|
16
|
+
- React 18+ and Next.js 13+ (app router recommended) for the built-in widget
|
|
17
17
|
|
|
18
18
|
## Installation and Setup
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
Install the package:
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
23
|
# npm
|
|
@@ -30,21 +30,21 @@ yarn add agenticaichat
|
|
|
30
30
|
pnpm add agenticaichat
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
Run the setup wizard to configure your database and AI provider:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npx agenticai-setup
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The wizard will:
|
|
34
40
|
|
|
35
41
|
- Ask for your database type and connection details
|
|
36
42
|
- Collect your AI provider, model, and API key
|
|
37
43
|
- Generate `.env.chatbot` and `chatbot-config.json`
|
|
38
|
-
-
|
|
39
|
-
|
|
40
|
-
- `app/chat/page.tsx`
|
|
41
|
-
- Updates `.gitignore` to exclude generated secrets
|
|
44
|
+
- For Next.js: Generate API route and chat page
|
|
45
|
+
- Update `.gitignore` to exclude generated secrets
|
|
42
46
|
|
|
43
|
-
If
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
npx agenticai-setup
|
|
47
|
-
```
|
|
47
|
+
If the wizard doesn't run automatically after install (e.g., in CI or non-interactive environments), run the command above manually.
|
|
48
48
|
|
|
49
49
|
## Quick Start (Next.js)
|
|
50
50
|
|
|
@@ -81,11 +81,136 @@ Start your Next.js app:
|
|
|
81
81
|
npm run dev
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
-
##
|
|
84
|
+
## Setting up the Backend API
|
|
85
|
+
|
|
86
|
+
For all frameworks, you need a backend endpoint that handles chatbot queries. The setup wizard generates configuration files, but you must implement the API route yourself unless using Next.js.
|
|
87
|
+
|
|
88
|
+
1. Run the setup wizard to generate `.env.chatbot` and `chatbot-config.json`:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
npx agenticai-setup
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
2. Create an HTTP POST endpoint at `/api/chatbot/query` (or any path you choose).
|
|
95
|
+
|
|
96
|
+
Use the template from `templates/api-route.template.ts` as a guide. Load environment variables from `.env.chatbot` and use the `ChatbotEngine` from `agenticaichat/core`.
|
|
97
|
+
|
|
98
|
+
Example (Node.js/Express):
|
|
99
|
+
|
|
100
|
+
```javascript
|
|
101
|
+
const express = require('express');
|
|
102
|
+
const { ChatbotEngine } = require('agenticaichat/core');
|
|
103
|
+
require('dotenv').config({ path: '.env.chatbot' });
|
|
104
|
+
|
|
105
|
+
const app = express();
|
|
106
|
+
app.use(express.json());
|
|
107
|
+
|
|
108
|
+
app.post('/api/chatbot/query', async (req, res) => {
|
|
109
|
+
const { query } = req.body;
|
|
110
|
+
const engine = new ChatbotEngine();
|
|
111
|
+
try {
|
|
112
|
+
const result = await engine.processQuery(query);
|
|
113
|
+
res.json(result);
|
|
114
|
+
} catch (error) {
|
|
115
|
+
res.status(500).json({ error: error.message });
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
app.listen(3000);
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
For Next.js, the wizard generates this automatically.
|
|
123
|
+
|
|
124
|
+
## Setup for Angular
|
|
125
|
+
|
|
126
|
+
1. Install the package and run setup:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
npm install agenticaichat
|
|
130
|
+
npx agenticai-setup
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
2. Set up the backend API as described above (e.g., using Express or your preferred Node.js framework).
|
|
134
|
+
|
|
135
|
+
3. In your Angular app, create a chatbot component:
|
|
136
|
+
|
|
137
|
+
```typescript
|
|
138
|
+
// chatbot.component.ts
|
|
139
|
+
import { Component } from '@angular/core';
|
|
140
|
+
import { HttpClient } from '@angular/common/http';
|
|
141
|
+
import { AngularChatRequest, AngularChatResponse } from 'agenticaichat/angular';
|
|
142
|
+
|
|
143
|
+
@Component({
|
|
144
|
+
selector: 'app-chatbot',
|
|
145
|
+
template: `
|
|
146
|
+
<div>
|
|
147
|
+
<input [(ngModel)]="query" placeholder="Ask a question..." />
|
|
148
|
+
<button (click)="ask()">Ask</button>
|
|
149
|
+
<div *ngIf="response">{{ response.answer }}</div>
|
|
150
|
+
</div>
|
|
151
|
+
`
|
|
152
|
+
})
|
|
153
|
+
export class ChatbotComponent {
|
|
154
|
+
query = '';
|
|
155
|
+
response: AngularChatResponse | null = null;
|
|
156
|
+
|
|
157
|
+
constructor(private http: HttpClient) {}
|
|
158
|
+
|
|
159
|
+
ask() {
|
|
160
|
+
const request: AngularChatRequest = { query: this.query };
|
|
161
|
+
this.http.post<AngularChatResponse>('/api/chatbot/query', request)
|
|
162
|
+
.subscribe(res => this.response = res);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
4. Add the component to your app and ensure CORS is configured on your backend.
|
|
168
|
+
|
|
169
|
+
## Setup for Vue
|
|
170
|
+
|
|
171
|
+
1. Install the package and run setup:
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
npm install agenticaichat
|
|
175
|
+
npx agenticai-setup
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
2. Set up the backend API as described above.
|
|
179
|
+
|
|
180
|
+
3. In your Vue app, create a chatbot component:
|
|
181
|
+
|
|
182
|
+
```vue
|
|
183
|
+
<!-- Chatbot.vue -->
|
|
184
|
+
<template>
|
|
185
|
+
<div>
|
|
186
|
+
<input v-model="query" placeholder="Ask a question..." />
|
|
187
|
+
<button @click="ask">Ask</button>
|
|
188
|
+
<div v-if="response">{{ response.answer }}</div>
|
|
189
|
+
</div>
|
|
190
|
+
</template>
|
|
191
|
+
|
|
192
|
+
<script setup lang="ts">
|
|
193
|
+
import { ref } from 'vue';
|
|
194
|
+
import { VueChatRequest, VueChatResponse } from 'agenticaichat/vue';
|
|
195
|
+
|
|
196
|
+
const query = ref('');
|
|
197
|
+
const response = ref<VueChatResponse | null>(null);
|
|
198
|
+
|
|
199
|
+
const ask = async () => {
|
|
200
|
+
const request: VueChatRequest = { query: query.value };
|
|
201
|
+
const res = await fetch('/api/chatbot/query', {
|
|
202
|
+
method: 'POST',
|
|
203
|
+
headers: { 'Content-Type': 'application/json' },
|
|
204
|
+
body: JSON.stringify(request)
|
|
205
|
+
});
|
|
206
|
+
response.value = await res.json();
|
|
207
|
+
};
|
|
208
|
+
</script>
|
|
209
|
+
```
|
|
85
210
|
|
|
86
|
-
|
|
211
|
+
4. Use the component in your app and configure CORS on your backend.
|
|
87
212
|
|
|
88
|
-
|
|
213
|
+
## Setup for Other React Frameworks
|
|
89
214
|
|
|
90
215
|
- Create an HTTP POST endpoint (e.g., `/api/chatbot/query`) that follows `templates/api-route.template.ts`.
|
|
91
216
|
- Load `.env.chatbot` on the server and wire `DATABASE_URL`, `DB_TYPE`, `LLM_PROVIDER`, `LLM_MODEL`, and `LLM_API_KEY` into the handler.
|
package/bin/cli.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const inquirer = require('inquirer').default;
|
|
4
4
|
const chalk = require('chalk');
|
|
@@ -298,8 +298,41 @@ async function main() {
|
|
|
298
298
|
const selectedProvider = llmProviders.find(p => p.value === llmAnswers.provider);
|
|
299
299
|
console.log(chalk.green(`\n✅ ${selectedProvider.name} configured!\n`));
|
|
300
300
|
|
|
301
|
-
// Step 3:
|
|
302
|
-
console.log(chalk.bold.blue('
|
|
301
|
+
// Step 3: Frontend Framework / Adapter
|
|
302
|
+
console.log(chalk.bold.blue('\n🧩 Step 3: Frontend Framework\n'));
|
|
303
|
+
|
|
304
|
+
const frontendAnswers = await inquirer.prompt([
|
|
305
|
+
{
|
|
306
|
+
type: 'list',
|
|
307
|
+
name: 'framework',
|
|
308
|
+
message: 'Which frontend framework will you use for the chat UI?',
|
|
309
|
+
choices: [
|
|
310
|
+
{
|
|
311
|
+
name: 'Next.js / React (recommended, uses built-in ChatbotWidget)',
|
|
312
|
+
value: 'react',
|
|
313
|
+
short: 'React'
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
name: 'Angular (use HTTP API from your Angular component)',
|
|
317
|
+
value: 'angular',
|
|
318
|
+
short: 'Angular'
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
name: 'Vue (use HTTP API from your Vue component)',
|
|
322
|
+
value: 'vue',
|
|
323
|
+
short: 'Vue'
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
name: 'Other / Backend-only (no bundled UI, HTTP API only)',
|
|
327
|
+
value: 'other',
|
|
328
|
+
short: 'Other'
|
|
329
|
+
}
|
|
330
|
+
]
|
|
331
|
+
}
|
|
332
|
+
]);
|
|
333
|
+
|
|
334
|
+
// Step 4: Generate configuration files
|
|
335
|
+
console.log(chalk.bold.blue('📝 Step 4: Generating Configuration Files\n'));
|
|
303
336
|
|
|
304
337
|
const spinner = ora('Creating files...').start();
|
|
305
338
|
|
|
@@ -317,6 +350,9 @@ LLM_PROVIDER=${llmAnswers.provider}
|
|
|
317
350
|
LLM_API_KEY=${llmAnswers.apiKey}
|
|
318
351
|
LLM_MODEL=${llmAnswers.model}
|
|
319
352
|
|
|
353
|
+
# Frontend Adapter
|
|
354
|
+
FRONTEND_FRAMEWORK=${frontendAnswers.framework}
|
|
355
|
+
|
|
320
356
|
# Other
|
|
321
357
|
SECRET_KEY=${crypto.randomBytes(32).toString('hex')}
|
|
322
358
|
CHATBOT_ENABLED=true
|
|
@@ -336,6 +372,9 @@ CHATBOT_ENABLED=true
|
|
|
336
372
|
provider: llmAnswers.provider,
|
|
337
373
|
model: llmAnswers.model
|
|
338
374
|
},
|
|
375
|
+
frontend: {
|
|
376
|
+
framework: frontendAnswers.framework
|
|
377
|
+
},
|
|
339
378
|
setupDate: new Date().toISOString(),
|
|
340
379
|
version: '2.0.0'
|
|
341
380
|
};
|
|
@@ -344,44 +383,52 @@ CHATBOT_ENABLED=true
|
|
|
344
383
|
fs.writeFileSync(configPath, JSON.stringify(configContent, null, 2));
|
|
345
384
|
spinner.text = 'Created chatbot-config.json';
|
|
346
385
|
|
|
347
|
-
// Create
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
386
|
+
// Create frontend scaffolding based on selected framework
|
|
387
|
+
if (frontendAnswers.framework === 'react') {
|
|
388
|
+
// Next.js / React: generate app router files
|
|
389
|
+
try {
|
|
390
|
+
const apiDir = path.join(process.cwd(), 'app', 'api', 'chatbot', 'query');
|
|
391
|
+
if (!fs.existsSync(apiDir)) {
|
|
392
|
+
fs.mkdirSync(apiDir, { recursive: true });
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
const apiTemplate = fs.readFileSync(
|
|
396
|
+
path.join(__dirname, '..', 'templates', 'api-route.txt'),
|
|
397
|
+
'utf8'
|
|
398
|
+
);
|
|
399
|
+
|
|
400
|
+
const apiPath = path.join(apiDir, 'route.ts');
|
|
401
|
+
fs.writeFileSync(apiPath, apiTemplate);
|
|
402
|
+
spinner.text = 'Created API route: app/api/chatbot/query/route.ts';
|
|
403
|
+
} catch (error) {
|
|
404
|
+
spinner.warn('Could not create API route automatically');
|
|
405
|
+
console.log(chalk.yellow('\nℹ️ You can manually create the API route later'));
|
|
352
406
|
}
|
|
353
407
|
|
|
354
|
-
|
|
355
|
-
path.join(
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
const apiPath = path.join(apiDir, 'route.ts');
|
|
360
|
-
fs.writeFileSync(apiPath, apiTemplate);
|
|
361
|
-
spinner.text = 'Created API route: app/api/chatbot/query/route.ts';
|
|
362
|
-
} catch (error) {
|
|
363
|
-
spinner.warn('Could not create API route automatically');
|
|
364
|
-
console.log(chalk.yellow('\nℹ️ You can manually create the API route later'));
|
|
365
|
-
}
|
|
408
|
+
try {
|
|
409
|
+
const chatDir = path.join(process.cwd(), 'app', 'chat');
|
|
410
|
+
if (!fs.existsSync(chatDir)) {
|
|
411
|
+
fs.mkdirSync(chatDir, { recursive: true });
|
|
412
|
+
}
|
|
366
413
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
414
|
+
const chatTemplate = fs.readFileSync(
|
|
415
|
+
path.join(__dirname, '..', 'templates', 'chat-page.txt'),
|
|
416
|
+
'utf8'
|
|
417
|
+
);
|
|
418
|
+
|
|
419
|
+
const chatPath = path.join(chatDir, 'page.tsx');
|
|
420
|
+
fs.writeFileSync(chatPath, chatTemplate);
|
|
421
|
+
spinner.text = 'Created chat page: app/chat/page.tsx';
|
|
422
|
+
} catch (error) {
|
|
423
|
+
spinner.warn('Could not create chat page automatically');
|
|
424
|
+
console.log(chalk.yellow('\nℹ️ You can manually create the chat page later'));
|
|
372
425
|
}
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
);
|
|
378
|
-
|
|
379
|
-
const chatPath = path.join(chatDir, 'page.tsx');
|
|
380
|
-
fs.writeFileSync(chatPath, chatTemplate);
|
|
381
|
-
spinner.text = 'Created chat page: app/chat/page.tsx';
|
|
382
|
-
} catch (error) {
|
|
383
|
-
spinner.warn('Could not create chat page automatically');
|
|
384
|
-
console.log(chalk.yellow('\nℹ️ You can manually create the chat page later'));
|
|
426
|
+
} else {
|
|
427
|
+
// Non-React frameworks: keep backend-only scaffolding, user builds UI
|
|
428
|
+
spinner.text = 'Backend configured (HTTP API). Frontend adapter to be implemented in your framework.';
|
|
429
|
+
console.log(chalk.yellow('\nℹ️ Frontend note:'));
|
|
430
|
+
console.log(chalk.gray(' - Use the /api/chatbot/query HTTP endpoint from your Angular/Vue/other component.'));
|
|
431
|
+
console.log(chalk.gray(' - See README for framework-specific adapter guidance.\n'));
|
|
385
432
|
}
|
|
386
433
|
|
|
387
434
|
// Update .gitignore
|
|
@@ -403,8 +450,8 @@ CHATBOT_ENABLED=true
|
|
|
403
450
|
// Success message
|
|
404
451
|
console.log(chalk.green.bold('\n✅ Setup Complete!\n'));
|
|
405
452
|
console.log(chalk.white('Files created:'));
|
|
406
|
-
console.log(chalk.gray(' • .env.chatbot (API keys
|
|
407
|
-
console.log(chalk.gray(' • chatbot-config.json (settings)'));
|
|
453
|
+
console.log(chalk.gray(' • .env.chatbot (API keys, database, LLM, frontend framework)'));
|
|
454
|
+
console.log(chalk.gray(' • chatbot-config.json (settings, including frontend framework)'));
|
|
408
455
|
console.log(chalk.gray(' • .gitignore (updated)\n'));
|
|
409
456
|
|
|
410
457
|
console.log(chalk.white('Database Configuration:'));
|
|
@@ -417,17 +464,41 @@ CHATBOT_ENABLED=true
|
|
|
417
464
|
console.log(chalk.cyan(` • Model: ${llmAnswers.model}`));
|
|
418
465
|
console.log(chalk.gray(` • API Key: ${'*'.repeat(20)}\n`));
|
|
419
466
|
|
|
420
|
-
console.log(chalk.white('
|
|
421
|
-
console.log(chalk.
|
|
422
|
-
console.log(chalk.cyan(' import { ChatbotWidget } from "agenticaichat";'));
|
|
423
|
-
console.log(chalk.cyan(' \n <ChatbotWidget />\n'));
|
|
424
|
-
|
|
425
|
-
console.log(chalk.yellow('2. Or create a full-page chat route:\n'));
|
|
426
|
-
console.log(chalk.cyan(' // app/chat/page.tsx'));
|
|
427
|
-
console.log(chalk.cyan(' <ChatbotWidget fullScreen />\n'));
|
|
467
|
+
console.log(chalk.white('Frontend Framework:'));
|
|
468
|
+
console.log(chalk.cyan(` • Framework: ${frontendAnswers.framework}\n`));
|
|
428
469
|
|
|
429
|
-
console.log(chalk.
|
|
430
|
-
|
|
470
|
+
console.log(chalk.white('Next steps:\n'));
|
|
471
|
+
if (frontendAnswers.framework === 'react') {
|
|
472
|
+
console.log(chalk.yellow('1. Add the widget to your Next.js/React app:\n'));
|
|
473
|
+
console.log(chalk.cyan(' import { ChatbotWidget } from "agenticaichat";'));
|
|
474
|
+
console.log(chalk.cyan(' \n <ChatbotWidget />\n'));
|
|
475
|
+
|
|
476
|
+
console.log(chalk.yellow('2. Or create a full-page chat route:\n'));
|
|
477
|
+
console.log(chalk.cyan(' // app/chat/page.tsx'));
|
|
478
|
+
console.log(chalk.cyan(' <ChatbotWidget fullScreen />\n'));
|
|
479
|
+
|
|
480
|
+
console.log(chalk.yellow('3. Start your development server:\n'));
|
|
481
|
+
console.log(chalk.cyan(' npm run dev\n'));
|
|
482
|
+
} else if (frontendAnswers.framework === 'angular') {
|
|
483
|
+
console.log(chalk.yellow('1. Set up a backend API endpoint (see README for details).\n'));
|
|
484
|
+
console.log(chalk.yellow('2. Create an Angular component like this:\n'));
|
|
485
|
+
console.log(chalk.cyan(' // chatbot.component.ts'));
|
|
486
|
+
console.log(chalk.cyan(' import { HttpClient } from "@angular/common/http";'));
|
|
487
|
+
console.log(chalk.cyan(' // ... component code to POST to /api/chatbot/query\n'));
|
|
488
|
+
console.log(chalk.yellow('3. See README.md for complete Angular setup example.\n'));
|
|
489
|
+
} else if (frontendAnswers.framework === 'vue') {
|
|
490
|
+
console.log(chalk.yellow('1. Set up a backend API endpoint (see README for details).\n'));
|
|
491
|
+
console.log(chalk.yellow('2. Create a Vue component like this:\n'));
|
|
492
|
+
console.log(chalk.cyan(' // Chatbot.vue'));
|
|
493
|
+
console.log(chalk.cyan(' <script setup>'));
|
|
494
|
+
console.log(chalk.cyan(' const response = await fetch("/api/chatbot/query", { ... });'));
|
|
495
|
+
console.log(chalk.cyan(' </script>\n'));
|
|
496
|
+
console.log(chalk.yellow('3. See README.md for complete Vue setup example.\n'));
|
|
497
|
+
} else {
|
|
498
|
+
console.log(chalk.yellow('1. Implement a small adapter/component in your framework that calls:\n'));
|
|
499
|
+
console.log(chalk.cyan(' POST /api/chatbot/query { query: string }\n'));
|
|
500
|
+
console.log(chalk.yellow('2. Use the response to render messages in your UI.\n'));
|
|
501
|
+
}
|
|
431
502
|
|
|
432
503
|
console.log(chalk.white('Need help? Visit: ') + chalk.blue('https://github.com/yourusername/agenticaichat\n'));
|
|
433
504
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Placeholder types and helper for Angular adapters.
|
|
3
|
+
// Angular users should create their own component/service that calls the HTTP API:
|
|
4
|
+
// POST /api/chatbot/query { query: string }
|
|
5
|
+
// and handles the JSON response.
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ChatbotWidget as ReactChatbotWidget } from '../widget';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReactChatbotWidget = void 0;
|
|
4
|
+
// Thin alias so future adapters can share a consistent naming scheme.
|
|
5
|
+
// React users should continue to import from "agenticaichat" directly,
|
|
6
|
+
// but this adapter is exposed for symmetry with Angular/Vue.
|
|
7
|
+
var widget_1 = require("../widget");
|
|
8
|
+
Object.defineProperty(exports, "ReactChatbotWidget", { enumerable: true, get: function () { return widget_1.ChatbotWidget; } });
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Placeholder types and helper for Vue adapters.
|
|
3
|
+
// Vue users should create their own component/composable that calls the HTTP API:
|
|
4
|
+
// POST /api/chatbot/query { query: string }
|
|
5
|
+
// and handles the JSON response.
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { ChatbotWidget } from './widget';
|
|
2
|
+
export { ReactChatbotWidget } from './adapters/react';
|
|
2
3
|
export { ChatbotEngine } from './core/ChatbotEngine';
|
|
3
4
|
export { EngineFactory } from './core/EngineFactory';
|
|
4
5
|
export { DatabaseEngine } from './engines/base/DatabaseEngine';
|
|
@@ -18,3 +19,5 @@ export { TogetherAIProvider } from './llm/providers/TogetherAIProvider';
|
|
|
18
19
|
export { DeepInfraProvider } from './llm/providers/DeepInfraProvider';
|
|
19
20
|
export type { DatabaseCategory, SqlDatabaseType, NoSqlDatabaseType, SupportedDatabaseType, DatabaseConfig, DatabaseSchema, TableSchema, ColumnSchema, LLMConfig, LLMProviderType, ChatMessage, QueryRequest, QueryResponse, QueryResult, EngineStatus, ChatbotConfig } from './types';
|
|
20
21
|
export { Logger, logger } from './utils/logger';
|
|
22
|
+
export * from './adapters/angular';
|
|
23
|
+
export * from './adapters/vue';
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.logger = exports.Logger = exports.DeepInfraProvider = exports.TogetherAIProvider = exports.GrokProvider = exports.ClaudeProvider = exports.GeminiProvider = exports.OpenAIProvider = exports.LLMFactory = exports.MongoEngine = exports.SQLiteDialect = exports.MySQLDialect = exports.PostgresDialect = exports.NoSqlEngine = exports.SqlEngine = exports.DatabaseEngine = exports.EngineFactory = exports.ChatbotEngine = exports.ChatbotWidget = void 0;
|
|
17
|
+
exports.logger = exports.Logger = exports.DeepInfraProvider = exports.TogetherAIProvider = exports.GrokProvider = exports.ClaudeProvider = exports.GeminiProvider = exports.OpenAIProvider = exports.LLMFactory = exports.MongoEngine = exports.SQLiteDialect = exports.MySQLDialect = exports.PostgresDialect = exports.NoSqlEngine = exports.SqlEngine = exports.DatabaseEngine = exports.EngineFactory = exports.ChatbotEngine = exports.ReactChatbotWidget = exports.ChatbotWidget = void 0;
|
|
4
18
|
// ============================================
|
|
5
19
|
// CLIENT-SIDE EXPORTS (Safe for browser)
|
|
6
20
|
// ============================================
|
|
7
21
|
var widget_1 = require("./widget");
|
|
8
22
|
Object.defineProperty(exports, "ChatbotWidget", { enumerable: true, get: function () { return widget_1.ChatbotWidget; } });
|
|
23
|
+
var react_1 = require("./adapters/react");
|
|
24
|
+
Object.defineProperty(exports, "ReactChatbotWidget", { enumerable: true, get: function () { return react_1.ReactChatbotWidget; } });
|
|
9
25
|
// ============================================
|
|
10
26
|
// SERVER-SIDE EXPORTS (Node.js only)
|
|
11
27
|
// ============================================
|
|
@@ -52,3 +68,6 @@ Object.defineProperty(exports, "DeepInfraProvider", { enumerable: true, get: fun
|
|
|
52
68
|
var logger_1 = require("./utils/logger");
|
|
53
69
|
Object.defineProperty(exports, "Logger", { enumerable: true, get: function () { return logger_1.Logger; } });
|
|
54
70
|
Object.defineProperty(exports, "logger", { enumerable: true, get: function () { return logger_1.logger; } });
|
|
71
|
+
// Framework adapter helper types (for Angular/Vue HTTP adapters)
|
|
72
|
+
__exportStar(require("./adapters/angular"), exports);
|
|
73
|
+
__exportStar(require("./adapters/vue"), exports);
|