@wabot-dev/framework 0.1.0-beta.42 → 0.1.0-beta.44
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/dist/src/addon/chat-bot/google/GoogleChatAdapter.js +83 -65
- package/dist/src/addon/chat-bot/openia/OpenaiChatAdapter.js +1 -0
- package/dist/src/addon/chat-bot/pg/PgChatMemory.js +1 -0
- package/dist/src/addon/chat-bot/pg/PgChatRepository.js +1 -0
- package/dist/src/addon/chat-bot/wabot/WabotChatAdapter.js +41 -0
- package/dist/src/addon/chat-controller/cmd/@cmd.js +1 -0
- package/dist/src/addon/chat-controller/socket/@socket.js +1 -0
- package/dist/src/addon/chat-controller/telegram/@telegram.js +1 -0
- package/dist/src/addon/chat-controller/whatsapp/@whatsapp.js +1 -0
- package/dist/src/addon/chat-controller/whatsapp/WhatsAppSender.js +1 -0
- package/dist/src/addon/chat-controller/whatsapp/WhatsAppSenderByCloudApi.js +1 -0
- package/dist/src/addon/chat-controller/whatsapp/WhatsAppSenderByDevConnection.js +1 -0
- package/dist/src/feature/chat-bot/ChatBot.js +22 -3
- package/dist/src/feature/chat-controller/ChatResolver.js +1 -0
- package/dist/src/feature/mindset/IMindset.js +3 -0
- package/dist/src/feature/mindset/MindsetOperator.js +3 -0
- package/dist/src/index.d.ts +23 -6
- package/dist/src/index.js +1 -0
- package/package.json +2 -2
|
@@ -14,109 +14,127 @@ let GoogleChatAdapter = class GoogleChatAdapter {
|
|
|
14
14
|
this.genai = new GoogleGenAI({ apiKey });
|
|
15
15
|
}
|
|
16
16
|
async nextItem(req) {
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
const
|
|
17
|
+
const geminiInput = [];
|
|
18
|
+
geminiInput.push(...this.mapChatItems(req.prevItems, req.systemPrompt));
|
|
19
|
+
const tools = req.tools.map((x) => this.mapTool(x));
|
|
20
|
+
const request = {
|
|
21
|
+
model: req.model,
|
|
22
|
+
contents: geminiInput,
|
|
23
|
+
tools: tools.length > 0 ? tools : undefined,
|
|
24
|
+
};
|
|
20
25
|
this.logger.debug(`Call Gemini API with Request: ${JSON.stringify(request)}`);
|
|
21
26
|
const response = await this.genai.models.generateContent(request);
|
|
22
27
|
return this.mapResponse(response);
|
|
23
28
|
}
|
|
24
|
-
|
|
25
|
-
const
|
|
29
|
+
mapChatItems(chatItems, systemPrompt) {
|
|
30
|
+
const geminiInput = [];
|
|
26
31
|
if (systemPrompt) {
|
|
27
|
-
|
|
32
|
+
geminiInput.push({ role: 'user', parts: [{ text: 'system: ' + systemPrompt }] });
|
|
33
|
+
geminiInput.push({ role: 'model', parts: [{ text: 'I understand.' }] });
|
|
28
34
|
}
|
|
29
|
-
|
|
35
|
+
for (const chatItem of chatItems) {
|
|
30
36
|
switch (chatItem.type) {
|
|
31
37
|
case 'humanMessage':
|
|
32
|
-
this.
|
|
33
|
-
contents.push({ role: 'user', parts: [{ text: chatItem.humanMessage.text }] });
|
|
38
|
+
geminiInput.push(this.mapHumanMessage(chatItem.humanMessage));
|
|
34
39
|
break;
|
|
35
40
|
case 'botMessage':
|
|
36
|
-
this.
|
|
37
|
-
contents.push({ role: 'model', parts: [{ text: chatItem.botMessage.text }] });
|
|
41
|
+
geminiInput.push(this.mapBotMessage(chatItem.botMessage));
|
|
38
42
|
break;
|
|
39
43
|
case 'functionCall':
|
|
40
|
-
|
|
44
|
+
geminiInput.push(...this.mapFunctionCall(chatItem.functionCall));
|
|
41
45
|
break;
|
|
42
46
|
}
|
|
43
|
-
}
|
|
44
|
-
return
|
|
47
|
+
}
|
|
48
|
+
return geminiInput;
|
|
49
|
+
}
|
|
50
|
+
mapHumanMessage(item) {
|
|
51
|
+
if (!item.text) {
|
|
52
|
+
throw new Error('User message content is empty');
|
|
53
|
+
}
|
|
54
|
+
return { role: 'user', parts: [{ text: item.text }] };
|
|
45
55
|
}
|
|
46
|
-
|
|
47
|
-
if (!text) {
|
|
48
|
-
throw new Error(
|
|
56
|
+
mapBotMessage(item) {
|
|
57
|
+
if (!item.text) {
|
|
58
|
+
throw new Error('Bot message content is empty');
|
|
49
59
|
}
|
|
60
|
+
return { role: 'model', parts: [{ text: item.text }] };
|
|
50
61
|
}
|
|
51
62
|
mapFunctionCall(item) {
|
|
52
|
-
const args = JSON.parse(item.arguments || '{}');
|
|
53
63
|
return [
|
|
54
64
|
{
|
|
55
65
|
role: 'model',
|
|
56
|
-
parts: [
|
|
66
|
+
parts: [
|
|
67
|
+
{
|
|
68
|
+
functionCall: {
|
|
69
|
+
name: item.name,
|
|
70
|
+
args: JSON.parse(item.arguments || '{}'),
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
],
|
|
57
74
|
},
|
|
58
75
|
{
|
|
59
76
|
role: 'user',
|
|
60
77
|
parts: [
|
|
61
78
|
{
|
|
62
|
-
functionResponse: {
|
|
79
|
+
functionResponse: {
|
|
80
|
+
name: item.name,
|
|
81
|
+
response: {
|
|
82
|
+
result: item.result || 'No result',
|
|
83
|
+
},
|
|
84
|
+
},
|
|
63
85
|
},
|
|
64
86
|
],
|
|
65
87
|
},
|
|
66
88
|
];
|
|
67
89
|
}
|
|
68
|
-
mapTool
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
90
|
+
mapTool(tool) {
|
|
91
|
+
return {
|
|
92
|
+
functionDeclarations: [
|
|
93
|
+
{
|
|
94
|
+
name: tool.name,
|
|
95
|
+
description: tool.description,
|
|
96
|
+
parameters: {
|
|
97
|
+
type: 'object',
|
|
98
|
+
properties: tool.parameters.reduce((prev, param) => ({
|
|
99
|
+
...prev,
|
|
100
|
+
[param.name]: { type: param.type, description: param.description },
|
|
101
|
+
}), {}),
|
|
102
|
+
required: tool.parameters.map((param) => param.name),
|
|
103
|
+
},
|
|
80
104
|
},
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
105
|
+
],
|
|
106
|
+
};
|
|
107
|
+
}
|
|
84
108
|
mapResponse(response) {
|
|
85
|
-
|
|
109
|
+
let chatItem;
|
|
86
110
|
const part = response.response.candidates[0].content.parts[0];
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
: part.functionCall
|
|
90
|
-
? {
|
|
91
|
-
type: 'functionCall',
|
|
92
|
-
functionCall: {
|
|
93
|
-
id: `gemini_${Date.now()}`,
|
|
94
|
-
name: part.functionCall.name,
|
|
95
|
-
arguments: JSON.stringify(part.functionCall.args || {}),
|
|
96
|
-
},
|
|
97
|
-
}
|
|
98
|
-
: (() => {
|
|
99
|
-
throw new Error('Not supported Gemini Response');
|
|
100
|
-
})();
|
|
101
|
-
const usage = {
|
|
102
|
-
inputTokens: response.response.usageMetadata?.promptTokenCount || 0,
|
|
103
|
-
outputTokens: response.response.usageMetadata?.candidatesTokenCount || 0,
|
|
104
|
-
};
|
|
105
|
-
if (!response.response.usageMetadata) {
|
|
106
|
-
throw new Error('Unable to found usage info');
|
|
111
|
+
if (part.text) {
|
|
112
|
+
chatItem = { type: 'botMessage', botMessage: { text: part.text } };
|
|
107
113
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
114
|
+
else if (part.functionCall) {
|
|
115
|
+
chatItem = {
|
|
116
|
+
type: 'functionCall',
|
|
117
|
+
functionCall: {
|
|
118
|
+
id: `gemini_${Date.now()}`,
|
|
119
|
+
name: part.functionCall.name,
|
|
120
|
+
arguments: JSON.stringify(part.functionCall.args || {}),
|
|
121
|
+
},
|
|
122
|
+
};
|
|
113
123
|
}
|
|
114
|
-
|
|
115
|
-
throw new Error('
|
|
124
|
+
else {
|
|
125
|
+
throw new Error('Not supported Gemini Response');
|
|
116
126
|
}
|
|
117
|
-
|
|
118
|
-
|
|
127
|
+
let usage;
|
|
128
|
+
if (response.response.usageMetadata) {
|
|
129
|
+
usage = {
|
|
130
|
+
inputTokens: response.response.usageMetadata.promptTokenCount || 0,
|
|
131
|
+
outputTokens: response.response.usageMetadata.candidatesTokenCount || 0,
|
|
132
|
+
};
|
|
119
133
|
}
|
|
134
|
+
else {
|
|
135
|
+
throw new Error('Unable to found usage info');
|
|
136
|
+
}
|
|
137
|
+
return { chatItem, usage };
|
|
120
138
|
}
|
|
121
139
|
};
|
|
122
140
|
GoogleChatAdapter = __decorate([
|
|
@@ -4,6 +4,7 @@ import { PgChatMemory } from './PgChatMemory.js';
|
|
|
4
4
|
import { singleton } from '../../../core/injection/index.js';
|
|
5
5
|
import { PgCrudRepository } from '../../repository/pg/PgCrudRepository.js';
|
|
6
6
|
import { Chat } from '../../../feature/chat-bot/Chat.js';
|
|
7
|
+
import '../../../feature/chat-bot/ChatBot.js';
|
|
7
8
|
import 'uuid';
|
|
8
9
|
import '../../../feature/chat-bot/metadata/ChatBotMetadataStore.js';
|
|
9
10
|
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { __decorate, __metadata } from 'tslib';
|
|
2
|
+
import { Env } from '../../../core/env/Env.js';
|
|
3
|
+
import { CustomError } from '../../../core/error/CustomError.js';
|
|
4
|
+
import { singleton } from '../../../core/injection/index.js';
|
|
5
|
+
import { Logger } from '../../../core/logger/Logger.js';
|
|
6
|
+
|
|
7
|
+
let WabotChatAdapter = class WabotChatAdapter {
|
|
8
|
+
apiKey;
|
|
9
|
+
baseUrl;
|
|
10
|
+
logger = new Logger('wabot:wabot-chat-adapter');
|
|
11
|
+
constructor(env) {
|
|
12
|
+
this.apiKey = env.requireString('WABOT_API_KEY');
|
|
13
|
+
this.baseUrl = env.requireString('WABOT_LLM_URL');
|
|
14
|
+
while (this.baseUrl.endsWith('/')) {
|
|
15
|
+
this.baseUrl = this.baseUrl.substring(0, this.baseUrl.length - 1);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
async nextItem(req) {
|
|
19
|
+
const response = await fetch(this.baseUrl + '/chat-bot/next-item', {
|
|
20
|
+
method: 'post',
|
|
21
|
+
headers: {
|
|
22
|
+
Authorization: `Bearer ${this.apiKey}`,
|
|
23
|
+
'Content-Type': 'application/json',
|
|
24
|
+
},
|
|
25
|
+
body: JSON.stringify(req),
|
|
26
|
+
});
|
|
27
|
+
const data = await response.json();
|
|
28
|
+
if (!response.ok) {
|
|
29
|
+
throw new CustomError({
|
|
30
|
+
message: (data?.error && JSON.stringify(data.error)) ?? 'error calling wabot llm api',
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
return data;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
WabotChatAdapter = __decorate([
|
|
37
|
+
singleton(),
|
|
38
|
+
__metadata("design:paramtypes", [Env])
|
|
39
|
+
], WabotChatAdapter);
|
|
40
|
+
|
|
41
|
+
export { WabotChatAdapter };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { container } from '../../../core/injection/index.js';
|
|
2
2
|
import { ControllerMetadataStore } from '../../../feature/chat-controller/metadata/ControllerMetadataStore.js';
|
|
3
3
|
import '../../../feature/chat-controller/ChatResolver.js';
|
|
4
|
+
import '../../../feature/chat-bot/ChatBot.js';
|
|
4
5
|
import 'uuid';
|
|
5
6
|
import '../../../feature/chat-bot/metadata/ChatBotMetadataStore.js';
|
|
6
7
|
import 'reflect-metadata';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { container } from '../../../core/injection/index.js';
|
|
2
2
|
import { ControllerMetadataStore } from '../../../feature/chat-controller/metadata/ControllerMetadataStore.js';
|
|
3
3
|
import '../../../feature/chat-controller/ChatResolver.js';
|
|
4
|
+
import '../../../feature/chat-bot/ChatBot.js';
|
|
4
5
|
import 'uuid';
|
|
5
6
|
import '../../../feature/chat-bot/metadata/ChatBotMetadataStore.js';
|
|
6
7
|
import 'reflect-metadata';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { container } from '../../../core/injection/index.js';
|
|
2
2
|
import { ControllerMetadataStore } from '../../../feature/chat-controller/metadata/ControllerMetadataStore.js';
|
|
3
3
|
import '../../../feature/chat-controller/ChatResolver.js';
|
|
4
|
+
import '../../../feature/chat-bot/ChatBot.js';
|
|
4
5
|
import 'uuid';
|
|
5
6
|
import '../../../feature/chat-bot/metadata/ChatBotMetadataStore.js';
|
|
6
7
|
import 'reflect-metadata';
|
|
@@ -2,6 +2,7 @@ import { container } from '../../../core/injection/index.js';
|
|
|
2
2
|
import { WhatsappChannelConfig } from './WhatsAppChannelConfig.js';
|
|
3
3
|
import { ControllerMetadataStore } from '../../../feature/chat-controller/metadata/ControllerMetadataStore.js';
|
|
4
4
|
import '../../../feature/chat-controller/ChatResolver.js';
|
|
5
|
+
import '../../../feature/chat-bot/ChatBot.js';
|
|
5
6
|
import 'uuid';
|
|
6
7
|
import '../../../feature/chat-bot/metadata/ChatBotMetadataStore.js';
|
|
7
8
|
import 'reflect-metadata';
|
|
@@ -4,6 +4,7 @@ import { WhatsAppSender } from './WhatsAppSender.js';
|
|
|
4
4
|
import { singleton } from '../../../core/injection/index.js';
|
|
5
5
|
import '../../../feature/chat-controller/metadata/ControllerMetadataStore.js';
|
|
6
6
|
import { ChatResolver } from '../../../feature/chat-controller/ChatResolver.js';
|
|
7
|
+
import '../../../feature/chat-bot/ChatBot.js';
|
|
7
8
|
import { ChatRepository } from '../../../feature/chat-bot/ChatRepository.js';
|
|
8
9
|
import 'uuid';
|
|
9
10
|
import '../../../feature/chat-bot/metadata/ChatBotMetadataStore.js';
|
|
@@ -3,6 +3,7 @@ import { WhatsAppSender } from './WhatsAppSender.js';
|
|
|
3
3
|
import { singleton } from '../../../core/injection/index.js';
|
|
4
4
|
import '../../../feature/chat-controller/metadata/ControllerMetadataStore.js';
|
|
5
5
|
import { ChatResolver } from '../../../feature/chat-controller/ChatResolver.js';
|
|
6
|
+
import '../../../feature/chat-bot/ChatBot.js';
|
|
6
7
|
import { ChatRepository } from '../../../feature/chat-bot/ChatRepository.js';
|
|
7
8
|
import 'uuid';
|
|
8
9
|
import '../../../feature/chat-bot/metadata/ChatBotMetadataStore.js';
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
+
import { __decorate, __metadata } from 'tslib';
|
|
2
|
+
import 'reflect-metadata';
|
|
3
|
+
import { injectable } from '../../core/injection/index.js';
|
|
4
|
+
import '../mindset/metadata/MindsetMetadataStore.js';
|
|
5
|
+
import { MindsetOperator } from '../mindset/MindsetOperator.js';
|
|
6
|
+
import { ChatAdapter } from './ChatAdapter.js';
|
|
1
7
|
import { ChatItem } from './ChatItem.js';
|
|
8
|
+
import { ChatMemory } from './ChatMemory.js';
|
|
2
9
|
|
|
3
|
-
class ChatBot {
|
|
10
|
+
let ChatBot = class ChatBot {
|
|
4
11
|
memory;
|
|
5
12
|
adapter;
|
|
6
13
|
mindset;
|
|
@@ -28,8 +35,14 @@ class ChatBot {
|
|
|
28
35
|
}
|
|
29
36
|
const systemPrompt = await this.mindset.systemPrompt();
|
|
30
37
|
const tools = this.mindset.tools();
|
|
38
|
+
const llms = await this.mindset.llms();
|
|
39
|
+
if (llms.length === 0) {
|
|
40
|
+
throw new Error(`Invalid ${this.mindset.constructor.name} - llms not found`);
|
|
41
|
+
}
|
|
42
|
+
const llm = llms[0];
|
|
31
43
|
const { chatItem: newItemData } = await this.adapter.nextItem({
|
|
32
|
-
model:
|
|
44
|
+
model: llm.model,
|
|
45
|
+
provider: llm.provider,
|
|
33
46
|
systemPrompt,
|
|
34
47
|
tools,
|
|
35
48
|
prevItems: prevItems.map((x) => x.getData()),
|
|
@@ -45,6 +58,12 @@ class ChatBot {
|
|
|
45
58
|
}
|
|
46
59
|
this.processLoop(callback);
|
|
47
60
|
}
|
|
48
|
-
}
|
|
61
|
+
};
|
|
62
|
+
ChatBot = __decorate([
|
|
63
|
+
injectable(),
|
|
64
|
+
__metadata("design:paramtypes", [ChatMemory,
|
|
65
|
+
ChatAdapter,
|
|
66
|
+
MindsetOperator])
|
|
67
|
+
], ChatBot);
|
|
49
68
|
|
|
50
69
|
export { ChatBot };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { __decorate, __metadata } from 'tslib';
|
|
2
2
|
import { Chat } from '../chat-bot/Chat.js';
|
|
3
|
+
import '../chat-bot/ChatBot.js';
|
|
3
4
|
import { ChatRepository } from '../chat-bot/ChatRepository.js';
|
|
4
5
|
import { injectable } from '../../core/injection/index.js';
|
|
5
6
|
import 'uuid';
|
package/dist/src/index.d.ts
CHANGED
|
@@ -370,15 +370,21 @@ interface IMindsetIdentity {
|
|
|
370
370
|
personality?: string;
|
|
371
371
|
emotions?: string;
|
|
372
372
|
}
|
|
373
|
+
interface IMindsetLlm {
|
|
374
|
+
provider?: string;
|
|
375
|
+
model: string;
|
|
376
|
+
}
|
|
373
377
|
interface IMindset {
|
|
374
378
|
identity(): Promise<IMindsetIdentity>;
|
|
375
379
|
skills(): Promise<string>;
|
|
376
380
|
limits(): Promise<string>;
|
|
381
|
+
llms(): Promise<IMindsetLlm[]>;
|
|
377
382
|
}
|
|
378
383
|
declare class Mindset implements IMindset {
|
|
379
384
|
identity(): Promise<IMindsetIdentity>;
|
|
380
385
|
skills(): Promise<string>;
|
|
381
386
|
limits(): Promise<string>;
|
|
387
|
+
llms(): Promise<IMindsetLlm[]>;
|
|
382
388
|
}
|
|
383
389
|
|
|
384
390
|
interface IMindsetConfig {
|
|
@@ -487,6 +493,7 @@ declare class MindsetOperator implements IMindset {
|
|
|
487
493
|
identity(): Promise<IMindsetIdentity>;
|
|
488
494
|
skills(): Promise<string>;
|
|
489
495
|
limits(): Promise<string>;
|
|
496
|
+
llms(): Promise<IMindsetLlm[]>;
|
|
490
497
|
systemPrompt(): Promise<string>;
|
|
491
498
|
tools(): IMindsetTool[];
|
|
492
499
|
protected tool(fn: IMindsetFunctionMetadata, module: IMindsetModuleMetadata): IMindsetTool;
|
|
@@ -543,7 +550,9 @@ interface IChatAdapter {
|
|
|
543
550
|
}
|
|
544
551
|
|
|
545
552
|
declare class ChatAdapter implements IChatAdapter {
|
|
546
|
-
nextItem(req: IChatAdapterNextItemReq
|
|
553
|
+
nextItem(req: IChatAdapterNextItemReq & {
|
|
554
|
+
provider?: string;
|
|
555
|
+
}): Promise<IChatAdapterNextItemRes>;
|
|
547
556
|
}
|
|
548
557
|
|
|
549
558
|
type IChatItemData = IEntityData & IChatItem;
|
|
@@ -807,7 +816,7 @@ declare class PgRepositoryBase<P extends Entity<IEntityData>> {
|
|
|
807
816
|
constructor(pool: Pool, config: IPgRepositoryConfig<any>);
|
|
808
817
|
protected values(item: P): (string | number | boolean | Date | null)[];
|
|
809
818
|
protected exec(sql: string, values: any[]): Promise<void>;
|
|
810
|
-
protected query(sql: string, values: any[]): Promise<
|
|
819
|
+
protected query(sql: string, values: any[]): Promise<P[]>;
|
|
811
820
|
protected connect(): Promise<Pool>;
|
|
812
821
|
protected ensureTable(): Promise<void>;
|
|
813
822
|
protected ensureColumns(): Promise<void>;
|
|
@@ -862,12 +871,12 @@ declare class GoogleChatAdapter implements IChatAdapter {
|
|
|
862
871
|
private logger;
|
|
863
872
|
constructor(env: Env);
|
|
864
873
|
nextItem(req: IChatAdapterNextItemReq): Promise<IChatAdapterNextItemRes>;
|
|
865
|
-
private
|
|
866
|
-
private
|
|
874
|
+
private mapChatItems;
|
|
875
|
+
private mapHumanMessage;
|
|
876
|
+
private mapBotMessage;
|
|
867
877
|
private mapFunctionCall;
|
|
868
878
|
private mapTool;
|
|
869
879
|
private mapResponse;
|
|
870
|
-
private validateResponse;
|
|
871
880
|
}
|
|
872
881
|
|
|
873
882
|
declare class OpenaiChatAdapter implements IChatAdapter {
|
|
@@ -910,6 +919,14 @@ declare class RamChatRepository implements IChatRepository {
|
|
|
910
919
|
private getMemory;
|
|
911
920
|
}
|
|
912
921
|
|
|
922
|
+
declare class WabotChatAdapter implements IChatAdapter {
|
|
923
|
+
private apiKey;
|
|
924
|
+
private baseUrl;
|
|
925
|
+
private logger;
|
|
926
|
+
constructor(env: Env);
|
|
927
|
+
nextItem(req: IChatAdapterNextItemReq): Promise<IChatAdapterNextItemRes>;
|
|
928
|
+
}
|
|
929
|
+
|
|
913
930
|
declare function cmd(): (target: object, propertyKey: string | symbol) => void;
|
|
914
931
|
|
|
915
932
|
declare class CmdChannel implements IChatChannel {
|
|
@@ -1334,4 +1351,4 @@ declare class MoneyDto {
|
|
|
1334
1351
|
currency: string;
|
|
1335
1352
|
}
|
|
1336
1353
|
|
|
1337
|
-
export { AnthropicChatAdapter, Async, Auth, Chat, ChatAdapter, ChatBot, ChatBotMetadataStore, ChatItem, ChatMemory, ChatRepository, ChatResolver, CmdChannel, Command, CommandMetadataStore, Container, ControllerMetadataStore, CustomError, DeepSeekChatAdapter, EXPRESS_REQ, EXPRESS_RES, Entity, Env, EnvWhatsAppRepository, ExpressProvider, GoogleChatAdapter, HtmlModule, HttpServerProvider, type IArrayValidationError, type IArrayValidationResult, type IBotMessageItem, type IChannelMessage, type IChannelMetadata, type IChatAdapter, type IChatAdapterNextItemReq, type IChatAdapterNextItemRes, type IChatBot, type IChatBotMetadata, type IChatChannel, type IChatConnection, type IChatControllerMetadata, type IChatData, type IChatItem, type IChatItemData, type IChatItemType, type IChatMemory, type IChatMessage, type IChatRepository, type IChatType, type ICommandConfig, type ICommandHandler, type ICommandHandlerConfig, type IConstructor, type ICrudRepository, type ICustomErrorData, type IEndPointConfig, type IEndPointMetadata, type IEntityData, type IEnvType, type IFunctionCall, type IFunctionCallItem, type IGetWhatsAppTemplateRequest, type IHtmlModuleOptions, type IHumanMessageItem, type IJobData, type IJobEvent, type IJobEventListener, type IJobRepository, type IJwtRefreshTokenData, type ILanguageModelUsage, type IListenWhatsAppMessageRequest, type IMessageContext, type IMessageMetadata, type IMiddleware, type IMiddlewareMetadata, type IMindset, type IMindsetDecoration, type IMindsetFunctionConfig, type IMindsetFunctionDecoration, type IMindsetFunctionMetadata, type IMindsetFunctionParamMetadata, type IMindsetIdentity, type IMindsetMetadata, type IMindsetModuleConfig, type IMindsetModuleDecoration, type IMindsetModuleMetadata, type IMindsetTool, type IMindsetToolParameter, type IModelValidationError, type IModelValidationResult, type IModelValidatorsInfo, type IMoneyData, type IParamConfig, type IParamDecoration, type IPersistentData, type IPgRepositoryConfig, type IPrimitive, type IPropertyValidatorInfo, type IReceivedMessage, type IRestControllerConfig, type IRestControllerMetadata, type ISendWhatsAppRequest, type ISendWhatsAppTemplateRequest, type ISocketChannelConfig, type ISocketChannelReceivedMessage, type IStorableData, type ITelegramChannelConfig, type IValidateArrayOptions, type IValidateArrayOptionsWithItemsValidators, type IValidateMaxOptions, type IValidateMinOptions, type IValidationError, type IValidationResult, type IValidator, type IValidatorMetadata, type IWhatsAppBusinessAccount, type IWhatsAppBusinessNumber, type IWhatsAppContact, type IWhatsAppData, type IWhatsAppMessage, type IWhatsAppMessageListener, type IWhatsAppRepository, type IWhatsAppSenderOptions, type IWhatsAppTemplate, type IWhatsAppTemplateComponent, type IWhatsAppTemplateMessage, type IWhatsAppTemplateParameter, type IWhatsAppTemplateResponse, type IWhatsAppWebhookPayload, type IWhatsappChannelConfig, type IchatControllerConfig, Job, JobRepository, JobRunner, JobsEventsHub, Jwt, JwtAccessAndRefreshTokenDto, JwtConfig, JwtGuardMiddleware, JwtRefreshToken, JwtRefreshTokenRepository, JwtSigner, JwtTokenDto, Lifecycle, Logger, MINDSET_DECORATION_MINDSET, MINDSET_FUNCTION_DECORATION_FUNCTION, MINDSET_MODULE_DECORATION_MODULE, Mapper, Mindset, MindsetMetadataStore, MindsetOperator, Money, MoneyDto, OpenaiChatAdapter, PARAM_DECORATION_IS_OPTIONAL, PARAM_DECORATION_PARAM, Persistent, PgChatMemory, PgChatRepository, PgCrudRepository, PgJobRepository, PgRepositoryBase, PgWhatsAppRepository, RamChatMemory, RamChatRepository, Random, RestControllerMetadataStore, SocketChannel, SocketChannelConfig, SocketServerProvider, Storable, TelegramChannel, TelegramChannelConfig, ValidationMetadataStore, WhatsApp, WhatsAppChannel, WhatsAppReceiver, WhatsAppReceiverByDevConnection, WhatsAppReceiverByWebHook, WhatsAppRepository, WhatsAppSender, WhatsAppSenderByCloudApi, WhatsAppSenderByDevConnection, WhatsappChannelConfig, chatBot, chatController, chatItemTypeOptions, cmd, command, commandHandler, container, get, inject, injectable, isArray, isBoolean, isDate, isModel, isNotEmpty, isNumber, isOptional, isPresent, isString, jwtGuard, max, middleware, min, mindset, mindsetFunction, mindsetModule, modelInfo, param, post, restController, runAsyncCommandHandlers, runChatControllers, runRestControllers, scoped, singleton, socket, telegram, validate, validateArray, validateIsBoolean, validateIsDate, validateIsNotEmpty, validateIsNumber, validateIsPresent, validateIsString, validateMax, validateMin, validateModel, whatsapp };
|
|
1354
|
+
export { AnthropicChatAdapter, Async, Auth, Chat, ChatAdapter, ChatBot, ChatBotMetadataStore, ChatItem, ChatMemory, ChatRepository, ChatResolver, CmdChannel, Command, CommandMetadataStore, Container, ControllerMetadataStore, CustomError, DeepSeekChatAdapter, EXPRESS_REQ, EXPRESS_RES, Entity, Env, EnvWhatsAppRepository, ExpressProvider, GoogleChatAdapter, HtmlModule, HttpServerProvider, type IArrayValidationError, type IArrayValidationResult, type IBotMessageItem, type IChannelMessage, type IChannelMetadata, type IChatAdapter, type IChatAdapterNextItemReq, type IChatAdapterNextItemRes, type IChatBot, type IChatBotMetadata, type IChatChannel, type IChatConnection, type IChatControllerMetadata, type IChatData, type IChatItem, type IChatItemData, type IChatItemType, type IChatMemory, type IChatMessage, type IChatRepository, type IChatType, type ICommandConfig, type ICommandHandler, type ICommandHandlerConfig, type IConstructor, type ICrudRepository, type ICustomErrorData, type IEndPointConfig, type IEndPointMetadata, type IEntityData, type IEnvType, type IFunctionCall, type IFunctionCallItem, type IGetWhatsAppTemplateRequest, type IHtmlModuleOptions, type IHumanMessageItem, type IJobData, type IJobEvent, type IJobEventListener, type IJobRepository, type IJwtRefreshTokenData, type ILanguageModelUsage, type IListenWhatsAppMessageRequest, type IMessageContext, type IMessageMetadata, type IMiddleware, type IMiddlewareMetadata, type IMindset, type IMindsetDecoration, type IMindsetFunctionConfig, type IMindsetFunctionDecoration, type IMindsetFunctionMetadata, type IMindsetFunctionParamMetadata, type IMindsetIdentity, type IMindsetLlm, type IMindsetMetadata, type IMindsetModuleConfig, type IMindsetModuleDecoration, type IMindsetModuleMetadata, type IMindsetTool, type IMindsetToolParameter, type IModelValidationError, type IModelValidationResult, type IModelValidatorsInfo, type IMoneyData, type IParamConfig, type IParamDecoration, type IPersistentData, type IPgRepositoryConfig, type IPrimitive, type IPropertyValidatorInfo, type IReceivedMessage, type IRestControllerConfig, type IRestControllerMetadata, type ISendWhatsAppRequest, type ISendWhatsAppTemplateRequest, type ISocketChannelConfig, type ISocketChannelReceivedMessage, type IStorableData, type ITelegramChannelConfig, type IValidateArrayOptions, type IValidateArrayOptionsWithItemsValidators, type IValidateMaxOptions, type IValidateMinOptions, type IValidationError, type IValidationResult, type IValidator, type IValidatorMetadata, type IWhatsAppBusinessAccount, type IWhatsAppBusinessNumber, type IWhatsAppContact, type IWhatsAppData, type IWhatsAppMessage, type IWhatsAppMessageListener, type IWhatsAppRepository, type IWhatsAppSenderOptions, type IWhatsAppTemplate, type IWhatsAppTemplateComponent, type IWhatsAppTemplateMessage, type IWhatsAppTemplateParameter, type IWhatsAppTemplateResponse, type IWhatsAppWebhookPayload, type IWhatsappChannelConfig, type IchatControllerConfig, Job, JobRepository, JobRunner, JobsEventsHub, Jwt, JwtAccessAndRefreshTokenDto, JwtConfig, JwtGuardMiddleware, JwtRefreshToken, JwtRefreshTokenRepository, JwtSigner, JwtTokenDto, Lifecycle, Logger, MINDSET_DECORATION_MINDSET, MINDSET_FUNCTION_DECORATION_FUNCTION, MINDSET_MODULE_DECORATION_MODULE, Mapper, Mindset, MindsetMetadataStore, MindsetOperator, Money, MoneyDto, OpenaiChatAdapter, PARAM_DECORATION_IS_OPTIONAL, PARAM_DECORATION_PARAM, Persistent, PgChatMemory, PgChatRepository, PgCrudRepository, PgJobRepository, PgRepositoryBase, PgWhatsAppRepository, RamChatMemory, RamChatRepository, Random, RestControllerMetadataStore, SocketChannel, SocketChannelConfig, SocketServerProvider, Storable, TelegramChannel, TelegramChannelConfig, ValidationMetadataStore, WabotChatAdapter, WhatsApp, WhatsAppChannel, WhatsAppReceiver, WhatsAppReceiverByDevConnection, WhatsAppReceiverByWebHook, WhatsAppRepository, WhatsAppSender, WhatsAppSenderByCloudApi, WhatsAppSenderByDevConnection, WhatsappChannelConfig, chatBot, chatController, chatItemTypeOptions, cmd, command, commandHandler, container, get, inject, injectable, isArray, isBoolean, isDate, isModel, isNotEmpty, isNumber, isOptional, isPresent, isString, jwtGuard, max, middleware, min, mindset, mindsetFunction, mindsetModule, modelInfo, param, post, restController, runAsyncCommandHandlers, runChatControllers, runRestControllers, scoped, singleton, socket, telegram, validate, validateArray, validateIsBoolean, validateIsDate, validateIsNotEmpty, validateIsNumber, validateIsPresent, validateIsString, validateMax, validateMin, validateModel, whatsapp };
|
package/dist/src/index.js
CHANGED
|
@@ -69,6 +69,7 @@ export { PgChatRepository } from './addon/chat-bot/pg/PgChatRepository.js';
|
|
|
69
69
|
export { PgChatMemory } from './addon/chat-bot/pg/PgChatMemory.js';
|
|
70
70
|
export { RamChatMemory } from './addon/chat-bot/ram/RamChatMemory.js';
|
|
71
71
|
export { RamChatRepository } from './addon/chat-bot/ram/RamChatRepository.js';
|
|
72
|
+
export { WabotChatAdapter } from './addon/chat-bot/wabot/WabotChatAdapter.js';
|
|
72
73
|
export { cmd } from './addon/chat-controller/cmd/@cmd.js';
|
|
73
74
|
export { CmdChannel } from './addon/chat-controller/cmd/CmdChannel.js';
|
|
74
75
|
export { socket } from './addon/chat-controller/socket/@socket.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wabot-dev/framework",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.44",
|
|
4
4
|
"description": "Framework for IA Chat Bots",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"fmt": "prettier --write .",
|
|
17
17
|
"fmt:check": "prettier --check .",
|
|
18
18
|
"types:check": "tsc --noEmit",
|
|
19
|
-
"elia:dev": "yts --import ./env.mjs ./test/elia/
|
|
19
|
+
"elia:dev": "yts --import ./env.mjs ./test/elia/run.ts"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@rollup/plugin-alias": "5.1.1",
|