@futdevpro/nts-dynamo 1.14.27 → 1.14.28
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/build/_modules/ai/_modules/open-ai/_enums/oai-gpt-message-role.enum.d.ts +0 -17
- package/build/_modules/ai/_modules/open-ai/_enums/oai-gpt-message-role.enum.d.ts.map +1 -1
- package/build/_modules/ai/_modules/open-ai/_enums/oai-gpt-message-role.enum.js +42 -39
- package/build/_modules/ai/_modules/open-ai/_enums/oai-gpt-message-role.enum.js.map +1 -1
- package/build/_modules/ai/_modules/open-ai/_models/interfaces/oai-gpt-message.interface.d.ts +0 -5
- package/build/_modules/ai/_modules/open-ai/_models/interfaces/oai-gpt-message.interface.d.ts.map +1 -1
- package/build/_modules/ai/_modules/open-ai/_models/interfaces/oai-gpt-message.interface.js +6 -2
- package/build/_modules/ai/_modules/open-ai/_models/interfaces/oai-gpt-message.interface.js.map +1 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.d.ts +26 -129
- package/build/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.d.ts.map +1 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.js +25 -10
- package/build/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.js.map +1 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.d.ts +5 -5
- package/build/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.d.ts.map +1 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.js +3 -3
- package/build/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.js.map +1 -1
- package/build/_modules/ai/_modules/open-ai/index.d.ts +0 -2
- package/build/_modules/ai/_modules/open-ai/index.d.ts.map +1 -1
- package/build/_modules/ai/_modules/open-ai/index.js +2 -2
- package/build/_modules/ai/_modules/open-ai/index.js.map +1 -1
- package/build/_modules/bot/_enums/bot-message-provider.enum.d.ts +1 -1
- package/build/_modules/bot/_enums/bot-message-provider.enum.d.ts.map +1 -1
- package/build/_modules/bot/_enums/bot-message-provider.enum.js +9 -9
- package/build/_modules/bot/_enums/bot-message-provider.enum.js.map +1 -1
- package/build/_modules/bot/_models/bot-message-wrapper.interface.d.ts +2 -2
- package/build/_modules/bot/_models/bot-message-wrapper.interface.d.ts.map +1 -1
- package/build/_modules/bot/_models/bot-messaging-provider.interface.d.ts +2 -2
- package/build/_modules/bot/_models/bot-messaging-provider.interface.d.ts.map +1 -1
- package/build/_modules/bot/_modules/discord-bot/_services/dib-messaging-provider.service.js +1 -1
- package/build/_modules/bot/_modules/discord-bot/_services/dib-messaging-provider.service.js.map +1 -1
- package/build/_modules/bot/_modules/dynamo-bot/_services/dyb-messaging-provider.service.js +1 -1
- package/build/_modules/bot/_modules/dynamo-bot/_services/dyb-messaging-provider.service.js.map +1 -1
- package/build/_modules/bot/_modules/slack-bot/_services/slb-messaging-provider.service.js +1 -1
- package/build/_modules/bot/_modules/slack-bot/_services/slb-messaging-provider.service.js.map +1 -1
- package/build/_modules/bot/_modules/teams-bot/_services/teb-messaging-provider.service.js +1 -1
- package/build/_modules/bot/_modules/teams-bot/_services/teb-messaging-provider.service.js.map +1 -1
- package/build/_modules/bot/_services/bot-messaging-provider-factory.service.js +5 -5
- package/build/_modules/bot/_services/bot-messaging-provider-factory.service.js.map +1 -1
- package/build/_modules/discord-assistant/_collections/dias.util.d.ts +3 -3
- package/build/_modules/discord-assistant/_collections/dias.util.d.ts.map +1 -1
- package/build/_modules/discord-assistant/_collections/dias.util.js +4 -4
- package/build/_modules/discord-assistant/_collections/dias.util.js.map +1 -1
- package/build/_modules/discord-assistant/_services/dias-chunk.data-service.d.ts +4 -4
- package/build/_modules/discord-assistant/_services/dias-chunk.data-service.d.ts.map +1 -1
- package/build/_modules/discord-assistant/_services/dias-chunk.data-service.js.map +1 -1
- package/build/_modules/discord-assistant/_services/dias.service-base.d.ts +2 -2
- package/build/_modules/discord-assistant/_services/dias.service-base.d.ts.map +1 -1
- package/build/_modules/discord-assistant/_services/dias.service-base.js.map +1 -1
- package/package.json +1 -1
- package/src/_modules/ai/_modules/open-ai/_enums/oai-gpt-message-role.enum.ts +42 -42
- package/src/_modules/ai/_modules/open-ai/_models/interfaces/oai-gpt-message.interface.ts +6 -6
- package/src/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.ts +56 -158
- package/src/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.ts +8 -9
- package/src/_modules/ai/_modules/open-ai/index.ts +2 -2
- package/src/_modules/bot/_enums/bot-message-provider.enum.ts +1 -1
- package/src/_modules/bot/_models/bot-message-wrapper.interface.ts +4 -3
- package/src/_modules/bot/_models/bot-messaging-provider.interface.ts +2 -2
- package/src/_modules/bot/_modules/discord-bot/_services/dib-messaging-provider.service.ts +2 -2
- package/src/_modules/bot/_modules/dynamo-bot/_services/dyb-messaging-provider.service.ts +2 -2
- package/src/_modules/bot/_modules/slack-bot/_services/slb-messaging-provider.service.ts +2 -2
- package/src/_modules/bot/_modules/teams-bot/_services/teb-messaging-provider.service.ts +2 -2
- package/src/_modules/bot/_services/bot-messaging-provider-factory.service.ts +6 -6
- package/src/_modules/discord-assistant/_collections/dias.util.ts +6 -7
- package/src/_modules/discord-assistant/_services/dias-chunk.data-service.ts +5 -5
- package/src/_modules/discord-assistant/_services/dias-io.control-service.ts +2 -2
- package/src/_modules/discord-assistant/_services/dias.service-base.ts +2 -3
- package/build/_modules/ai/_services/oai-to-ai-adapter.service.d.ts +0 -39
- package/build/_modules/ai/_services/oai-to-ai-adapter.service.d.ts.map +0 -1
- package/build/_modules/ai/_services/oai-to-ai-adapter.service.js +0 -218
- package/build/_modules/ai/_services/oai-to-ai-adapter.service.js.map +0 -1
- package/build/_modules/bot/_enums/bot-provider.enum.d.ts +0 -8
- package/build/_modules/bot/_enums/bot-provider.enum.d.ts.map +0 -1
- package/build/_modules/bot/_enums/bot-provider.enum.js +0 -12
- package/build/_modules/bot/_enums/bot-provider.enum.js.map +0 -1
- package/build/_modules/bot/_models/bot-provider.interface.d.ts +0 -65
- package/build/_modules/bot/_models/bot-provider.interface.d.ts.map +0 -1
- package/build/_modules/bot/_models/bot-provider.interface.js +0 -3
- package/build/_modules/bot/_models/bot-provider.interface.js.map +0 -1
- package/build/_modules/bot/_modules/discord-bot/_services/dib-provider.service.d.ts +0 -53
- package/build/_modules/bot/_modules/discord-bot/_services/dib-provider.service.d.ts.map +0 -1
- package/build/_modules/bot/_modules/discord-bot/_services/dib-provider.service.js +0 -369
- package/build/_modules/bot/_modules/discord-bot/_services/dib-provider.service.js.map +0 -1
- package/build/_modules/bot/_modules/dynamo-bot/_services/dyb-provider.service.d.ts +0 -54
- package/build/_modules/bot/_modules/dynamo-bot/_services/dyb-provider.service.d.ts.map +0 -1
- package/build/_modules/bot/_modules/dynamo-bot/_services/dyb-provider.service.js +0 -310
- package/build/_modules/bot/_modules/dynamo-bot/_services/dyb-provider.service.js.map +0 -1
- package/build/_modules/bot/_modules/slack-bot/_services/slb-provider.service.d.ts +0 -40
- package/build/_modules/bot/_modules/slack-bot/_services/slb-provider.service.d.ts.map +0 -1
- package/build/_modules/bot/_modules/slack-bot/_services/slb-provider.service.js +0 -116
- package/build/_modules/bot/_modules/slack-bot/_services/slb-provider.service.js.map +0 -1
- package/build/_modules/bot/_modules/teams-bot/_services/teb-provider.service.d.ts +0 -40
- package/build/_modules/bot/_modules/teams-bot/_services/teb-provider.service.d.ts.map +0 -1
- package/build/_modules/bot/_modules/teams-bot/_services/teb-provider.service.js +0 -116
- package/build/_modules/bot/_modules/teams-bot/_services/teb-provider.service.js.map +0 -1
- package/build/_modules/bot/_services/bot-provider-factory.service.d.ts +0 -5
- package/build/_modules/bot/_services/bot-provider-factory.service.d.ts.map +0 -1
- package/build/_modules/bot/_services/bot-provider-factory.service.js +0 -31
- package/build/_modules/bot/_services/bot-provider-factory.service.js.map +0 -1
|
@@ -3,13 +3,13 @@ import { DyNTS_Bot_Channel } from './bot-channel.interface';
|
|
|
3
3
|
import { DyNTS_Bot_User } from './bot-user.interface';
|
|
4
4
|
import { DyNTS_Bot_LastMessageDate } from './bot-last-message-date.interface';
|
|
5
5
|
import { DyNTS_Bot_LastMentionDate } from './bot-last-mention-date.interface';
|
|
6
|
-
import {
|
|
6
|
+
import { DyNTS_Bot_MessagingProvider_Type } from '../_enums/bot-message-provider.enum';
|
|
7
7
|
import { DyNTS_Bot_Global_Settings } from './bot-global-settings.interface';
|
|
8
8
|
|
|
9
9
|
export interface DyNTS_Bot_MessagingProvider_Config extends DyNTS_Bot_Global_Settings {
|
|
10
10
|
/** Unique identifier for this provider instance (required when using multiple providers) */
|
|
11
11
|
providerId?: string;
|
|
12
|
-
messageProvider:
|
|
12
|
+
messageProvider: DyNTS_Bot_MessagingProvider_Type;
|
|
13
13
|
messageProviderInstance?: DyNTS_Bot_MessagingProvider;
|
|
14
14
|
discord?: {
|
|
15
15
|
token: string;
|
|
@@ -3,7 +3,7 @@ import { DyFM_Error, DyFM_Log } from '@futdevpro/fsm-dynamo';
|
|
|
3
3
|
import { DyNTS_Bot_MessagingProvider, DyNTS_Bot_MessagingProvider_Config } from '../../../_models/bot-messaging-provider.interface';
|
|
4
4
|
import { DyNTS_Bot_LastMessageDate } from '../../../_models/bot-last-message-date.interface';
|
|
5
5
|
import { DyNTS_Bot_LastMentionDate } from '../../../_models/bot-last-mention-date.interface';
|
|
6
|
-
import {
|
|
6
|
+
import { DyNTS_Bot_MessagingProvider_Type } from '../../../_enums/bot-message-provider.enum';
|
|
7
7
|
import { DyNTS_DiB_Message, DyNTS_DiB_Channel, DyNTS_DiB_User } from '../_models/dib-platform.types';
|
|
8
8
|
import { DyNTS_global_settings } from '../../../../../_collections/global-settings.const';
|
|
9
9
|
|
|
@@ -41,7 +41,7 @@ export class DyNTS_DiB_MessagingProvider implements DyNTS_Bot_MessagingProvider<
|
|
|
41
41
|
async initialize(config: DyNTS_Bot_MessagingProvider_Config): Promise<void> {
|
|
42
42
|
this.config = config;
|
|
43
43
|
|
|
44
|
-
if (config.messageProvider !==
|
|
44
|
+
if (config.messageProvider !== DyNTS_Bot_MessagingProvider_Type.discord) {
|
|
45
45
|
throw new Error(`Invalid provider type: ${config.messageProvider}. Expected 'discord'`);
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -2,7 +2,7 @@ import { DyFM_Error, DyFM_Log, week } from '@futdevpro/fsm-dynamo';
|
|
|
2
2
|
import { DyNTS_Bot_MessagingProvider, DyNTS_Bot_MessagingProvider_Config } from '../../../_models/bot-messaging-provider.interface';
|
|
3
3
|
import { DyNTS_Bot_LastMessageDate } from '../../../_models/bot-last-message-date.interface';
|
|
4
4
|
import { DyNTS_Bot_LastMentionDate } from '../../../_models/bot-last-mention-date.interface';
|
|
5
|
-
import {
|
|
5
|
+
import { DyNTS_Bot_MessagingProvider_Type } from '../../../_enums/bot-message-provider.enum';
|
|
6
6
|
import { DyNTS_DyB_Message, DyNTS_DyB_Channel, DyNTS_DyB_User } from '../_models/dyb-platform.types';
|
|
7
7
|
import { DyNTS_global_settings } from '../../../../../_collections/global-settings.const';
|
|
8
8
|
import { DyNTS_Msg_Main_ControlService } from '../../../../messaging/_services/msg-main.control-service';
|
|
@@ -40,7 +40,7 @@ export class DyNTS_DyB_MessagingProvider implements DyNTS_Bot_MessagingProvider<
|
|
|
40
40
|
async initialize(config: DyNTS_Bot_MessagingProvider_Config): Promise<void> {
|
|
41
41
|
this.config = config;
|
|
42
42
|
|
|
43
|
-
if (config.messageProvider !==
|
|
43
|
+
if (config.messageProvider !== DyNTS_Bot_MessagingProvider_Type.dynamo) {
|
|
44
44
|
throw new Error(`Invalid provider type: ${config.messageProvider}. Expected 'dynamo'`);
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DyNTS_Bot_MessagingProvider, DyNTS_Bot_MessagingProvider_Config } from '../../../_models/bot-messaging-provider.interface';
|
|
2
2
|
import { DyNTS_Bot_LastMessageDate } from '../../../_models/bot-last-message-date.interface';
|
|
3
3
|
import { DyNTS_Bot_LastMentionDate } from '../../../_models/bot-last-mention-date.interface';
|
|
4
|
-
import {
|
|
4
|
+
import { DyNTS_Bot_MessagingProvider_Type } from '../../../_enums/bot-message-provider.enum';
|
|
5
5
|
import { DyNTS_SlB_Message, DyNTS_SlB_Channel, DyNTS_SlB_User } from '../_models/slb-platform.types';
|
|
6
6
|
|
|
7
7
|
export class DyNTS_SlB_MessagingProvider implements DyNTS_Bot_MessagingProvider<
|
|
@@ -20,7 +20,7 @@ export class DyNTS_SlB_MessagingProvider implements DyNTS_Bot_MessagingProvider<
|
|
|
20
20
|
async initialize(config: DyNTS_Bot_MessagingProvider_Config): Promise<void> {
|
|
21
21
|
this.config = config;
|
|
22
22
|
|
|
23
|
-
if (config.messageProvider !==
|
|
23
|
+
if (config.messageProvider !== DyNTS_Bot_MessagingProvider_Type.slack) {
|
|
24
24
|
throw new Error(`Invalid provider type: ${config.messageProvider}. Expected 'slack'`);
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DyNTS_Bot_MessagingProvider, DyNTS_Bot_MessagingProvider_Config } from '../../../_models/bot-messaging-provider.interface';
|
|
2
2
|
import { DyNTS_Bot_LastMessageDate } from '../../../_models/bot-last-message-date.interface';
|
|
3
3
|
import { DyNTS_Bot_LastMentionDate } from '../../../_models/bot-last-mention-date.interface';
|
|
4
|
-
import {
|
|
4
|
+
import { DyNTS_Bot_MessagingProvider_Type } from '../../../_enums/bot-message-provider.enum';
|
|
5
5
|
import { DyNTS_TeB_Message, DyNTS_TeB_Channel, DyNTS_TeB_User } from '../_models/teb-platform.types';
|
|
6
6
|
|
|
7
7
|
export class DyNTS_TeB_MessagingProvider implements DyNTS_Bot_MessagingProvider<
|
|
@@ -20,7 +20,7 @@ export class DyNTS_TeB_MessagingProvider implements DyNTS_Bot_MessagingProvider<
|
|
|
20
20
|
async initialize(config: DyNTS_Bot_MessagingProvider_Config): Promise<void> {
|
|
21
21
|
this.config = config;
|
|
22
22
|
|
|
23
|
-
if (config.messageProvider !==
|
|
23
|
+
if (config.messageProvider !== DyNTS_Bot_MessagingProvider_Type.teams) {
|
|
24
24
|
throw new Error(`Invalid provider type: ${config.messageProvider}. Expected 'teams'`);
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DyNTS_Bot_MessagingProvider, DyNTS_Bot_MessagingProvider_Config } from '../_models/bot-messaging-provider.interface';
|
|
2
|
-
import {
|
|
2
|
+
import { DyNTS_Bot_MessagingProvider_Type } from '../_enums/bot-message-provider.enum';
|
|
3
3
|
import { DyNTS_DiB_MessagingProvider } from '../_modules/discord-bot/_services/dib-messaging-provider.service';
|
|
4
4
|
import { DyNTS_SlB_MessagingProvider } from '../_modules/slack-bot/_services/slb-messaging-provider.service';
|
|
5
5
|
import { DyNTS_TeB_MessagingProvider } from '../_modules/teams-bot/_services/teb-messaging-provider.service';
|
|
@@ -9,19 +9,19 @@ export class DyNTS_Bot_MessagingProvider_Factory {
|
|
|
9
9
|
|
|
10
10
|
static createProvider(config: DyNTS_Bot_MessagingProvider_Config): DyNTS_Bot_MessagingProvider {
|
|
11
11
|
switch (config.messageProvider) {
|
|
12
|
-
case
|
|
12
|
+
case DyNTS_Bot_MessagingProvider_Type.discord:
|
|
13
13
|
return new DyNTS_DiB_MessagingProvider();
|
|
14
14
|
|
|
15
|
-
case
|
|
15
|
+
case DyNTS_Bot_MessagingProvider_Type.slack:
|
|
16
16
|
return new DyNTS_SlB_MessagingProvider();
|
|
17
17
|
|
|
18
|
-
case
|
|
18
|
+
case DyNTS_Bot_MessagingProvider_Type.teams:
|
|
19
19
|
return new DyNTS_TeB_MessagingProvider();
|
|
20
20
|
|
|
21
|
-
case
|
|
21
|
+
case DyNTS_Bot_MessagingProvider_Type.dynamo:
|
|
22
22
|
return new DyNTS_DyB_MessagingProvider();
|
|
23
23
|
|
|
24
|
-
case
|
|
24
|
+
case DyNTS_Bot_MessagingProvider_Type.custom:
|
|
25
25
|
if (!config.messageProviderInstance) {
|
|
26
26
|
throw new Error('Custom provider instance is required when provider type is "custom"');
|
|
27
27
|
}
|
|
@@ -2,9 +2,8 @@ import { Message, TextChannel } from 'discord.js';
|
|
|
2
2
|
|
|
3
3
|
import { DyFM_Error } from '@futdevpro/fsm-dynamo';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { DyFM_AI_Message, DyFM_AI_MessageRole } from '@futdevpro/fsm-dynamo/ai';
|
|
6
6
|
import { DyNTS_DiAs_global_settings } from './dias-global-settings.const';
|
|
7
|
-
import { DyNTS_OAI_GPT_Message_Role } from '../../ai/_modules/open-ai/_enums/oai-gpt-message-role.enum';
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
export class DyNTS_DiAs_Util {
|
|
@@ -16,7 +15,7 @@ export class DyNTS_DiAs_Util {
|
|
|
16
15
|
botDisplayName: string,
|
|
17
16
|
issuer: string,
|
|
18
17
|
}
|
|
19
|
-
):
|
|
18
|
+
): DyFM_AI_Message[] {
|
|
20
19
|
|
|
21
20
|
return set.messages.map(message => {
|
|
22
21
|
if (
|
|
@@ -29,18 +28,18 @@ export class DyNTS_DiAs_Util {
|
|
|
29
28
|
flag => message.content.includes(flag)
|
|
30
29
|
)) {
|
|
31
30
|
return {
|
|
32
|
-
role:
|
|
31
|
+
role: DyFM_AI_MessageRole.user,
|
|
33
32
|
content: message.content,
|
|
34
33
|
};
|
|
35
34
|
} else {
|
|
36
35
|
return {
|
|
37
|
-
role:
|
|
36
|
+
role: DyFM_AI_MessageRole.assistant,
|
|
38
37
|
content: message.content,
|
|
39
38
|
};
|
|
40
39
|
}
|
|
41
40
|
} else {
|
|
42
41
|
return {
|
|
43
|
-
role:
|
|
42
|
+
role: DyFM_AI_MessageRole.user,
|
|
44
43
|
content: message.content,
|
|
45
44
|
};
|
|
46
45
|
}
|
|
@@ -55,7 +54,7 @@ export class DyNTS_DiAs_Util {
|
|
|
55
54
|
issuer: string,
|
|
56
55
|
skipFlags?: string[],
|
|
57
56
|
}
|
|
58
|
-
): Promise<
|
|
57
|
+
): Promise<DyFM_AI_Message[]> {
|
|
59
58
|
const messages: Message[] = await this.gatherMessagesForMessage(set/* message, botClientId, issuer, skipFlags */);
|
|
60
59
|
|
|
61
60
|
return DyNTS_DiAs_Util.convertDiscordMessagesToOAIConversation({
|
|
@@ -8,7 +8,7 @@ import { DyFM_DataModel_Params, DyFM_Error, DyFM_Log } from '@futdevpro/fsm-dyna
|
|
|
8
8
|
// import { DyFM_OAI_Model } from '@futdevpro/fsm-dynamo';
|
|
9
9
|
import { DyNTS_DiAs_Main_ControlService } from './dias-main.control-service';
|
|
10
10
|
import { DyNTS_AI_LLMChat_ServiceBase } from '../../ai/_services/ai-llm-chat.service-base';
|
|
11
|
-
import {
|
|
11
|
+
import { DyFM_AI_Message } from '@futdevpro/fsm-dynamo/ai';
|
|
12
12
|
import { DyNTS_OAI_LLMDefaultPredefined_Requests } from '../../ai/_modules/open-ai/_collections/oai-llm-predefined-requests.conts';
|
|
13
13
|
import { DyNTS_DAI_Document_Util } from '../../ai/_modules/document-ai/_collections/dai-document.util';
|
|
14
14
|
import { DyNTS_DAI_DocPage } from '../../ai/_modules/document-ai/_models/data-models/dai-doc-page.data-model';
|
|
@@ -54,7 +54,7 @@ export abstract class DyNTS_DiAs_Chunk_DataService<
|
|
|
54
54
|
/* abstract getPageLink(page: T_Page): string; */
|
|
55
55
|
|
|
56
56
|
async resolveConversation(
|
|
57
|
-
conversation:
|
|
57
|
+
conversation: DyFM_AI_Message[],
|
|
58
58
|
limit: number = 10,
|
|
59
59
|
numberOfCandidates: number = 200,
|
|
60
60
|
): Promise<string> {
|
|
@@ -96,7 +96,7 @@ export abstract class DyNTS_DiAs_Chunk_DataService<
|
|
|
96
96
|
// add code overview by coding policies
|
|
97
97
|
// (Milyen jellegű coding policies lehet releváns az adott kérdésben)
|
|
98
98
|
async vectorSearchAndResolveConversation(
|
|
99
|
-
conversation:
|
|
99
|
+
conversation: DyFM_AI_Message[],
|
|
100
100
|
limit: number = 3,
|
|
101
101
|
numberOfCandidates: number = 100,
|
|
102
102
|
): Promise<string> {
|
|
@@ -139,12 +139,12 @@ export abstract class DyNTS_DiAs_Chunk_DataService<
|
|
|
139
139
|
|
|
140
140
|
// TODO: EZT KELL HÍVNI PARANCSRA
|
|
141
141
|
async vectorSearchUsingConversation(
|
|
142
|
-
conversation:
|
|
142
|
+
conversation: DyFM_AI_Message[],
|
|
143
143
|
limit: number = 3,
|
|
144
144
|
numberOfCandidates: number = 100,
|
|
145
145
|
): Promise<T_Chunk[]> {
|
|
146
146
|
try {
|
|
147
|
-
const lastMessage:
|
|
147
|
+
const lastMessage: DyFM_AI_Message = conversation[conversation.length - 1];
|
|
148
148
|
|
|
149
149
|
const searchQuestion: string = await this.llmChat_CS.getAnswerInConversation({
|
|
150
150
|
conversation: conversation,
|
|
@@ -8,7 +8,7 @@ import { DyNTS_DiBo_IO_ControlService } from '../../discord-bot/_services/dibo-i
|
|
|
8
8
|
import { DyNTS_DiAs_Main_ControlService } from './dias-main.control-service'
|
|
9
9
|
import { DyNTS_DiBo_global_settings } from '../../discord-bot/_collections/dibo-global-settings.conts'
|
|
10
10
|
import { DyNTS_OAI_LLMChat_ServiceBase } from '../../ai/_modules/open-ai/_services/oai-llm-chat.service-base'
|
|
11
|
-
import {
|
|
11
|
+
import { DyFM_AI_Message } from '@futdevpro/fsm-dynamo/ai';
|
|
12
12
|
import { DyNTS_DiAs_Util } from '../_collections/dias.util'
|
|
13
13
|
|
|
14
14
|
export abstract class DyNTS_DiAs_IO_ControlService extends DyNTS_DiBo_IO_ControlService {
|
|
@@ -31,7 +31,7 @@ export abstract class DyNTS_DiAs_IO_ControlService extends DyNTS_DiBo_IO_Control
|
|
|
31
31
|
override async handleMessage(message: Message, issuer: string): Promise<Message> {
|
|
32
32
|
try {
|
|
33
33
|
const messages: Message[] = await this.mainDiscordBot_CS.gatherDiscordMessagesForMessage(message);
|
|
34
|
-
const oaiMessages:
|
|
34
|
+
const oaiMessages: DyFM_AI_Message[] =
|
|
35
35
|
DyNTS_DiAs_Util.convertDiscordMessagesToOAIConversation({
|
|
36
36
|
messages: messages,
|
|
37
37
|
botClientId: this.mainDiscordBot_CS.botClientId,
|
|
@@ -5,8 +5,7 @@ import { Client, Guild, Message, TextChannel } from 'discord.js';
|
|
|
5
5
|
import { DyNTS_DiBo_Main_ControlService } from '../../discord-bot/_services/dibo-main.control-service';
|
|
6
6
|
import { DyNTS_DiAs_global_settings } from '../_collections/dias-global-settings.const';
|
|
7
7
|
import { DyNTS_global_settings } from '../../../_collections/global-settings.const';
|
|
8
|
-
import {
|
|
9
|
-
import { DyNTS_OAI_GPT_Message_Role } from '../../ai/_modules/open-ai/_enums/oai-gpt-message-role.enum';
|
|
8
|
+
import { DyFM_AI_Message } from '@futdevpro/fsm-dynamo/ai';
|
|
10
9
|
import { DyNTS_DiAs_Util } from '../_collections/dias.util';
|
|
11
10
|
import { DyNTS_DiAs_IO_ControlService } from './dias-io.control-service';
|
|
12
11
|
|
|
@@ -65,7 +64,7 @@ export abstract class DyNTS_DiAs_ServiceBase extends DyNTS_DiBo_Main_ControlServ
|
|
|
65
64
|
async gatherMessagesAsOAIConversation(
|
|
66
65
|
message: Message,
|
|
67
66
|
issuer: string,
|
|
68
|
-
): Promise<
|
|
67
|
+
): Promise<DyFM_AI_Message[]> {
|
|
69
68
|
const messages: Message[] = await this.gatherDiscordMessagesForMessage(message);
|
|
70
69
|
|
|
71
70
|
return DyNTS_DiAs_Util.convertDiscordMessagesToOAIConversation({
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { DyNTS_AI_LLMChat_ServiceBase } from './ai-llm-chat.service-base';
|
|
2
|
-
import { DyFM_AI_Message } from '@futdevpro/fsm-dynamo/ai';
|
|
3
|
-
import { DyFM_AI_ConversationQuestion_Input, DyFM_AI_ConversationSelect_Input, DyFM_AI_ConversationGenericSelect_Input, DyFM_AI_ConversationMultiSelect_Input, DyFM_AI_ConversationGenericMultiSelect_Input, DyFM_AI_ConversationJSONKeysDescription_Input, DyFM_AI_ConversationJSONExactKeys_Input, DyFM_AI_ConversationGetAnswer_Input } from '../_models/ai-input-interfaces';
|
|
4
|
-
import { DyNTS_OAI_LLMChat_ServiceBase } from '../open-ai/_services/oai-llm-chat.service-base';
|
|
5
|
-
/**
|
|
6
|
-
* Adapter to make DyNTS_OAI_LLMChat_ServiceBase compatible with DyNTS_AI_LLMChat_ServiceBase
|
|
7
|
-
* This bridges the OpenAI-specific implementation with the generic AI interface
|
|
8
|
-
*/
|
|
9
|
-
export declare class DyNTS_OAI_To_AI_Adapter extends DyNTS_AI_LLMChat_ServiceBase {
|
|
10
|
-
private oaiService;
|
|
11
|
-
private conversationHistory;
|
|
12
|
-
constructor(oaiService: DyNTS_OAI_LLMChat_ServiceBase);
|
|
13
|
-
addMessageToHistory(message: DyFM_AI_Message, issuer: string): void;
|
|
14
|
-
clearHistory(issuer: string): void;
|
|
15
|
-
getHistory(issuer: string): DyFM_AI_Message[];
|
|
16
|
-
private convertAIToOAIMessage;
|
|
17
|
-
private convertOAIToAIMessage;
|
|
18
|
-
private convertAIToOAI;
|
|
19
|
-
yesNoQuestionInConversation(set: DyFM_AI_ConversationQuestion_Input): Promise<boolean>;
|
|
20
|
-
simpleQuestionInConversation(set: DyFM_AI_ConversationQuestion_Input): Promise<string>;
|
|
21
|
-
percentageQuestionInConversation(set: DyFM_AI_ConversationQuestion_Input): Promise<number>;
|
|
22
|
-
selectQuestionInConversation(set: DyFM_AI_ConversationSelect_Input): Promise<string>;
|
|
23
|
-
requestSelectInConversation<T>(set: DyFM_AI_ConversationGenericSelect_Input<T>): Promise<T | {
|
|
24
|
-
unparsableResult: string;
|
|
25
|
-
}>;
|
|
26
|
-
multipleSelectQuestionInConversationWithOptions(set: DyFM_AI_ConversationMultiSelect_Input): Promise<string[]>;
|
|
27
|
-
requestMultiselectInConversation<T>(set: DyFM_AI_ConversationGenericMultiSelect_Input<T>): Promise<T[]>;
|
|
28
|
-
JSONQuestionInConversationWithKeysDescription(set: DyFM_AI_ConversationJSONKeysDescription_Input): Promise<object>;
|
|
29
|
-
JSONQuestionInConversationWithExactKeys(set: DyFM_AI_ConversationJSONExactKeys_Input): Promise<object>;
|
|
30
|
-
requestJSONInConversationWithExactKeys<T>(set: DyFM_AI_ConversationJSONExactKeys_Input): Promise<T>;
|
|
31
|
-
getQuestionAnswerInConversation(set: DyFM_AI_ConversationQuestion_Input): Promise<string>;
|
|
32
|
-
getAnswerInConversation(set: DyFM_AI_ConversationGetAnswer_Input): Promise<string>;
|
|
33
|
-
get defaultSettings(): any;
|
|
34
|
-
askQuestion(set: any): Promise<string>;
|
|
35
|
-
jsonQuestionInConversation<T = any>(set: any): Promise<T | {
|
|
36
|
-
unparsableResult: string;
|
|
37
|
-
}>;
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=oai-to-ai-adapter.service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"oai-to-ai-adapter.service.d.ts","sourceRoot":"","sources":["../../../../src/_modules/ai/_services/oai-to-ai-adapter.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAuB,MAAM,0BAA0B,CAAC;AAChF,OAAO,EACL,kCAAkC,EAClC,gCAAgC,EAChC,uCAAuC,EACvC,qCAAqC,EACrC,4CAA4C,EAC5C,6CAA6C,EAC7C,uCAAuC,EACvC,mCAAmC,EACpC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,6BAA6B,EAAE,MAAM,gDAAgD,CAAC;AAG/F;;;GAGG;AACH,qBAAa,uBAAwB,SAAQ,4BAA4B;IACvE,OAAO,CAAC,UAAU,CAAgC;IAClD,OAAO,CAAC,mBAAmB,CAA6C;gBAE5D,UAAU,EAAE,6BAA6B;IAKrD,mBAAmB,CAAC,OAA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AAI,eAAe,QAElB;IAED,WAAW,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;IAItC,0BAA0B,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,CAAC,GAAG;QAAE,gBAAgB,EAAE,MAAM,CAAA;KAAE,CAAC;CAGzF"}
|
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DyNTS_OAI_To_AI_Adapter = void 0;
|
|
4
|
-
const ai_llm_chat_service_base_1 = require("./ai-llm-chat.service-base");
|
|
5
|
-
const ai_1 = require("@futdevpro/fsm-dynamo/ai");
|
|
6
|
-
const oai_gpt_message_interface_1 = require("../open-ai/_models/interfaces/oai-gpt-message.interface");
|
|
7
|
-
/**
|
|
8
|
-
* Adapter to make DyNTS_OAI_LLMChat_ServiceBase compatible with DyNTS_AI_LLMChat_ServiceBase
|
|
9
|
-
* This bridges the OpenAI-specific implementation with the generic AI interface
|
|
10
|
-
*/
|
|
11
|
-
class DyNTS_OAI_To_AI_Adapter extends ai_llm_chat_service_base_1.DyNTS_AI_LLMChat_ServiceBase {
|
|
12
|
-
oaiService;
|
|
13
|
-
conversationHistory = new Map();
|
|
14
|
-
constructor(oaiService) {
|
|
15
|
-
super();
|
|
16
|
-
this.oaiService = oaiService;
|
|
17
|
-
}
|
|
18
|
-
addMessageToHistory(message, issuer) {
|
|
19
|
-
if (!this.conversationHistory.has(issuer)) {
|
|
20
|
-
this.conversationHistory.set(issuer, []);
|
|
21
|
-
}
|
|
22
|
-
this.conversationHistory.get(issuer).push(message);
|
|
23
|
-
}
|
|
24
|
-
clearHistory(issuer) {
|
|
25
|
-
this.conversationHistory.delete(issuer);
|
|
26
|
-
}
|
|
27
|
-
getHistory(issuer) {
|
|
28
|
-
return this.conversationHistory.get(issuer) || [];
|
|
29
|
-
}
|
|
30
|
-
// Conversion helpers
|
|
31
|
-
convertAIToOAIMessage(aiMessage) {
|
|
32
|
-
return {
|
|
33
|
-
role: aiMessage.role === ai_1.DyFM_AI_MessageRole.assistant
|
|
34
|
-
? oai_gpt_message_interface_1.DyNTS_OAI_GPT_Message_Role.assistant
|
|
35
|
-
: aiMessage.role === ai_1.DyFM_AI_MessageRole.system
|
|
36
|
-
? oai_gpt_message_interface_1.DyNTS_OAI_GPT_Message_Role.system
|
|
37
|
-
: oai_gpt_message_interface_1.DyNTS_OAI_GPT_Message_Role.user,
|
|
38
|
-
content: aiMessage.content,
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
convertOAIToAIMessage(oaiMessage) {
|
|
42
|
-
return {
|
|
43
|
-
role: oaiMessage.role === oai_gpt_message_interface_1.DyNTS_OAI_GPT_Message_Role.assistant
|
|
44
|
-
? ai_1.DyFM_AI_MessageRole.assistant
|
|
45
|
-
: oaiMessage.role === oai_gpt_message_interface_1.DyNTS_OAI_GPT_Message_Role.system
|
|
46
|
-
? ai_1.DyFM_AI_MessageRole.system
|
|
47
|
-
: ai_1.DyFM_AI_MessageRole.user,
|
|
48
|
-
content: oaiMessage.content,
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
convertAIToOAI(conversation) {
|
|
52
|
-
return conversation.map(msg => this.convertAIToOAIMessage(msg));
|
|
53
|
-
}
|
|
54
|
-
// Implement abstract methods by delegating to OAI service with conversion
|
|
55
|
-
async yesNoQuestionInConversation(set) {
|
|
56
|
-
const conversation = this.convertAIToOAI(set.conversation);
|
|
57
|
-
const result = await this.oaiService.yesNoQuestionInConversation({
|
|
58
|
-
conversation,
|
|
59
|
-
question: set.question,
|
|
60
|
-
issuer: set.issuer,
|
|
61
|
-
settings: set.settings,
|
|
62
|
-
debugLog: set.debugLog,
|
|
63
|
-
replaceThisInLog: set.replaceThisInLog,
|
|
64
|
-
});
|
|
65
|
-
return result;
|
|
66
|
-
}
|
|
67
|
-
async simpleQuestionInConversation(set) {
|
|
68
|
-
const conversation = this.convertAIToOAI(set.conversation);
|
|
69
|
-
const result = await this.oaiService.simpleQuestionInConversation({
|
|
70
|
-
conversation,
|
|
71
|
-
question: set.question,
|
|
72
|
-
issuer: set.issuer,
|
|
73
|
-
settings: set.settings,
|
|
74
|
-
debugLog: set.debugLog,
|
|
75
|
-
replaceThisInLog: set.replaceThisInLog,
|
|
76
|
-
});
|
|
77
|
-
return result;
|
|
78
|
-
}
|
|
79
|
-
async percentageQuestionInConversation(set) {
|
|
80
|
-
const conversation = this.convertAIToOAI(set.conversation);
|
|
81
|
-
const result = await this.oaiService.percentageQuestionInConversation({
|
|
82
|
-
conversation,
|
|
83
|
-
question: set.question,
|
|
84
|
-
issuer: set.issuer,
|
|
85
|
-
settings: set.settings,
|
|
86
|
-
debugLog: set.debugLog,
|
|
87
|
-
replaceThisInLog: set.replaceThisInLog,
|
|
88
|
-
});
|
|
89
|
-
return result;
|
|
90
|
-
}
|
|
91
|
-
async selectQuestionInConversation(set) {
|
|
92
|
-
const conversation = this.convertAIToOAI(set.conversation);
|
|
93
|
-
const result = await this.oaiService.selectQuestionInConversation({
|
|
94
|
-
conversation,
|
|
95
|
-
question: set.question,
|
|
96
|
-
selectFrom: set.selectFrom,
|
|
97
|
-
issuer: set.issuer,
|
|
98
|
-
settings: set.settings,
|
|
99
|
-
debugLog: set.debugLog,
|
|
100
|
-
replaceThisInLog: set.replaceThisInLog,
|
|
101
|
-
});
|
|
102
|
-
return result;
|
|
103
|
-
}
|
|
104
|
-
async requestSelectInConversation(set) {
|
|
105
|
-
const conversation = this.convertAIToOAI(set.conversation);
|
|
106
|
-
const result = await this.oaiService.requestSelectInConversation({
|
|
107
|
-
conversation,
|
|
108
|
-
question: set.question,
|
|
109
|
-
selectFrom: set.selectFrom,
|
|
110
|
-
issuer: set.issuer,
|
|
111
|
-
settings: set.settings,
|
|
112
|
-
debugLog: set.debugLog,
|
|
113
|
-
replaceThisInLog: set.replaceThisInLog,
|
|
114
|
-
});
|
|
115
|
-
return result;
|
|
116
|
-
}
|
|
117
|
-
async multipleSelectQuestionInConversationWithOptions(set) {
|
|
118
|
-
const conversation = this.convertAIToOAI(set.conversation);
|
|
119
|
-
const result = await this.oaiService.multipleSelectQuestionWithOptionsInConversation({
|
|
120
|
-
conversation,
|
|
121
|
-
question: set.question,
|
|
122
|
-
options: set.options,
|
|
123
|
-
issuer: set.issuer,
|
|
124
|
-
settings: set.settings,
|
|
125
|
-
debugLog: set.debugLog,
|
|
126
|
-
replaceThisInLog: set.replaceThisInLog,
|
|
127
|
-
});
|
|
128
|
-
return result;
|
|
129
|
-
}
|
|
130
|
-
async requestMultiselectInConversation(set) {
|
|
131
|
-
const conversation = this.convertAIToOAI(set.conversation);
|
|
132
|
-
const result = await this.oaiService.requestMultipleSelectInConversation({
|
|
133
|
-
conversation,
|
|
134
|
-
question: set.question,
|
|
135
|
-
options: set.options,
|
|
136
|
-
issuer: set.issuer,
|
|
137
|
-
settings: set.settings,
|
|
138
|
-
debugLog: set.debugLog,
|
|
139
|
-
replaceThisInLog: set.replaceThisInLog,
|
|
140
|
-
});
|
|
141
|
-
return result;
|
|
142
|
-
}
|
|
143
|
-
async JSONQuestionInConversationWithKeysDescription(set) {
|
|
144
|
-
const conversation = this.convertAIToOAI(set.conversation);
|
|
145
|
-
const result = await this.oaiService.jsonQuestionWithKeysDescriptionInConversation({
|
|
146
|
-
conversation,
|
|
147
|
-
question: set.question,
|
|
148
|
-
keysDescription: set.keysDescription,
|
|
149
|
-
issuer: set.issuer,
|
|
150
|
-
settings: set.settings,
|
|
151
|
-
debugLog: set.debugLog,
|
|
152
|
-
replaceThisInLog: set.replaceThisInLog,
|
|
153
|
-
});
|
|
154
|
-
return result;
|
|
155
|
-
}
|
|
156
|
-
async JSONQuestionInConversationWithExactKeys(set) {
|
|
157
|
-
const conversation = this.convertAIToOAI(set.conversation);
|
|
158
|
-
const result = await this.oaiService.jsonQuestionWithExactKeysInConversation({
|
|
159
|
-
conversation,
|
|
160
|
-
question: set.question,
|
|
161
|
-
keys: set.keys,
|
|
162
|
-
issuer: set.issuer,
|
|
163
|
-
settings: set.settings,
|
|
164
|
-
debugLog: set.debugLog,
|
|
165
|
-
replaceThisInLog: set.replaceThisInLog,
|
|
166
|
-
});
|
|
167
|
-
return result;
|
|
168
|
-
}
|
|
169
|
-
async requestJSONInConversationWithExactKeys(set) {
|
|
170
|
-
const conversation = this.convertAIToOAI(set.conversation);
|
|
171
|
-
const result = await this.oaiService.jsonQuestionWithExactKeysInConversation({
|
|
172
|
-
conversation,
|
|
173
|
-
question: set.question,
|
|
174
|
-
keys: set.keys,
|
|
175
|
-
issuer: set.issuer,
|
|
176
|
-
settings: set.settings,
|
|
177
|
-
debugLog: set.debugLog,
|
|
178
|
-
replaceThisInLog: set.replaceThisInLog,
|
|
179
|
-
});
|
|
180
|
-
return result;
|
|
181
|
-
}
|
|
182
|
-
async getQuestionAnswerInConversation(set) {
|
|
183
|
-
const conversation = this.convertAIToOAI(set.conversation);
|
|
184
|
-
const result = await this.oaiService.getQuestionAnswerInConversation({
|
|
185
|
-
conversation,
|
|
186
|
-
question: set.question,
|
|
187
|
-
issuer: set.issuer,
|
|
188
|
-
settings: set.settings,
|
|
189
|
-
debugLog: set.debugLog,
|
|
190
|
-
replaceThisInLog: set.replaceThisInLog,
|
|
191
|
-
});
|
|
192
|
-
return result;
|
|
193
|
-
}
|
|
194
|
-
async getAnswerInConversation(set) {
|
|
195
|
-
const conversation = this.convertAIToOAI(set.conversation);
|
|
196
|
-
const result = await this.oaiService.getAnswerInConversation({
|
|
197
|
-
conversation,
|
|
198
|
-
newMessage: set.newMessage,
|
|
199
|
-
issuer: set.issuer,
|
|
200
|
-
settings: set.settings,
|
|
201
|
-
debugLog: set.debugLog,
|
|
202
|
-
replaceThisInLog: set.replaceThisInLog,
|
|
203
|
-
});
|
|
204
|
-
return result;
|
|
205
|
-
}
|
|
206
|
-
// Delegate non-abstract methods to the OAI service
|
|
207
|
-
get defaultSettings() {
|
|
208
|
-
return this.oaiService.defaultSettings;
|
|
209
|
-
}
|
|
210
|
-
askQuestion(set) {
|
|
211
|
-
return this.oaiService.askQuestion(set);
|
|
212
|
-
}
|
|
213
|
-
jsonQuestionInConversation(set) {
|
|
214
|
-
return this.oaiService.jsonQuestionInConversation(set);
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
exports.DyNTS_OAI_To_AI_Adapter = DyNTS_OAI_To_AI_Adapter;
|
|
218
|
-
//# sourceMappingURL=oai-to-ai-adapter.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"oai-to-ai-adapter.service.js","sourceRoot":"","sources":["../../../../src/_modules/ai/_services/oai-to-ai-adapter.service.ts"],"names":[],"mappings":";;;AAAA,yEAA0E;AAC1E,iDAAgF;AAYhF,uGAA4H;AAE5H;;;GAGG;AACH,MAAa,uBAAwB,SAAQ,uDAA4B;IAC/D,UAAU,CAAgC;IAC1C,mBAAmB,GAAmC,IAAI,GAAG,EAAE,CAAC;IAExE,YAAY,UAAyC;QACnD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED,mBAAmB,CAAC,OAAwB,EAAE,MAAc;QAC1D,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YAC1C,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAC3C,CAAC;QACD,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACrD,CAAC;IAED,YAAY,CAAC,MAAc;QACzB,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC1C,CAAC;IAED,UAAU,CAAC,MAAc;QACvB,OAAO,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;I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,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,uBAAuB,CAAC;YAC3D,YAAY;YACZ,UAAU,EAAE,GAAG,CAAC,UAAU;YAC1B,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,QAAQ,EAAE,GAAG,CAAC,QAAe;YAC7B,QAAQ,EAAE,GAAG,CAAC,QAAQ;YACtB,gBAAgB,EAAG,GAAW,CAAC,gBAAgB;SAChD,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,mDAAmD;IACnD,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC;IACzC,CAAC;IAED,WAAW,CAAC,GAAQ;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAC1C,CAAC;IAED,0BAA0B,CAAU,GAAQ;QAC1C,OAAO,IAAI,CAAC,UAAU,CAAC,0BAA0B,CAAI,GAAG,CAAC,CAAC;IAC5D,CAAC;CACF;AAnOD,0DAmOC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bot-provider.enum.d.ts","sourceRoot":"","sources":["../../../../src/_modules/bot/_enums/bot-provider.enum.ts"],"names":[],"mappings":"AAAA,oBAAY,uBAAuB;IACjC,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,MAAM,WAAW;CAClB"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DyNTS_Bot_Provider_Type = void 0;
|
|
4
|
-
var DyNTS_Bot_Provider_Type;
|
|
5
|
-
(function (DyNTS_Bot_Provider_Type) {
|
|
6
|
-
DyNTS_Bot_Provider_Type["discord"] = "discord";
|
|
7
|
-
DyNTS_Bot_Provider_Type["slack"] = "slack";
|
|
8
|
-
DyNTS_Bot_Provider_Type["teams"] = "teams";
|
|
9
|
-
DyNTS_Bot_Provider_Type["dynamo"] = "dynamo";
|
|
10
|
-
DyNTS_Bot_Provider_Type["custom"] = "custom";
|
|
11
|
-
})(DyNTS_Bot_Provider_Type || (exports.DyNTS_Bot_Provider_Type = DyNTS_Bot_Provider_Type = {}));
|
|
12
|
-
//# sourceMappingURL=bot-provider.enum.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bot-provider.enum.js","sourceRoot":"","sources":["../../../../src/_modules/bot/_enums/bot-provider.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,uBAMX;AAND,WAAY,uBAAuB;IACjC,8CAAmB,CAAA;IACnB,0CAAe,CAAA;IACf,0CAAe,CAAA;IACf,4CAAiB,CAAA;IACjB,4CAAiB,CAAA;AACnB,CAAC,EANW,uBAAuB,uCAAvB,uBAAuB,QAMlC"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { DyNTS_Bot_Message } from './bot-message.interface';
|
|
2
|
-
import { DyNTS_Bot_Channel } from './bot-channel.interface';
|
|
3
|
-
import { DyNTS_Bot_User } from './bot-user.interface';
|
|
4
|
-
import { DyNTS_Bot_LastMessageDate } from './bot-last-message-date.interface';
|
|
5
|
-
import { DyNTS_Bot_LastMentionDate } from './bot-last-mention-date.interface';
|
|
6
|
-
import { DyNTS_Bot_Provider_Type } from '../_enums/bot-provider.enum';
|
|
7
|
-
import { DyNTS_Bot_Global_Settings } from './bot-global-settings.interface';
|
|
8
|
-
export interface DyNTS_Bot_Provider_Config extends DyNTS_Bot_Global_Settings {
|
|
9
|
-
provider: DyNTS_Bot_Provider_Type;
|
|
10
|
-
providerInstance?: DyNTS_Bot_Provider;
|
|
11
|
-
discord?: {
|
|
12
|
-
token: string;
|
|
13
|
-
guildId: string;
|
|
14
|
-
clientId: string;
|
|
15
|
-
oauth2Url: string;
|
|
16
|
-
};
|
|
17
|
-
slack?: {
|
|
18
|
-
token: string;
|
|
19
|
-
workspace: string;
|
|
20
|
-
};
|
|
21
|
-
teams?: {
|
|
22
|
-
appId: string;
|
|
23
|
-
appPassword: string;
|
|
24
|
-
tenantId: string;
|
|
25
|
-
};
|
|
26
|
-
dynamo?: {
|
|
27
|
-
defaultConversationId?: string;
|
|
28
|
-
botUserId?: string;
|
|
29
|
-
botDisplayName?: string;
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
export interface DyNTS_Bot_Provider<T_PlatformChannel extends DyNTS_Bot_Channel<any> = DyNTS_Bot_Channel<any>, T_PlatformMessage extends DyNTS_Bot_Message<any> = DyNTS_Bot_Message<any>, T_PlatformUser extends DyNTS_Bot_User<any> = DyNTS_Bot_User<any>> {
|
|
33
|
-
initialize(config: DyNTS_Bot_Provider_Config): Promise<void>;
|
|
34
|
-
login(token: string): Promise<void>;
|
|
35
|
-
getChannelByName(name: string): Promise<T_PlatformChannel>;
|
|
36
|
-
sendMessageToChannelByName(channelName: string, message: string): Promise<T_PlatformMessage>;
|
|
37
|
-
getMessagesFromChannelByChannelName(channelName: string, limit?: number): Promise<T_PlatformMessage[]>;
|
|
38
|
-
getLastMessageInChannel(channelName: string): Promise<T_PlatformMessage>;
|
|
39
|
-
clearChannel(channelId: string): Promise<void>;
|
|
40
|
-
sendMessage(channelId: string, content: string): Promise<T_PlatformMessage>;
|
|
41
|
-
replyToMessage(messageId: string, channelId: string, content: string): Promise<T_PlatformMessage>;
|
|
42
|
-
sendTyping(channelId: string): Promise<void>;
|
|
43
|
-
fetchMessages(channelId: string, limit: number): Promise<T_PlatformMessage[]>;
|
|
44
|
-
fetchAllMessagesWithPaging(channelId: string, maxFetch?: number): Promise<T_PlatformMessage[]>;
|
|
45
|
-
deleteMessage(messageId: string, channelId: string): Promise<void>;
|
|
46
|
-
getUserByName(username: string): Promise<T_PlatformUser>;
|
|
47
|
-
getUserMention(userId: string): string;
|
|
48
|
-
readMembersInChannel(channelName: string): Promise<T_PlatformUser[]>;
|
|
49
|
-
readMemberNamesInChannel(channelName: string): Promise<string[]>;
|
|
50
|
-
getLastMessageSentBy(channelName: string, username: string): Promise<T_PlatformMessage>;
|
|
51
|
-
getLastMentionOf(channelName: string, username: string): Promise<T_PlatformMessage>;
|
|
52
|
-
readLastMessageDatesByMembers(channelName: string, memberNames: string[]): Promise<DyNTS_Bot_LastMessageDate[]>;
|
|
53
|
-
readLastMessageWithMemberNamePingInIt(channelName: string, users: T_PlatformUser[]): Promise<DyNTS_Bot_LastMentionDate[]>;
|
|
54
|
-
getRoleByName?(roleName: string): any;
|
|
55
|
-
getRolePingByName?(roleName: string): Promise<string>;
|
|
56
|
-
getRolePingsByName?(roleNames: string[]): Promise<string>;
|
|
57
|
-
onMessage(handler: (message: T_PlatformMessage, issuer: string) => void): void;
|
|
58
|
-
onReady(handler: () => void): void;
|
|
59
|
-
onError(handler: (error: Error) => void): void;
|
|
60
|
-
getBotId(): string;
|
|
61
|
-
getBotDisplayName(): string;
|
|
62
|
-
getProviderName(): string;
|
|
63
|
-
isReady(): boolean;
|
|
64
|
-
}
|
|
65
|
-
//# sourceMappingURL=bot-provider.interface.d.ts.map
|