@dataclouder/conversation-card-nestjs 0.0.14 → 0.0.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. package/dist/libs/conversation-cards/src/ai-models.service.d.ts +12 -0
  2. package/dist/libs/conversation-cards/src/ai-models.service.js +82 -0
  3. package/dist/libs/conversation-cards/src/ai-models.service.js.map +1 -0
  4. package/dist/libs/conversation-cards/src/clases/conversation.interface.d.ts +160 -0
  5. package/dist/libs/conversation-cards/src/clases/conversation.interface.js +40 -0
  6. package/dist/libs/conversation-cards/src/clases/conversation.interface.js.map +1 -0
  7. package/dist/libs/conversation-cards/src/conversation-ai.controller.d.ts +22 -0
  8. package/dist/libs/conversation-cards/src/conversation-ai.controller.js +153 -0
  9. package/dist/libs/conversation-cards/src/conversation-ai.controller.js.map +1 -0
  10. package/dist/libs/conversation-cards/src/conversation-ai.module.d.ts +2 -0
  11. package/dist/libs/conversation-cards/src/conversation-ai.module.js +28 -0
  12. package/dist/libs/conversation-cards/src/conversation-ai.module.js.map +1 -0
  13. package/dist/libs/conversation-cards/src/conversation-ai.service.d.ts +13 -0
  14. package/dist/libs/conversation-cards/src/conversation-ai.service.js +58 -0
  15. package/dist/libs/conversation-cards/src/conversation-ai.service.js.map +1 -0
  16. package/dist/libs/conversation-cards/src/conversation-cards.module.d.ts +2 -0
  17. package/dist/libs/conversation-cards/src/conversation-cards.module.js +28 -0
  18. package/dist/libs/conversation-cards/src/conversation-cards.module.js.map +1 -0
  19. package/dist/libs/conversation-cards/src/conversation-cards.service.d.ts +2 -0
  20. package/dist/libs/conversation-cards/src/conversation-cards.service.js +17 -0
  21. package/dist/libs/conversation-cards/src/conversation-cards.service.js.map +1 -0
  22. package/dist/libs/conversation-cards/src/conversation.controller.d.ts +3 -0
  23. package/dist/libs/conversation-cards/src/conversation.controller.js +33 -0
  24. package/dist/libs/conversation-cards/src/conversation.controller.js.map +1 -0
  25. package/dist/libs/conversation-cards/src/dto/create-conversation.dto.d.ts +17 -0
  26. package/dist/libs/conversation-cards/src/dto/create-conversation.dto.js +42 -0
  27. package/dist/libs/conversation-cards/src/dto/create-conversation.dto.js.map +1 -0
  28. package/dist/libs/conversation-cards/src/entities/conversation.entity.d.ts +67 -0
  29. package/dist/libs/conversation-cards/src/entities/conversation.entity.js +97 -0
  30. package/dist/libs/conversation-cards/src/entities/conversation.entity.js.map +1 -0
  31. package/dist/libs/conversation-cards/src/index.d.ts +2 -0
  32. package/dist/libs/conversation-cards/src/index.js +19 -0
  33. package/dist/libs/conversation-cards/src/index.js.map +1 -0
  34. package/dist/libs/conversation-cards/src/tts/tts-service.d.ts +20 -0
  35. package/dist/libs/conversation-cards/src/tts/tts-service.js +124 -0
  36. package/dist/libs/conversation-cards/src/tts/tts-service.js.map +1 -0
  37. package/dist/libs/conversation-cards/src/tts/tts.classes.d.ts +32 -0
  38. package/dist/libs/conversation-cards/src/tts/tts.classes.js +200 -0
  39. package/dist/libs/conversation-cards/src/tts/tts.classes.js.map +1 -0
  40. package/dist/libs/conversation-cards/src/tts/voices.d.ts +3 -0
  41. package/dist/libs/conversation-cards/src/tts/voices.js +208 -0
  42. package/dist/libs/conversation-cards/src/tts/voices.js.map +1 -0
  43. package/dist/src/common/app-exception.d.ts +28 -0
  44. package/dist/src/common/app-exception.js +28 -0
  45. package/dist/src/common/app-exception.js.map +1 -0
  46. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  47. package/package.json +1 -1
  48. package/readme.md +14 -0
@@ -0,0 +1,12 @@
1
+ import { Model } from 'mongoose';
2
+ import { ChatCompletionMessageParam } from 'groq-sdk/resources/chat/completions';
3
+ import { ChatMessageDict } from './clases/conversation.interface';
4
+ import { ConversationDocument } from './entities/conversation.entity';
5
+ export declare class IAModelsService {
6
+ private conversationModel;
7
+ private readonly groqClient;
8
+ constructor(conversationModel: Model<ConversationDocument>);
9
+ chat(messages: ChatCompletionMessageParam[]): Promise<ChatMessageDict>;
10
+ generateCompletion(prompt: string): Promise<string>;
11
+ getCompletion(prompt: string): Promise<string>;
12
+ }
@@ -0,0 +1,82 @@
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.IAModelsService = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const mongoose_1 = require("@nestjs/mongoose");
18
+ const mongoose_2 = require("mongoose");
19
+ const groq_sdk_1 = require("groq-sdk");
20
+ const conversation_interface_1 = require("./clases/conversation.interface");
21
+ const conversation_entity_1 = require("./entities/conversation.entity");
22
+ let IAModelsService = class IAModelsService {
23
+ constructor(conversationModel) {
24
+ this.conversationModel = conversationModel;
25
+ this.groqClient = new groq_sdk_1.default({
26
+ apiKey: process.env['GROQ_API_KEY'],
27
+ });
28
+ }
29
+ async chat(messages) {
30
+ try {
31
+ const completion = await this.groqClient.chat.completions.create({
32
+ messages,
33
+ model: 'mixtral-8x7b-32768',
34
+ temperature: 0.7,
35
+ max_tokens: 1024,
36
+ });
37
+ return {
38
+ content: completion.choices[0]?.message?.content || '',
39
+ role: conversation_interface_1.ChatRole.Assistant,
40
+ metadata: null,
41
+ };
42
+ }
43
+ catch (error) {
44
+ throw new Error(`Failed to generate completion: ${error.message}`);
45
+ }
46
+ }
47
+ async generateCompletion(prompt) {
48
+ try {
49
+ const completion = await this.groqClient.chat.completions.create({
50
+ messages: [{ role: 'user', content: prompt }],
51
+ model: 'mixtral-8x7b-32768',
52
+ temperature: 0.7,
53
+ max_tokens: 1024,
54
+ });
55
+ return completion.choices[0]?.message?.content || '';
56
+ }
57
+ catch (error) {
58
+ throw new Error(`Failed to generate completion: ${error.message}`);
59
+ }
60
+ }
61
+ async getCompletion(prompt) {
62
+ try {
63
+ const completion = await this.groqClient.chat.completions.create({
64
+ messages: [{ role: 'user', content: prompt }],
65
+ model: 'mixtral-8x7b-32768',
66
+ temperature: 0.7,
67
+ max_tokens: 1024,
68
+ });
69
+ return completion.choices[0]?.message?.content || '';
70
+ }
71
+ catch (error) {
72
+ throw new Error(`Failed to generate completion: ${error.message}`);
73
+ }
74
+ }
75
+ };
76
+ exports.IAModelsService = IAModelsService;
77
+ exports.IAModelsService = IAModelsService = __decorate([
78
+ (0, common_1.Injectable)(),
79
+ __param(0, (0, mongoose_1.InjectModel)(conversation_entity_1.Conversation.name)),
80
+ __metadata("design:paramtypes", [mongoose_2.Model])
81
+ ], IAModelsService);
82
+ //# sourceMappingURL=ai-models.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-models.service.js","sourceRoot":"","sources":["../../../../src/ai-models.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,+CAA+C;AAC/C,uCAAiC;AACjC,uCAA4B;AAG5B,4EAA4E;AAC5E,wEAAoF;AAG7E,IAAM,eAAe,GAArB,MAAM,eAAe;IAG1B,YAAoD,iBAA8C;QAA9C,sBAAiB,GAAjB,iBAAiB,CAA6B;QAChG,IAAI,CAAC,UAAU,GAAG,IAAI,kBAAI,CAAC;YACzB,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;SACpC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,QAAsC;QAC/C,IAAI;YACF,MAAM,UAAU,GAAG,MAAM,IAAI,C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AK,EAAE,oBAAoB;gBAC3B,WAAW,EAAE,GAAG;gBAChB,UAAU,EAAE,IAAI;aACjB,CAAC,CAAC;YAEH,OAAO,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,IAAI,EAAE,CAAC;SACtD;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,IAAI,KAAK,CAAC,kCAAkC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;SACpE;IACH,CAAC;CACF,CAAA;AAxDY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAU,GAAE;IAIE,WAAA,IAAA,sBAAW,EAAC,kCAAY,CAAC,IAAI,CAAC,CAAA;qCAA4B,gBAAK;GAHjE,eAAe,CAwD3B"}
@@ -0,0 +1,160 @@
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 CharacterCardDC {
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 IConversation {
118
+ isPublic: any;
119
+ _id: any;
120
+ id: string;
121
+ card: CharacterCardDC;
122
+ title: string;
123
+ image: any;
124
+ voice: string;
125
+ secondaryVoice: string;
126
+ isPublished: boolean;
127
+ authorId: string;
128
+ authorEmail: string;
129
+ takenCount: number;
130
+ lang: string;
131
+ textEngine: TextEngines;
132
+ ConversationType: ConversationType;
133
+ }
134
+ export interface IConversationCard {
135
+ version: string;
136
+ id: string;
137
+ title: string;
138
+ assets: {
139
+ image: any;
140
+ };
141
+ characterCard: CharacterCardDC;
142
+ textEngine: TextEngines;
143
+ conversationType: ConversationType;
144
+ lang: string;
145
+ tts: {
146
+ voice: string;
147
+ secondaryVoice: string;
148
+ speed: string;
149
+ speedRate: number;
150
+ };
151
+ metaApp: {
152
+ isPublished: boolean;
153
+ isPublic: any;
154
+ authorId: string;
155
+ authorEmail: string;
156
+ createdAt: Date;
157
+ updatedAt: Date;
158
+ takenCount: number;
159
+ };
160
+ }
@@ -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,22 @@
1
+ import { FastifyReply } from 'fastify';
2
+ import { ConversationAiService } from './conversation-ai.service';
3
+ import { ConversationDTO } from './dto/create-conversation.dto';
4
+ import { ChatMessageDict, IConversationCard } from './clases/conversation.interface';
5
+ import { Conversation, ConversationDocument } from './entities/conversation.entity';
6
+ import { TTSDto } from './tts/tts.classes';
7
+ import { TTSService } from './tts/tts-service';
8
+ import { IAModelsService } from './ai-models.service';
9
+ export declare class ConversationAiController {
10
+ private readonly conversationAiService;
11
+ private readonly aiModel;
12
+ private readonly ttsService;
13
+ constructor(conversationAiService: ConversationAiService, aiModel: IAModelsService, ttsService: TTSService);
14
+ getConversations(): Promise<ConversationDocument[]>;
15
+ saveConversation(conversation: IConversationCard): Promise<ConversationDocument>;
16
+ getConversationById(id: string): Promise<ConversationDocument>;
17
+ updateConversation(id: string, updateData: Partial<Conversation>): Promise<ConversationDocument>;
18
+ deleteConversationById(id: string): Promise<ConversationDocument>;
19
+ continueConversation(conversation: ConversationDTO): Promise<ChatMessageDict>;
20
+ getTTS(tts: TTSDto, res: FastifyReply): Promise<any>;
21
+ test(): Promise<string>;
22
+ }
@@ -0,0 +1,153 @@
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("./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 tts_classes_1 = require("./tts/tts.classes");
23
+ const tts_service_1 = require("./tts/tts-service");
24
+ const ai_models_service_1 = require("./ai-models.service");
25
+ let ConversationAiController = class ConversationAiController {
26
+ constructor(conversationAiService, aiModel, ttsService) {
27
+ this.conversationAiService = conversationAiService;
28
+ this.aiModel = aiModel;
29
+ this.ttsService = ttsService;
30
+ }
31
+ async getConversations() {
32
+ console.log('getConversations');
33
+ return this.conversationAiService.getConversations();
34
+ }
35
+ async saveConversation(conversation) {
36
+ return this.conversationAiService.saveConversation(conversation);
37
+ }
38
+ async getConversationById(id) {
39
+ return this.conversationAiService.getConversationById(id);
40
+ }
41
+ async updateConversation(id, updateData) {
42
+ return this.conversationAiService.updateConversation(id, updateData);
43
+ }
44
+ async deleteConversationById(id) {
45
+ return this.conversationAiService.deleteConversationById(id);
46
+ }
47
+ async continueConversation(conversation) {
48
+ const messages = conversation.messages;
49
+ console.log('messages', messages);
50
+ const response = await this.aiModel.chat(messages);
51
+ console.log('response', response);
52
+ return response;
53
+ }
54
+ async getTTS(tts, res) {
55
+ console.log('tts', tts);
56
+ const { audioContent, voiceName } = await this.ttsService.getSpeech({
57
+ voiceName: tts.voice,
58
+ text: tts.text,
59
+ options: {},
60
+ lang: null,
61
+ isSsml: tts.ssml,
62
+ });
63
+ res.header('Content-Type', 'audio/mpeg');
64
+ res.header('Content-Disposition', `attachment; filename="${voiceName}.mp3"`);
65
+ res.header('Content-Length', audioContent.length);
66
+ res.header('transcription', 'This is a transcription');
67
+ return audioContent;
68
+ }
69
+ async test() {
70
+ return 'Hello World' + conversation_interface_1.TextEngines.MarkdownMultiMessages;
71
+ }
72
+ };
73
+ exports.ConversationAiController = ConversationAiController;
74
+ __decorate([
75
+ (0, common_1.Get)('/conversation'),
76
+ (0, swagger_1.ApiOperation)({ summary: 'Get all conversations' }),
77
+ (0, swagger_1.ApiResponse)({ status: 200, description: 'Return all conversations.' }),
78
+ __metadata("design:type", Function),
79
+ __metadata("design:paramtypes", []),
80
+ __metadata("design:returntype", Promise)
81
+ ], ConversationAiController.prototype, "getConversations", null);
82
+ __decorate([
83
+ (0, common_1.Post)('/conversation'),
84
+ (0, swagger_1.ApiOperation)({ summary: 'Save new conversations' }),
85
+ (0, swagger_1.ApiResponse)({ status: 201, description: 'The conversation has been successfully created.', type: conversation_entity_1.Conversation }),
86
+ __param(0, (0, common_1.Body)()),
87
+ __metadata("design:type", Function),
88
+ __metadata("design:paramtypes", [Object]),
89
+ __metadata("design:returntype", Promise)
90
+ ], ConversationAiController.prototype, "saveConversation", null);
91
+ __decorate([
92
+ (0, common_1.Get)('/conversation/:id'),
93
+ (0, swagger_1.ApiOperation)({ summary: 'Get a conversation by ID' }),
94
+ (0, swagger_1.ApiResponse)({ status: 200, description: 'Return the conversation.' }),
95
+ __param(0, (0, common_1.Param)('id')),
96
+ __metadata("design:type", Function),
97
+ __metadata("design:paramtypes", [String]),
98
+ __metadata("design:returntype", Promise)
99
+ ], ConversationAiController.prototype, "getConversationById", null);
100
+ __decorate([
101
+ (0, common_1.Put)('/conversation/:id'),
102
+ (0, swagger_1.ApiOperation)({ summary: 'Update a conversation by ID' }),
103
+ (0, swagger_1.ApiResponse)({ status: 200, description: 'The conversation has been successfully updated.', type: conversation_entity_1.Conversation }),
104
+ __param(0, (0, common_1.Param)('id')),
105
+ __param(1, (0, common_1.Body)()),
106
+ __metadata("design:type", Function),
107
+ __metadata("design:paramtypes", [String, Object]),
108
+ __metadata("design:returntype", Promise)
109
+ ], ConversationAiController.prototype, "updateConversation", null);
110
+ __decorate([
111
+ (0, common_1.Delete)('/conversation/:id'),
112
+ (0, swagger_1.ApiOperation)({ summary: 'Delete a conversation by ID' }),
113
+ (0, swagger_1.ApiResponse)({ status: 200, description: 'Return the deleted conversation.' }),
114
+ __param(0, (0, common_1.Param)('id')),
115
+ __metadata("design:type", Function),
116
+ __metadata("design:paramtypes", [String]),
117
+ __metadata("design:returntype", Promise)
118
+ ], ConversationAiController.prototype, "deleteConversationById", null);
119
+ __decorate([
120
+ (0, common_1.Post)('/chat'),
121
+ (0, swagger_1.ApiOperation)({ summary: 'Continue the conversation' }),
122
+ (0, swagger_1.ApiResponse)({ status: 200, description: 'Return the conversation.' }),
123
+ __param(0, (0, common_1.Body)()),
124
+ __metadata("design:type", Function),
125
+ __metadata("design:paramtypes", [create_conversation_dto_1.ConversationDTO]),
126
+ __metadata("design:returntype", Promise)
127
+ ], ConversationAiController.prototype, "continueConversation", null);
128
+ __decorate([
129
+ (0, common_1.Post)('/tts'),
130
+ (0, swagger_1.ApiOperation)({ summary: 'Generate TTS audio' }),
131
+ (0, swagger_1.ApiResponse)({ status: 200, description: 'Return the TTS audio.' }),
132
+ __param(0, (0, common_1.Body)()),
133
+ __param(1, (0, common_1.Res)({ passthrough: true })),
134
+ __metadata("design:type", Function),
135
+ __metadata("design:paramtypes", [tts_classes_1.TTSDto, Object]),
136
+ __metadata("design:returntype", Promise)
137
+ ], ConversationAiController.prototype, "getTTS", null);
138
+ __decorate([
139
+ (0, common_1.Get)('/test'),
140
+ (0, swagger_1.ApiOperation)({ summary: 'Test the conversation AI' }),
141
+ (0, swagger_1.ApiResponse)({ status: 200, description: 'Return the test result.' }),
142
+ __metadata("design:type", Function),
143
+ __metadata("design:paramtypes", []),
144
+ __metadata("design:returntype", Promise)
145
+ ], ConversationAiController.prototype, "test", null);
146
+ exports.ConversationAiController = ConversationAiController = __decorate([
147
+ (0, swagger_1.ApiTags)('conversation-ai-cards'),
148
+ (0, common_1.Controller)('api/conversation-ai-cards'),
149
+ __metadata("design:paramtypes", [conversation_ai_service_1.ConversationAiService,
150
+ ai_models_service_1.IAModelsService,
151
+ tts_service_1.TTSService])
152
+ ], ConversationAiController);
153
+ //# sourceMappingURL=conversation-ai.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversation-ai.controller.js","sourceRoot":"","sources":["../../../../src/conversation-ai.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAsF;AACtF,6CAAqE;AAGrE,uEAAkE;AAClE,2EAAgE;AAChE,4EAAkG;AAClG,wEAAoF;AACpF,mDAA2C;AAC3C,mDAA+C;AAC/C,2DAAsD;AAI/C,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IACnC,YACmB,qBAA4C,EAC5C,OAAwB,EAExB,UAAsB;QAHtB,0BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,YAAO,GAAP,OAAO,CAAiB;QAExB,eAAU,GAAV,UAAU,CAAY;IACtC,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;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,CAAC,sBAAsB,CAAc,EAAU;QAClD,OAAO,IAAI,CAAC,qBAAqB,CAAC,sBAAsB,CAAC,EAAE,CAAC,CAAC;IAC/D,CAAC;IAKK,AAAN,KAAK,CAAC,oBAAoB,CAAS,YAA6B;QAC9D,MAAM,QAAQ,GAA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O,EAAE,2BAA2B,EAAE,CAAC;IACtD,IAAA,qBAAW,EAAC,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,0BAA0B,EAAE,CAAC;IAC1C,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAe,yCAAe;;oEAM/D;AAKK;IAHL,IAAA,aAAI,EAAC,MAAM,CAAC;IACZ,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,oBAAoB,EAAE,CAAC;IAC/C,IAAA,qBAAW,EAAC,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC;IACrD,WAAA,IAAA,aAAI,GAAE,CAAA;IAAe,WAAA,IAAA,YAAG,EAAC,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAA;;qCAAnC,oBAAM;;sDAgB/B;AAKK;IAHL,IAAA,YAAG,EAAC,OAAO,CAAC;IACZ,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,0BAA0B,EAAE,CAAC;IACrD,IAAA,qBAAW,EAAC,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;;;;oDAIpE;mCAlFU,wBAAwB;IAFpC,IAAA,iBAAO,EAAC,uBAAuB,CAAC;IAChC,IAAA,mBAAU,EAAC,2BAA2B,CAAC;qCAGI,+CAAqB;QACnC,mCAAe;QAEZ,wBAAU;GAL9B,wBAAwB,CAmFpC"}
@@ -0,0 +1,2 @@
1
+ export declare class ConversationAiModule {
2
+ }
@@ -0,0 +1,28 @@
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.ConversationAiModule = void 0;
10
+ const common_1 = require("@nestjs/common");
11
+ const mongoose_1 = require("@nestjs/mongoose");
12
+ const conversation_ai_controller_1 = require("./conversation-ai.controller");
13
+ const conversation_ai_service_1 = require("./conversation-ai.service");
14
+ const conversation_entity_1 = require("./entities/conversation.entity");
15
+ const tts_service_1 = require("./tts/tts-service");
16
+ const ai_models_service_1 = require("./ai-models.service");
17
+ let ConversationAiModule = class ConversationAiModule {
18
+ };
19
+ exports.ConversationAiModule = ConversationAiModule;
20
+ exports.ConversationAiModule = ConversationAiModule = __decorate([
21
+ (0, common_1.Module)({
22
+ imports: [mongoose_1.MongooseModule.forFeature([{ name: conversation_entity_1.Conversation.name, schema: conversation_entity_1.ConversationSchema }])],
23
+ controllers: [conversation_ai_controller_1.ConversationAiController],
24
+ providers: [conversation_ai_service_1.ConversationAiService, tts_service_1.TTSService, ai_models_service_1.IAModelsService],
25
+ exports: [conversation_ai_service_1.ConversationAiService, tts_service_1.TTSService, ai_models_service_1.IAModelsService],
26
+ })
27
+ ], ConversationAiModule);
28
+ //# sourceMappingURL=conversation-ai.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversation-ai.module.js","sourceRoot":"","sources":["../../../../src/conversation-ai.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,+CAAkD;AAClD,6EAAwE;AACxE,uEAAkE;AAClE,wEAAkF;AAClF,mDAA+C;AAC/C,2DAAsD;AAQ/C,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;CAAG,CAAA;AAAvB,oDAAoB;+BAApB,oBAAoB;IANhC,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,wBAAU,EAAE,mCAAe,CAAC;QAC/D,OAAO,EAAE,CAAC,+CAAqB,EAAE,wBAAU,EAAE,mCAAe,CAAC;KAC9D,CAAC;GACW,oBAAoB,CAAG"}
@@ -0,0 +1,13 @@
1
+ import { Model } from 'mongoose';
2
+ import { IConversationCard } from './clases/conversation.interface';
3
+ import { Conversation, ConversationDocument } from './entities/conversation.entity';
4
+ export declare class ConversationAiService {
5
+ private conversationModel;
6
+ private readonly groqClient;
7
+ constructor(conversationModel: Model<ConversationDocument>);
8
+ saveConversation(conversation: IConversationCard): Promise<ConversationDocument>;
9
+ updateConversation(id: string, updateData: Partial<Conversation>): Promise<ConversationDocument>;
10
+ getConversations(): Promise<ConversationDocument[]>;
11
+ getConversationById(id: string): Promise<ConversationDocument>;
12
+ deleteConversationById(id: string): Promise<ConversationDocument>;
13
+ }
@@ -0,0 +1,58 @@
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.ConversationAiService = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const mongoose_1 = require("@nestjs/mongoose");
18
+ const mongoose_2 = require("mongoose");
19
+ const groq_sdk_1 = require("groq-sdk");
20
+ const mongodb_1 = require("mongodb");
21
+ const conversation_entity_1 = require("./entities/conversation.entity");
22
+ let ConversationAiService = class ConversationAiService {
23
+ constructor(conversationModel) {
24
+ this.conversationModel = conversationModel;
25
+ this.groqClient = new groq_sdk_1.default({
26
+ apiKey: process.env['GROQ_API_KEY'],
27
+ });
28
+ }
29
+ async saveConversation(conversation) {
30
+ if (!conversation['_id']) {
31
+ delete conversation['_id'];
32
+ }
33
+ const newConversation = new this.conversationModel(conversation);
34
+ return newConversation.save();
35
+ }
36
+ async updateConversation(id, updateData) {
37
+ const _id = new mongodb_1.ObjectId(id);
38
+ return this.conversationModel.findByIdAndUpdate(_id, updateData, { new: true }).exec();
39
+ }
40
+ async getConversations() {
41
+ return this.conversationModel.find().exec();
42
+ }
43
+ async getConversationById(id) {
44
+ const _id = new mongodb_1.ObjectId(id);
45
+ return this.conversationModel.findById(_id).exec();
46
+ }
47
+ async deleteConversationById(id) {
48
+ const _id = new mongodb_1.ObjectId(id);
49
+ return this.conversationModel.findByIdAndDelete(_id).exec();
50
+ }
51
+ };
52
+ exports.ConversationAiService = ConversationAiService;
53
+ exports.ConversationAiService = ConversationAiService = __decorate([
54
+ (0, common_1.Injectable)(),
55
+ __param(0, (0, mongoose_1.InjectModel)(conversation_entity_1.Conversation.name)),
56
+ __metadata("design:paramtypes", [mongoose_2.Model])
57
+ ], ConversationAiService);
58
+ //# sourceMappingURL=conversation-ai.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversation-ai.service.js","sourceRoot":"","sources":["../../../../src/conversation-ai.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,+CAA+C;AAC/C,uCAAiC;AACjC,uCAA4B;AAE5B,qCAAmC;AAGnC,wEAAoF;AAG7E,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IA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AC;CACF,CAAA;AApCY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,mBAAU,GAAE;IAIE,WAAA,IAAA,sBAAW,EAAC,kCAAY,CAAC,IAAI,CAAC,CAAA;qCAA4B,gBAAK;GAHjE,qBAAqB,CAoCjC"}
@@ -0,0 +1,2 @@
1
+ export declare class ConversationCardsModule {
2
+ }
@@ -0,0 +1,28 @@
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("./conversation-ai.controller");
13
+ const conversation_ai_service_1 = require("./conversation-ai.service");
14
+ const conversation_entity_1 = require("./entities/conversation.entity");
15
+ const tts_service_1 = require("./tts/tts-service");
16
+ const ai_models_service_1 = require("./ai-models.service");
17
+ let ConversationCardsModule = class ConversationCardsModule {
18
+ };
19
+ exports.ConversationCardsModule = ConversationCardsModule;
20
+ exports.ConversationCardsModule = ConversationCardsModule = __decorate([
21
+ (0, common_1.Module)({
22
+ imports: [mongoose_1.MongooseModule.forFeature([{ name: conversation_entity_1.Conversation.name, schema: conversation_entity_1.ConversationSchema }])],
23
+ controllers: [conversation_ai_controller_1.ConversationAiController],
24
+ providers: [conversation_ai_service_1.ConversationAiService, tts_service_1.TTSService, ai_models_service_1.IAModelsService],
25
+ exports: [conversation_ai_service_1.ConversationAiService, ai_models_service_1.IAModelsService, tts_service_1.TTSService],
26
+ })
27
+ ], ConversationCardsModule);
28
+ //# 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,6EAAwE;AACxE,uEAAkE;AAClE,wEAAkF;AAClF,mDAA+C;AAC/C,2DAAsD;AAQ/C,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,wBAAU,EAAE,mCAAe,CAAC;QAC/D,OAAO,EAAE,CAAC,+CAAqB,EAAE,mCAAe,EAAE,wBAAU,CAAC;KAC9D,CAAC;GACW,uBAAuB,CAAG"}
@@ -0,0 +1,2 @@
1
+ export declare class ConversationCardsService {
2
+ }