@dataclouder/conversation-card-nestjs 0.0.25 → 0.0.27
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/clases/conversation.interface.d.ts +144 -0
- package/dist/clases/conversation.interface.d.ts.map +1 -0
- package/dist/clases/conversation.interface.js +40 -0
- package/dist/clases/conversation.interface.js.map +1 -0
- package/dist/controllers/conversation-ai.controller.d.ts +19 -0
- package/dist/controllers/conversation-ai.controller.d.ts.map +1 -0
- package/dist/controllers/conversation-ai.controller.js +136 -0
- package/dist/controllers/conversation-ai.controller.js.map +1 -0
- package/dist/controllers/conversation.controller.d.ts +4 -0
- package/dist/controllers/conversation.controller.d.ts.map +1 -0
- package/dist/controllers/conversation.controller.js +33 -0
- package/dist/controllers/conversation.controller.js.map +1 -0
- package/dist/conversation-cards.module.d.ts +3 -0
- package/dist/conversation-cards.module.d.ts.map +1 -0
- package/dist/conversation-cards.module.js +27 -0
- package/dist/conversation-cards.module.js.map +1 -0
- package/dist/dto/create-conversation.dto.d.ts +18 -0
- package/dist/dto/create-conversation.dto.d.ts.map +1 -0
- package/dist/dto/create-conversation.dto.js +42 -0
- package/dist/dto/create-conversation.dto.js.map +1 -0
- package/dist/entities/conversation.entity.d.ts +68 -0
- package/dist/entities/conversation.entity.d.ts.map +1 -0
- package/dist/entities/conversation.entity.js +97 -0
- package/dist/entities/conversation.entity.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/services/audio-transcription.service.d.ts +1 -0
- package/dist/services/audio-transcription.service.d.ts.map +1 -0
- package/dist/services/audio-transcription.service.js +1 -0
- package/dist/services/audio-transcription.service.js.map +1 -0
- package/dist/services/conversation-ai.service.d.ts +28 -0
- package/dist/services/conversation-ai.service.d.ts.map +1 -0
- package/dist/services/conversation-ai.service.js +82 -0
- package/dist/services/conversation-ai.service.js.map +1 -0
- package/dist/services/conversation-card-models.service.d.ts +13 -0
- package/dist/services/conversation-card-models.service.d.ts.map +1 -0
- package/dist/services/conversation-card-models.service.js +82 -0
- package/dist/services/conversation-card-models.service.js.map +1 -0
- package/dist/services/conversation-cards.service.d.ts +3 -0
- package/dist/services/conversation-cards.service.d.ts.map +1 -0
- package/dist/services/conversation-cards.service.js +17 -0
- package/dist/services/conversation-cards.service.js.map +1 -0
- package/dist/tts/tts-service.d.ts +1 -0
- package/dist/tts/tts-service.d.ts.map +1 -0
- package/dist/tts/tts-service.js +1 -0
- package/dist/tts/tts-service.js.map +1 -0
- package/dist/tts/tts.classes.d.ts +33 -0
- package/dist/tts/tts.classes.d.ts.map +1 -0
- package/dist/tts/tts.classes.js +200 -0
- package/dist/tts/tts.classes.js.map +1 -0
- package/dist/tts/voices.d.ts +4 -0
- package/dist/tts/voices.d.ts.map +1 -0
- package/dist/tts/voices.js +208 -0
- package/dist/tts/voices.js.map +1 -0
- package/package.json +1 -1
@@ -0,0 +1,144 @@
|
|
1
|
+
export interface Message {
|
2
|
+
role: 'user' | 'assistant';
|
3
|
+
content: string;
|
4
|
+
}
|
5
|
+
export interface Conversation {
|
6
|
+
id: string;
|
7
|
+
messages?: Message[];
|
8
|
+
userId: string;
|
9
|
+
context?: Record<string, any>;
|
10
|
+
createdAt: Date;
|
11
|
+
updatedAt: Date;
|
12
|
+
}
|
13
|
+
export declare enum ChatRole {
|
14
|
+
System = "system",
|
15
|
+
User = "user",
|
16
|
+
Assistant = "assistant",
|
17
|
+
AssistantHelper = "assistantHelper"
|
18
|
+
}
|
19
|
+
export declare class ChatMultiMessage {
|
20
|
+
voice: string;
|
21
|
+
content: string;
|
22
|
+
text: string;
|
23
|
+
audioUrl: string;
|
24
|
+
audioPromise: any;
|
25
|
+
isLoading?: boolean;
|
26
|
+
transcription?: any;
|
27
|
+
transcriptionTimestamps?: WordTimestamps[];
|
28
|
+
tag: string | string[] | Set<string> | {
|
29
|
+
[klass: string]: any;
|
30
|
+
};
|
31
|
+
}
|
32
|
+
export type TranscriptionsWhisper = {
|
33
|
+
text: string;
|
34
|
+
task: string;
|
35
|
+
language: string;
|
36
|
+
words: any;
|
37
|
+
duration: number;
|
38
|
+
};
|
39
|
+
export declare class WordTimestamps {
|
40
|
+
word: string;
|
41
|
+
start: number;
|
42
|
+
end: number;
|
43
|
+
highlighted: any;
|
44
|
+
}
|
45
|
+
export declare class ChatMessageDict {
|
46
|
+
content: string;
|
47
|
+
role: ChatRole;
|
48
|
+
metadata?: any;
|
49
|
+
}
|
50
|
+
export declare class ChatMessage {
|
51
|
+
content: string;
|
52
|
+
role: ChatRole;
|
53
|
+
ssml?: string;
|
54
|
+
text?: string;
|
55
|
+
translation?: string;
|
56
|
+
audioUrl?: string;
|
57
|
+
audioHtml?: HTMLAudioElement;
|
58
|
+
promisePlay?: any;
|
59
|
+
stats?: any;
|
60
|
+
multiMessages?: ChatMultiMessage[];
|
61
|
+
transcription?: TranscriptionsWhisper;
|
62
|
+
transcriptionTimestamps?: WordTimestamps[];
|
63
|
+
voice?: string;
|
64
|
+
}
|
65
|
+
export interface CharaCard {
|
66
|
+
name: string;
|
67
|
+
description: string;
|
68
|
+
scenario: string;
|
69
|
+
first_mes: string;
|
70
|
+
creator_notes: string;
|
71
|
+
mes_example: string;
|
72
|
+
alternate_greetings: string[];
|
73
|
+
tags: string[];
|
74
|
+
system_prompt: string;
|
75
|
+
post_history_instructions: string;
|
76
|
+
}
|
77
|
+
export interface Appearance {
|
78
|
+
physicalDescription: string;
|
79
|
+
outfit: string;
|
80
|
+
objects: string;
|
81
|
+
quirks: string;
|
82
|
+
}
|
83
|
+
export interface ICharacterCardDC {
|
84
|
+
spec: 'chara_card_v2';
|
85
|
+
spec_version: '2_v_dc';
|
86
|
+
data: {
|
87
|
+
name: string;
|
88
|
+
description: string;
|
89
|
+
scenario: string;
|
90
|
+
first_mes: string;
|
91
|
+
creator_notes: string;
|
92
|
+
mes_example: string;
|
93
|
+
alternate_greetings: string[];
|
94
|
+
tags: string[];
|
95
|
+
system_prompt: string;
|
96
|
+
post_history_instructions: string;
|
97
|
+
character_version: string;
|
98
|
+
extensions: Record<string, any>;
|
99
|
+
appearance: Appearance;
|
100
|
+
};
|
101
|
+
}
|
102
|
+
export declare enum TextEngines {
|
103
|
+
Plantext = "plantext",
|
104
|
+
SimpleText = "simpleText",
|
105
|
+
MarkdownMultiMessages = "markdownMultiMessages",
|
106
|
+
MarkdownSSML = "markdownSSML"
|
107
|
+
}
|
108
|
+
export declare enum ConversationType {
|
109
|
+
General = "general",
|
110
|
+
Reflection = "reflection",
|
111
|
+
LearningExample = "learningExample",
|
112
|
+
Challenge = "challenge",
|
113
|
+
RolePlay = "rolePlay",
|
114
|
+
RolePlayNoNarrator = "rolePlayNoNarrator",
|
115
|
+
RolePlayInnerThoughts = "rolePlayInnerThoughts"
|
116
|
+
}
|
117
|
+
export interface IConversationCard {
|
118
|
+
version: string;
|
119
|
+
id: string;
|
120
|
+
title: string;
|
121
|
+
assets: {
|
122
|
+
image: any;
|
123
|
+
};
|
124
|
+
characterCard: ICharacterCardDC;
|
125
|
+
textEngine: TextEngines;
|
126
|
+
conversationType: ConversationType;
|
127
|
+
lang: string;
|
128
|
+
tts: {
|
129
|
+
voice: string;
|
130
|
+
secondaryVoice: string;
|
131
|
+
speed: string;
|
132
|
+
speedRate: number;
|
133
|
+
};
|
134
|
+
metaApp: {
|
135
|
+
isPublished: boolean;
|
136
|
+
isPublic: any;
|
137
|
+
authorId: string;
|
138
|
+
authorEmail: string;
|
139
|
+
createdAt: Date;
|
140
|
+
updatedAt: Date;
|
141
|
+
takenCount: number;
|
142
|
+
};
|
143
|
+
}
|
144
|
+
//# sourceMappingURL=conversation.interface.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"conversation.interface.d.ts","sourceRoot":"","sources":["../../src/clases/conversation.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,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AAC;QAChB,SAAS,EAAE,IAAI,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;CACH"}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.ConversationType = exports.TextEngines = exports.ChatMessage = exports.ChatMessageDict = exports.WordTimestamps = exports.ChatMultiMessage = exports.ChatRole = void 0;
|
4
|
+
var ChatRole;
|
5
|
+
(function (ChatRole) {
|
6
|
+
ChatRole["System"] = "system";
|
7
|
+
ChatRole["User"] = "user";
|
8
|
+
ChatRole["Assistant"] = "assistant";
|
9
|
+
ChatRole["AssistantHelper"] = "assistantHelper";
|
10
|
+
})(ChatRole || (exports.ChatRole = ChatRole = {}));
|
11
|
+
class ChatMultiMessage {
|
12
|
+
}
|
13
|
+
exports.ChatMultiMessage = ChatMultiMessage;
|
14
|
+
class WordTimestamps {
|
15
|
+
}
|
16
|
+
exports.WordTimestamps = WordTimestamps;
|
17
|
+
class ChatMessageDict {
|
18
|
+
}
|
19
|
+
exports.ChatMessageDict = ChatMessageDict;
|
20
|
+
class ChatMessage {
|
21
|
+
}
|
22
|
+
exports.ChatMessage = ChatMessage;
|
23
|
+
var TextEngines;
|
24
|
+
(function (TextEngines) {
|
25
|
+
TextEngines["Plantext"] = "plantext";
|
26
|
+
TextEngines["SimpleText"] = "simpleText";
|
27
|
+
TextEngines["MarkdownMultiMessages"] = "markdownMultiMessages";
|
28
|
+
TextEngines["MarkdownSSML"] = "markdownSSML";
|
29
|
+
})(TextEngines || (exports.TextEngines = TextEngines = {}));
|
30
|
+
var ConversationType;
|
31
|
+
(function (ConversationType) {
|
32
|
+
ConversationType["General"] = "general";
|
33
|
+
ConversationType["Reflection"] = "reflection";
|
34
|
+
ConversationType["LearningExample"] = "learningExample";
|
35
|
+
ConversationType["Challenge"] = "challenge";
|
36
|
+
ConversationType["RolePlay"] = "rolePlay";
|
37
|
+
ConversationType["RolePlayNoNarrator"] = "rolePlayNoNarrator";
|
38
|
+
ConversationType["RolePlayInnerThoughts"] = "rolePlayInnerThoughts";
|
39
|
+
})(ConversationType || (exports.ConversationType = ConversationType = {}));
|
40
|
+
//# sourceMappingURL=conversation.interface.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"conversation.interface.js","sourceRoot":"","sources":["../../src/clases/conversation.interface.ts"],"names":[],"mappings":";;;AAcA,IAAY,QAKX;AALD,WAAY,QAAQ;IAClB,6BAAiB,CAAA;IACjB,yBAAa,CAAA;IACb,mCAAuB,CAAA;IACvB,+CAAmC,CAAA;AACrC,CAAC,EALW,QAAQ,wBAAR,QAAQ,QAKnB;AAED,MAAa,gBAAgB;CAU5B;AAVD,4CAUC;AAID,MAAa,cAAc;CAK1B;AALD,wCAKC;AAED,MAAa,eAAe;CAI3B;AAJD,0CAIC;AAED,MAAa,WAAW;CAcvB;AAdD,kCAcC;AA2CD,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,oCAAqB,CAAA;IACrB,wCAAyB,CAAA;IACzB,8DAA+C,CAAA;IAC/C,4CAA6B,CAAA;AAC/B,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB;AAED,IAAY,gBAQX;AARD,WAAY,gBAAgB;IAC1B,uCAAmB,CAAA;IACnB,6CAAyB,CAAA;IACzB,uDAAmC,CAAA;IACnC,2CAAuB,CAAA;IACvB,yCAAqB,CAAA;IACrB,6DAAyC,CAAA;IACzC,mEAA+C,CAAA;AACjD,CAAC,EARW,gBAAgB,gCAAhB,gBAAgB,QAQ3B"}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { ConversationAiService, FiltersConfig } from '../services/conversation-ai.service';
|
2
|
+
import { ConversationDTO } from '../dto/create-conversation.dto';
|
3
|
+
import { ChatMessageDict, IConversationCard } from '../clases/conversation.interface';
|
4
|
+
import { Conversation, ConversationDocument } from '../entities/conversation.entity';
|
5
|
+
import { ConversationCardModelService } from '../services/conversation-card-models.service';
|
6
|
+
export declare class ConversationAiController {
|
7
|
+
private readonly conversationAiService;
|
8
|
+
private readonly aiModel;
|
9
|
+
constructor(conversationAiService: ConversationAiService, aiModel: ConversationCardModelService);
|
10
|
+
getConversations(): Promise<ConversationDocument[]>;
|
11
|
+
saveConversation(conversation: IConversationCard): Promise<ConversationDocument>;
|
12
|
+
findScenario(paginator: FiltersConfig): Promise<any>;
|
13
|
+
getConversationById(id: string): Promise<ConversationDocument>;
|
14
|
+
updateConversation(id: string, updateData: Partial<Conversation>): Promise<ConversationDocument>;
|
15
|
+
deleteConversationById(id: string): Promise<ConversationDocument>;
|
16
|
+
continueConversation(conversation: ConversationDTO): Promise<ChatMessageDict>;
|
17
|
+
test(): Promise<string>;
|
18
|
+
}
|
19
|
+
//# sourceMappingURL=conversation-ai.controller.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"conversation-ai.controller.d.ts","sourceRoot":"","sources":["../../src/controllers/conversation-ai.controller.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAC3F,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAe,MAAM,kCAAkC,CAAC;AACnG,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAGrF,OAAO,EAAE,4BAA4B,EAAE,MAAM,8CAA8C,CAAC;AAE5F,qBAEa,wBAAwB;IAEjC,OAAO,CAAC,QAAQ,CAAC,qBAAqB;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO;gBADP,qBAAqB,EAAE,qBAAqB,EAC5C,OAAO,EAAE,4BAA4B;IAMlD,gBAAgB,IAAI,OAAO,CAAC,oBAAoB,EAAE,CAAC;IAQnD,gBAAgB,CAAS,YAAY,EAAE,iBAAiB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAMxF,YAAY,CAAS,SAAS,EAAE,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC;IAiB5D,mBAAmB,CAAc,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAO3E,kBAAkB,CAAc,EAAE,EAAE,MAAM,EAAU,UAAU,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAOrH,sBAAsB,CAAc,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAO9E,oBAAoB,CAAS,YAAY,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IAWrF,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC;CAI9B"}
|
@@ -0,0 +1,136 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
+
};
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10
|
+
};
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
13
|
+
};
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
+
exports.ConversationAiController = void 0;
|
16
|
+
const common_1 = require("@nestjs/common");
|
17
|
+
const swagger_1 = require("@nestjs/swagger");
|
18
|
+
const conversation_ai_service_1 = require("../services/conversation-ai.service");
|
19
|
+
const create_conversation_dto_1 = require("../dto/create-conversation.dto");
|
20
|
+
const conversation_interface_1 = require("../clases/conversation.interface");
|
21
|
+
const conversation_entity_1 = require("../entities/conversation.entity");
|
22
|
+
const conversation_card_models_service_1 = require("../services/conversation-card-models.service");
|
23
|
+
let ConversationAiController = class ConversationAiController {
|
24
|
+
constructor(conversationAiService, aiModel) {
|
25
|
+
this.conversationAiService = conversationAiService;
|
26
|
+
this.aiModel = aiModel;
|
27
|
+
}
|
28
|
+
async getConversations() {
|
29
|
+
console.log('getConversations');
|
30
|
+
return this.conversationAiService.getConversations();
|
31
|
+
}
|
32
|
+
async saveConversation(conversation) {
|
33
|
+
return this.conversationAiService.saveConversation(conversation);
|
34
|
+
}
|
35
|
+
async findScenario(paginator) {
|
36
|
+
const conversations = await this.conversationAiService.queryConversations(paginator);
|
37
|
+
return conversations;
|
38
|
+
}
|
39
|
+
async getConversationById(id) {
|
40
|
+
return this.conversationAiService.getConversationById(id);
|
41
|
+
}
|
42
|
+
async updateConversation(id, updateData) {
|
43
|
+
return this.conversationAiService.updateConversation(id, updateData);
|
44
|
+
}
|
45
|
+
async deleteConversationById(id) {
|
46
|
+
return this.conversationAiService.deleteConversationById(id);
|
47
|
+
}
|
48
|
+
async continueConversation(conversation) {
|
49
|
+
const messages = conversation.messages;
|
50
|
+
console.log('messages', messages);
|
51
|
+
const response = await this.aiModel.chat(messages);
|
52
|
+
console.log('response', response);
|
53
|
+
return response;
|
54
|
+
}
|
55
|
+
async test() {
|
56
|
+
return 'Hello World' + conversation_interface_1.TextEngines.MarkdownMultiMessages;
|
57
|
+
}
|
58
|
+
};
|
59
|
+
exports.ConversationAiController = ConversationAiController;
|
60
|
+
__decorate([
|
61
|
+
(0, common_1.Get)('/conversation'),
|
62
|
+
(0, swagger_1.ApiOperation)({ summary: 'Get all conversations' }),
|
63
|
+
(0, swagger_1.ApiResponse)({ status: 200, description: 'Return all conversations.' }),
|
64
|
+
__metadata("design:type", Function),
|
65
|
+
__metadata("design:paramtypes", []),
|
66
|
+
__metadata("design:returntype", Promise)
|
67
|
+
], ConversationAiController.prototype, "getConversations", null);
|
68
|
+
__decorate([
|
69
|
+
(0, common_1.Post)('/conversation'),
|
70
|
+
(0, swagger_1.ApiOperation)({ summary: 'Save new conversations' }),
|
71
|
+
(0, swagger_1.ApiResponse)({ status: 201, description: 'The conversation has been successfully created.', type: conversation_entity_1.Conversation }),
|
72
|
+
__param(0, (0, common_1.Body)()),
|
73
|
+
__metadata("design:type", Function),
|
74
|
+
__metadata("design:paramtypes", [Object]),
|
75
|
+
__metadata("design:returntype", Promise)
|
76
|
+
], ConversationAiController.prototype, "saveConversation", null);
|
77
|
+
__decorate([
|
78
|
+
(0, common_1.Post)('/conversation/query'),
|
79
|
+
(0, swagger_1.ApiOperation)({ summary: 'get scenarios', description: 'Get scenarios paginated' }),
|
80
|
+
__param(0, (0, common_1.Body)()),
|
81
|
+
__metadata("design:type", Function),
|
82
|
+
__metadata("design:paramtypes", [conversation_ai_service_1.FiltersConfig]),
|
83
|
+
__metadata("design:returntype", Promise)
|
84
|
+
], ConversationAiController.prototype, "findScenario", null);
|
85
|
+
__decorate([
|
86
|
+
(0, common_1.Get)('/conversation/:id'),
|
87
|
+
(0, swagger_1.ApiOperation)({ summary: 'Get a conversation by ID' }),
|
88
|
+
(0, swagger_1.ApiResponse)({ status: 200, description: 'Return the conversation.' }),
|
89
|
+
__param(0, (0, common_1.Param)('id')),
|
90
|
+
__metadata("design:type", Function),
|
91
|
+
__metadata("design:paramtypes", [String]),
|
92
|
+
__metadata("design:returntype", Promise)
|
93
|
+
], ConversationAiController.prototype, "getConversationById", null);
|
94
|
+
__decorate([
|
95
|
+
(0, common_1.Put)('/conversation/:id'),
|
96
|
+
(0, swagger_1.ApiOperation)({ summary: 'Update a conversation by ID' }),
|
97
|
+
(0, swagger_1.ApiResponse)({ status: 200, description: 'The conversation has been successfully updated.', type: conversation_entity_1.Conversation }),
|
98
|
+
__param(0, (0, common_1.Param)('id')),
|
99
|
+
__param(1, (0, common_1.Body)()),
|
100
|
+
__metadata("design:type", Function),
|
101
|
+
__metadata("design:paramtypes", [String, Object]),
|
102
|
+
__metadata("design:returntype", Promise)
|
103
|
+
], ConversationAiController.prototype, "updateConversation", null);
|
104
|
+
__decorate([
|
105
|
+
(0, common_1.Delete)('/conversation/:id'),
|
106
|
+
(0, swagger_1.ApiOperation)({ summary: 'Delete a conversation by ID' }),
|
107
|
+
(0, swagger_1.ApiResponse)({ status: 200, description: 'Return the deleted conversation.' }),
|
108
|
+
__param(0, (0, common_1.Param)('id')),
|
109
|
+
__metadata("design:type", Function),
|
110
|
+
__metadata("design:paramtypes", [String]),
|
111
|
+
__metadata("design:returntype", Promise)
|
112
|
+
], ConversationAiController.prototype, "deleteConversationById", null);
|
113
|
+
__decorate([
|
114
|
+
(0, common_1.Post)('/chat'),
|
115
|
+
(0, swagger_1.ApiOperation)({ summary: 'Continue the conversation' }),
|
116
|
+
(0, swagger_1.ApiResponse)({ status: 200, description: 'Return the conversation.' }),
|
117
|
+
__param(0, (0, common_1.Body)()),
|
118
|
+
__metadata("design:type", Function),
|
119
|
+
__metadata("design:paramtypes", [create_conversation_dto_1.ConversationDTO]),
|
120
|
+
__metadata("design:returntype", Promise)
|
121
|
+
], ConversationAiController.prototype, "continueConversation", null);
|
122
|
+
__decorate([
|
123
|
+
(0, common_1.Get)('/test'),
|
124
|
+
(0, swagger_1.ApiOperation)({ summary: 'Test the conversation AI' }),
|
125
|
+
(0, swagger_1.ApiResponse)({ status: 200, description: 'Return the test result.' }),
|
126
|
+
__metadata("design:type", Function),
|
127
|
+
__metadata("design:paramtypes", []),
|
128
|
+
__metadata("design:returntype", Promise)
|
129
|
+
], ConversationAiController.prototype, "test", null);
|
130
|
+
exports.ConversationAiController = ConversationAiController = __decorate([
|
131
|
+
(0, swagger_1.ApiTags)('conversation-ai-cards'),
|
132
|
+
(0, common_1.Controller)('api/conversation-ai-cards'),
|
133
|
+
__metadata("design:paramtypes", [conversation_ai_service_1.ConversationAiService,
|
134
|
+
conversation_card_models_service_1.ConversationCardModelService])
|
135
|
+
], ConversationAiController);
|
136
|
+
//# sourceMappingURL=conversation-ai.controller.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"conversation-ai.controller.js","sourceRoot":"","sources":["../../src/controllers/conversation-ai.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAsF;AACtF,6CAAqE;AAErE,iFAA2F;AAC3F,4EAAiE;AACjE,6EAAmG;AACnG,yEAAqF;AAGrF,mGAA4F;AAIrF,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IACnC,YACmB,qBAA4C,EAC5C,OAAqC;QADrC,0BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,YAAO,GAAP,OAAO,CAA8B;IACrD,CAAC;IAKE,AAAN,KAAK,CAAC,gBAAgB;QACpB,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QAChC,OAAO,IAAI,CAAC,qBAAqB,CAAC,gBAAgB,EAAE,CAAC;IACvD,CAAC;IAKK,AAAN,KAAK,CAAC,gBAAgB,CAAS,YAA+B;QAC5D,OAAO,IAAI,CAAC,qBAAqB,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC;IACnE,CAAC;IAIK,AAAN,KAAK,CAAC,YAAY,CAAS,SAAwB;QACjD,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;QAUrF,OAAO,aAAa,CAAC;IACvB,CAAC;IAKK,AAAN,KAAK,CAAC,mBAAmB,CAAc,EAAU;QAC/C,OAAO,IAAI,CAAC,qBAAqB,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC;IAC5D,CAAC;IAKK,AAAN,KAAK,CAAC,kBAAkB,CAAc,EAAU,EAAU,UAAiC;QACzF,OAAO,IAAI,CAAC,qBAAqB,CAAC,kBAAkB,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;IACvE,CAAC;IAKK,AAAN,KAAK,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,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;;;;oDAIpE;mCA3EU,wBAAwB;IAFpC,IAAA,iBAAO,EAAC,uBAAuB,CAAC;IAChC,IAAA,mBAAU,EAAC,2BAA2B,CAAC;qCAGI,+CAAqB;QACnC,+DAA4B;GAH7C,wBAAwB,CA4EpC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"conversation.controller.d.ts","sourceRoot":"","sources":["../../src/controllers/conversation.controller.ts"],"names":[],"mappings":"AAGA,qBAEa,wBAAwB;IAI7B,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC;CAGlC"}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
+
};
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.ConversationAiController = void 0;
|
13
|
+
const common_1 = require("@nestjs/common");
|
14
|
+
const swagger_1 = require("@nestjs/swagger");
|
15
|
+
let ConversationAiController = class ConversationAiController {
|
16
|
+
async getCards() {
|
17
|
+
return 'Hello World';
|
18
|
+
}
|
19
|
+
};
|
20
|
+
exports.ConversationAiController = ConversationAiController;
|
21
|
+
__decorate([
|
22
|
+
(0, common_1.Get)('/cards'),
|
23
|
+
(0, swagger_1.ApiOperation)({ summary: 'Get the cards' }),
|
24
|
+
(0, swagger_1.ApiResponse)({ status: 200, description: 'Return the cards.' }),
|
25
|
+
__metadata("design:type", Function),
|
26
|
+
__metadata("design:paramtypes", []),
|
27
|
+
__metadata("design:returntype", Promise)
|
28
|
+
], ConversationAiController.prototype, "getCards", null);
|
29
|
+
exports.ConversationAiController = ConversationAiController = __decorate([
|
30
|
+
(0, swagger_1.ApiTags)('conversation-cards-library'),
|
31
|
+
(0, common_1.Controller)('api/conversation-cards-library')
|
32
|
+
], ConversationAiController);
|
33
|
+
//# sourceMappingURL=conversation.controller.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"conversation.controller.js","sourceRoot":"","sources":["../../src/controllers/conversation.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAiD;AACjD,6CAAqE;AAI9D,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IAI7B,AAAN,KAAK,CAAC,QAAQ;QACZ,OAAO,aAAa,CAAC;IACvB,CAAC;CACF,CAAA;AAPY,4DAAwB;AAI7B;IAHL,IAAA,YAAG,EAAC,QAAQ,CAAC;IACb,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC;IAC1C,IAAA,qBAAW,EAAC,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAC;;;;wDAG9D;mCANU,wBAAwB;IAFpC,IAAA,iBAAO,EAAC,4BAA4B,CAAC;IACrC,IAAA,mBAAU,EAAC,gCAAgC,CAAC;GAChC,wBAAwB,CAOpC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"conversation-cards.module.d.ts","sourceRoot":"","sources":["../src/conversation-cards.module.ts"],"names":[],"mappings":"AAQA,qBAMa,uBAAuB;CAAG"}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
+
};
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
9
|
+
exports.ConversationCardsModule = void 0;
|
10
|
+
const common_1 = require("@nestjs/common");
|
11
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
12
|
+
const conversation_ai_controller_1 = require("./controllers/conversation-ai.controller");
|
13
|
+
const conversation_entity_1 = require("./entities/conversation.entity");
|
14
|
+
const conversation_card_models_service_1 = require("./services/conversation-card-models.service");
|
15
|
+
const conversation_ai_service_1 = require("./services/conversation-ai.service");
|
16
|
+
let ConversationCardsModule = class ConversationCardsModule {
|
17
|
+
};
|
18
|
+
exports.ConversationCardsModule = ConversationCardsModule;
|
19
|
+
exports.ConversationCardsModule = ConversationCardsModule = __decorate([
|
20
|
+
(0, common_1.Module)({
|
21
|
+
imports: [mongoose_1.MongooseModule.forFeature([{ name: conversation_entity_1.Conversation.name, schema: conversation_entity_1.ConversationSchema }])],
|
22
|
+
controllers: [conversation_ai_controller_1.ConversationAiController],
|
23
|
+
providers: [conversation_ai_service_1.ConversationAiService, conversation_card_models_service_1.ConversationCardModelService],
|
24
|
+
exports: [conversation_ai_service_1.ConversationAiService, conversation_card_models_service_1.ConversationCardModelService],
|
25
|
+
})
|
26
|
+
], ConversationCardsModule);
|
27
|
+
//# sourceMappingURL=conversation-cards.module.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"conversation-cards.module.js","sourceRoot":"","sources":["../src/conversation-cards.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,+CAAkD;AAClD,yFAAoF;AACpF,wEAAkF;AAElF,kGAA2F;AAC3F,gFAA2E;AAQpE,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;CAAG,CAAA;AAA1B,0DAAuB;kCAAvB,uBAAuB;IANnC,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,yBAAc,CAAC,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,kCAAY,CAAC,IAAI,EAAE,MAAM,EAAE,wCAAkB,EAAE,CAAC,CAAC,CAAC;QAC/F,WAAW,EAAE,CAAC,qDAAwB,CAAC;QACvC,SAAS,EAAE,CAAC,+CAAqB,EAAE,+DAA4B,CAAC;QAChE,OAAO,EAAE,CAAC,+CAAqB,EAAE,+DAA4B,CAAC;KAC/D,CAAC;GACW,uBAAuB,CAAG"}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { ChatMessage, ConversationType } from '../clases/conversation.interface';
|
2
|
+
export declare class CreateConversationDto {
|
3
|
+
message: string;
|
4
|
+
userId: string;
|
5
|
+
context?: Record<string, any>;
|
6
|
+
}
|
7
|
+
export declare class ConversationDTO {
|
8
|
+
id?: string;
|
9
|
+
entityId?: string;
|
10
|
+
type?: ConversationType;
|
11
|
+
createdAt?: Date;
|
12
|
+
messages: Array<ChatMessage>;
|
13
|
+
transcription?: boolean;
|
14
|
+
modelName?: string;
|
15
|
+
provider?: string;
|
16
|
+
returnJson?: boolean;
|
17
|
+
}
|
18
|
+
//# sourceMappingURL=create-conversation.dto.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"create-conversation.dto.d.ts","sourceRoot":"","sources":["../../src/dto/create-conversation.dto.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEjF,qBAAa,qBAAqB;IAKhC,OAAO,EAAE,MAAM,CAAC;IAMhB,MAAM,EAAE,MAAM,CAAC;IAOf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC/B;AAED,qBAAa,eAAe;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IAC7B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB"}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
+
};
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.ConversationDTO = exports.CreateConversationDto = void 0;
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
14
|
+
class CreateConversationDto {
|
15
|
+
}
|
16
|
+
exports.CreateConversationDto = CreateConversationDto;
|
17
|
+
__decorate([
|
18
|
+
(0, swagger_1.ApiProperty)({
|
19
|
+
description: 'The message content of the conversation',
|
20
|
+
example: 'Hello, how can I help you today?',
|
21
|
+
}),
|
22
|
+
__metadata("design:type", String)
|
23
|
+
], CreateConversationDto.prototype, "message", void 0);
|
24
|
+
__decorate([
|
25
|
+
(0, swagger_1.ApiProperty)({
|
26
|
+
description: 'The user ID associated with the conversation',
|
27
|
+
example: 'user123',
|
28
|
+
}),
|
29
|
+
__metadata("design:type", String)
|
30
|
+
], CreateConversationDto.prototype, "userId", void 0);
|
31
|
+
__decorate([
|
32
|
+
(0, swagger_1.ApiProperty)({
|
33
|
+
description: 'Additional context for the conversation',
|
34
|
+
required: false,
|
35
|
+
example: { previousContext: 'User asked about weather' },
|
36
|
+
}),
|
37
|
+
__metadata("design:type", Object)
|
38
|
+
], CreateConversationDto.prototype, "context", void 0);
|
39
|
+
class ConversationDTO {
|
40
|
+
}
|
41
|
+
exports.ConversationDTO = ConversationDTO;
|
42
|
+
//# sourceMappingURL=create-conversation.dto.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"create-conversation.dto.js","sourceRoot":"","sources":["../../src/dto/create-conversation.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,6CAA8C;AAG9C,MAAa,qBAAqB;CAmBjC;AAnBD,sDAmBC;AAdC;IAJC,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,yCAAyC;QACtD,OAAO,EAAE,kCAAkC;KAC5C,CAAC;;sDACc;AAMhB;IAJC,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,8CAA8C;QAC3D,OAAO,EAAE,SAAS;KACnB,CAAC;;qDACa;AAOf;IALC,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,yCAAyC;QACtD,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,EAAE,eAAe,EAAE,0BAA0B,EAAE;KACzD,CAAC;;sDAC4B;AAGhC,MAAa,eAAe;CAU3B;AAVD,0CAUC"}
|
@@ -0,0 +1,68 @@
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
6
|
+
/// <reference types="mongoose/types/document" />
|
7
|
+
/// <reference types="mongoose/types/error" />
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
12
|
+
/// <reference types="mongoose/types/models" />
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
16
|
+
/// <reference types="mongoose/types/query" />
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
19
|
+
/// <reference types="mongoose/types/session" />
|
20
|
+
/// <reference types="mongoose/types/types" />
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
25
|
+
/// <reference types="mongoose/types/inferrawdoctype" />
|
26
|
+
import { Document, Schema as MongooseSchema } from 'mongoose';
|
27
|
+
import { ConversationType, TextEngines, IConversationCard, ICharacterCardDC } from '../clases/conversation.interface';
|
28
|
+
export type ConversationDocument = Conversation & Document;
|
29
|
+
export declare class Conversation implements IConversationCard {
|
30
|
+
_id: MongooseSchema.Types.ObjectId;
|
31
|
+
id: string;
|
32
|
+
version: string;
|
33
|
+
title: string;
|
34
|
+
characterCard: ICharacterCardDC;
|
35
|
+
textEngine: TextEngines;
|
36
|
+
conversationType: ConversationType;
|
37
|
+
lang: string;
|
38
|
+
assets: {
|
39
|
+
image: any;
|
40
|
+
};
|
41
|
+
tts: {
|
42
|
+
voice: string;
|
43
|
+
secondaryVoice: string;
|
44
|
+
speed: string;
|
45
|
+
speedRate: number;
|
46
|
+
};
|
47
|
+
voice: string;
|
48
|
+
secondaryVoice: string;
|
49
|
+
speed: string;
|
50
|
+
speedRate: number;
|
51
|
+
metaApp: {
|
52
|
+
isPublished: boolean;
|
53
|
+
isPublic: boolean;
|
54
|
+
authorId: string;
|
55
|
+
authorEmail: string;
|
56
|
+
createdAt: Date;
|
57
|
+
updatedAt: Date;
|
58
|
+
takenCount: number;
|
59
|
+
};
|
60
|
+
createdAt: Date;
|
61
|
+
updatedAt: Date;
|
62
|
+
}
|
63
|
+
export declare const ConversationSchema: MongooseSchema<Conversation, import("mongoose").Model<Conversation, any, any, any, Document<unknown, any, Conversation> & Conversation & Required<{
|
64
|
+
_id: MongooseSchema.Types.ObjectId;
|
65
|
+
}>, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Conversation, Document<unknown, {}, import("mongoose").FlatRecord<Conversation>> & import("mongoose").FlatRecord<Conversation> & Required<{
|
66
|
+
_id: MongooseSchema.Types.ObjectId;
|
67
|
+
}>>;
|
68
|
+
//# sourceMappingURL=conversation.entity.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"conversation.entity.d.ts","sourceRoot":"","sources":["../../src/entities/conversation.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,UAAU,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEtH,MAAM,MAAM,oBAAoB,GAAG,YAAY,GAAG,QAAQ,CAAC;AAE3D,qBACa,YAAa,YAAW,iBAAiB;IAEpD,GAAG,EAAE,cAAc,CAAC,KAAK,CAAC,QAAQ,CAAC;IAGnC,EAAE,EAAE,MAAM,CAAC;IAGX,OAAO,EAAE,MAAM,CAAC;IAGhB,KAAK,EAAE,MAAM,CAAC;IAGd,aAAa,E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