@dataclouder/conversation-card-nestjs 0.0.21 → 0.0.23
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{libs/conversation-cards/src/ai-models.service.d.ts → ai-models.service.d.ts} +1 -0
- package/dist/ai-models.service.d.ts.map +1 -0
- package/dist/ai-models.service.js +71 -173
- package/dist/ai-models.service.js.map +1 -0
- package/dist/{libs/conversation-cards/src/clases → clases}/conversation.interface.d.ts +3 -19
- package/dist/clases/conversation.interface.d.ts.map +1 -0
- package/dist/clases/conversation.interface.js +9 -20
- package/dist/clases/conversation.interface.js.map +1 -0
- package/dist/{libs/conversation-cards/src → controllers}/conversation-ai.controller.d.ts +8 -11
- package/dist/controllers/conversation-ai.controller.d.ts.map +1 -0
- package/dist/{libs/conversation-cards/src → controllers}/conversation-ai.controller.js +19 -36
- package/dist/controllers/conversation-ai.controller.js.map +1 -0
- package/dist/{libs/conversation-cards/src → controllers}/conversation.controller.d.ts +1 -0
- package/dist/controllers/conversation.controller.d.ts.map +1 -0
- package/dist/controllers/conversation.controller.js.map +1 -0
- package/dist/conversation-ai.controller.d.ts +18 -0
- package/dist/conversation-ai.controller.d.ts.map +1 -0
- package/dist/conversation-ai.controller.js +117 -209
- package/dist/conversation-ai.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 +22 -69
- package/dist/conversation-cards.module.js.map +1 -0
- package/dist/conversation.controller.d.ts +4 -0
- package/dist/conversation.controller.d.ts.map +1 -0
- package/dist/conversation.controller.js +27 -106
- package/dist/conversation.controller.js.map +1 -0
- package/dist/{libs/conversation-cards/src/dto → dto}/create-conversation.dto.d.ts +1 -0
- package/dist/dto/create-conversation.dto.d.ts.map +1 -0
- package/dist/dto/create-conversation.dto.js +35 -78
- package/dist/dto/create-conversation.dto.js.map +1 -0
- package/dist/{libs/conversation-cards/src/entities → entities}/conversation.entity.d.ts +3 -2
- package/dist/entities/conversation.entity.d.ts.map +1 -0
- package/dist/entities/conversation.entity.js +84 -145
- package/dist/entities/conversation.entity.js.map +1 -0
- package/dist/{libs/conversation-cards/src/index.d.ts → index.d.ts} +3 -3
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -3
- 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 -27
- package/dist/services/audio-transcription.service.js.map +1 -0
- package/dist/{libs/conversation-cards/src/services → services}/conversation-ai.service.d.ts +15 -0
- package/dist/services/conversation-ai.service.d.ts.map +1 -0
- package/dist/services/conversation-ai.service.js +74 -143
- 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/{libs/conversation-cards/src/ai-models.service.js → services/conversation-card-models.service.js} +8 -8
- 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 +12 -58
- 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 -250
- package/dist/tts/tts-service.js.map +1 -0
- package/dist/{libs/conversation-cards/src/tts → tts}/tts.classes.d.ts +1 -0
- package/dist/tts/tts.classes.d.ts.map +1 -0
- package/dist/tts/tts.classes.js +3 -13
- package/dist/tts/tts.classes.js.map +1 -0
- package/dist/{libs/conversation-cards/src/tts → tts}/voices.d.ts +1 -0
- package/dist/tts/voices.d.ts.map +1 -0
- package/dist/tts/voices.js +1 -10
- package/dist/tts/voices.js.map +1 -0
- package/package.json +1 -1
- package/dist/conversation-ai.module.js +0 -74
- package/dist/libs/conversation-cards/src/ai-models.service.js.map +0 -1
- package/dist/libs/conversation-cards/src/clases/conversation.interface.js +0 -40
- package/dist/libs/conversation-cards/src/clases/conversation.interface.js.map +0 -1
- package/dist/libs/conversation-cards/src/conversation-ai.controller.js.map +0 -1
- package/dist/libs/conversation-cards/src/conversation-ai.module.d.ts +0 -2
- package/dist/libs/conversation-cards/src/conversation-ai.module.js +0 -28
- package/dist/libs/conversation-cards/src/conversation-ai.module.js.map +0 -1
- package/dist/libs/conversation-cards/src/conversation-cards.module.d.ts +0 -2
- package/dist/libs/conversation-cards/src/conversation-cards.module.js +0 -28
- package/dist/libs/conversation-cards/src/conversation-cards.module.js.map +0 -1
- package/dist/libs/conversation-cards/src/conversation.controller.js.map +0 -1
- package/dist/libs/conversation-cards/src/dto/create-conversation.dto.js +0 -42
- package/dist/libs/conversation-cards/src/dto/create-conversation.dto.js.map +0 -1
- package/dist/libs/conversation-cards/src/entities/conversation.entity.js +0 -97
- package/dist/libs/conversation-cards/src/entities/conversation.entity.js.map +0 -1
- package/dist/libs/conversation-cards/src/index.js +0 -24
- package/dist/libs/conversation-cards/src/index.js.map +0 -1
- package/dist/libs/conversation-cards/src/services/audio-transcription.service.d.ts +0 -0
- package/dist/libs/conversation-cards/src/services/audio-transcription.service.js +0 -1
- package/dist/libs/conversation-cards/src/services/audio-transcription.service.js.map +0 -1
- package/dist/libs/conversation-cards/src/services/conversation-ai.service.js +0 -58
- package/dist/libs/conversation-cards/src/services/conversation-ai.service.js.map +0 -1
- package/dist/libs/conversation-cards/src/services/conversation-cards.service.d.ts +0 -2
- package/dist/libs/conversation-cards/src/services/conversation-cards.service.js +0 -17
- package/dist/libs/conversation-cards/src/services/conversation-cards.service.js.map +0 -1
- package/dist/libs/conversation-cards/src/tts/tts-service.d.ts +0 -20
- package/dist/libs/conversation-cards/src/tts/tts-service.js +0 -124
- package/dist/libs/conversation-cards/src/tts/tts-service.js.map +0 -1
- package/dist/libs/conversation-cards/src/tts/tts.classes.js +0 -200
- package/dist/libs/conversation-cards/src/tts/tts.classes.js.map +0 -1
- package/dist/libs/conversation-cards/src/tts/voices.js +0 -208
- package/dist/libs/conversation-cards/src/tts/voices.js.map +0 -1
- package/dist/src/common/app-exception.d.ts +0 -28
- package/dist/src/common/app-exception.js +0 -28
- package/dist/src/common/app-exception.js.map +0 -1
- package/dist/tsconfig.lib.tsbuildinfo +0 -1
- /package/dist/{libs/conversation-cards/src → controllers}/conversation.controller.js +0 -0
@@ -1,216 +1,124 @@
|
|
1
1
|
"use strict";
|
2
|
-
var
|
3
|
-
var
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
return useValue ? value : void 0;
|
8
|
-
};
|
9
|
-
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
10
|
-
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
11
|
-
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
12
|
-
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
13
|
-
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
14
|
-
var _, done = false;
|
15
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
16
|
-
var context = {};
|
17
|
-
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
18
|
-
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
19
|
-
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
20
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
21
|
-
if (kind === "accessor") {
|
22
|
-
if (result === void 0) continue;
|
23
|
-
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
24
|
-
if (_ = accept(result.get)) descriptor.get = _;
|
25
|
-
if (_ = accept(result.set)) descriptor.set = _;
|
26
|
-
if (_ = accept(result.init)) initializers.unshift(_);
|
27
|
-
}
|
28
|
-
else if (_ = accept(result)) {
|
29
|
-
if (kind === "field") initializers.unshift(_);
|
30
|
-
else descriptor[key] = _;
|
31
|
-
}
|
32
|
-
}
|
33
|
-
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
34
|
-
done = true;
|
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;
|
35
7
|
};
|
36
|
-
var
|
37
|
-
|
38
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
39
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
40
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
41
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
42
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
43
|
-
});
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
44
10
|
};
|
45
|
-
var
|
46
|
-
|
47
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
48
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
49
|
-
function step(op) {
|
50
|
-
if (f) throw new TypeError("Generator is already executing.");
|
51
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
52
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
53
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
54
|
-
switch (op[0]) {
|
55
|
-
case 0: case 1: t = op; break;
|
56
|
-
case 4: _.label++; return { value: op[1], done: false };
|
57
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
58
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
59
|
-
default:
|
60
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
61
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
62
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
63
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
64
|
-
if (t[2]) _.ops.pop();
|
65
|
-
_.trys.pop(); continue;
|
66
|
-
}
|
67
|
-
op = body.call(thisArg, _);
|
68
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
69
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
70
|
-
}
|
71
|
-
};
|
72
|
-
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
|
73
|
-
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
74
|
-
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
75
13
|
};
|
76
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
77
15
|
exports.ConversationAiController = void 0;
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
ConversationAiController_1.prototype.getConversationById = function (id) {
|
118
|
-
return __awaiter(this, void 0, void 0, function () {
|
119
|
-
return __generator(this, function (_a) {
|
120
|
-
return [2 /*return*/, this.conversationAiService.getConversationById(id)];
|
121
|
-
});
|
122
|
-
});
|
123
|
-
};
|
124
|
-
ConversationAiController_1.prototype.updateConversation = function (id, updateData) {
|
125
|
-
return __awaiter(this, void 0, void 0, function () {
|
126
|
-
return __generator(this, function (_a) {
|
127
|
-
return [2 /*return*/, this.conversationAiService.updateConversation(id, updateData)];
|
128
|
-
});
|
129
|
-
});
|
130
|
-
};
|
131
|
-
ConversationAiController_1.prototype.deleteConversationById = function (id) {
|
132
|
-
return __awaiter(this, void 0, void 0, function () {
|
133
|
-
return __generator(this, function (_a) {
|
134
|
-
return [2 /*return*/, this.conversationAiService.deleteConversationById(id)];
|
135
|
-
});
|
136
|
-
});
|
137
|
-
};
|
138
|
-
ConversationAiController_1.prototype.continueConversation = function (conversation) {
|
139
|
-
return __awaiter(this, void 0, void 0, function () {
|
140
|
-
var messages, response;
|
141
|
-
return __generator(this, function (_a) {
|
142
|
-
switch (_a.label) {
|
143
|
-
case 0:
|
144
|
-
messages = conversation.messages;
|
145
|
-
console.log('messages', messages);
|
146
|
-
return [4 /*yield*/, this.aiModel.chat(messages)];
|
147
|
-
case 1:
|
148
|
-
response = _a.sent();
|
149
|
-
console.log('response', response);
|
150
|
-
return [2 /*return*/, response];
|
151
|
-
}
|
152
|
-
});
|
153
|
-
});
|
154
|
-
};
|
155
|
-
ConversationAiController_1.prototype.getTTS = function (tts, res) {
|
156
|
-
return __awaiter(this, void 0, void 0, function () {
|
157
|
-
var _a, audioContent, voiceName;
|
158
|
-
return __generator(this, function (_b) {
|
159
|
-
switch (_b.label) {
|
160
|
-
case 0:
|
161
|
-
console.log('tts', tts);
|
162
|
-
return [4 /*yield*/, this.ttsService.getSpeech({
|
163
|
-
voiceName: tts.voice,
|
164
|
-
text: tts.text,
|
165
|
-
options: {},
|
166
|
-
lang: null,
|
167
|
-
isSsml: tts.ssml,
|
168
|
-
})];
|
169
|
-
case 1:
|
170
|
-
_a = _b.sent(), audioContent = _a.audioContent, voiceName = _a.voiceName;
|
171
|
-
res.header('Content-Type', 'audio/mpeg');
|
172
|
-
res.header('Content-Disposition', "attachment; filename=\"".concat(voiceName, ".mp3\""));
|
173
|
-
res.header('Content-Length', audioContent.length);
|
174
|
-
res.header('transcription', 'This is a transcription');
|
175
|
-
return [2 /*return*/, audioContent];
|
176
|
-
}
|
177
|
-
});
|
178
|
-
});
|
179
|
-
};
|
180
|
-
ConversationAiController_1.prototype.test = function () {
|
181
|
-
return __awaiter(this, void 0, void 0, function () {
|
182
|
-
return __generator(this, function (_a) {
|
183
|
-
// charaCard.save();
|
184
|
-
return [2 /*return*/, 'Hello World' + conversation_interface_1.TextEngines.MarkdownMultiMessages];
|
185
|
-
});
|
186
|
-
});
|
187
|
-
};
|
188
|
-
return ConversationAiController_1;
|
189
|
-
}());
|
190
|
-
__setFunctionName(_classThis, "ConversationAiController");
|
191
|
-
(function () {
|
192
|
-
var _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
193
|
-
_getConversations_decorators = [(0, common_1.Get)('/conversation'), (0, swagger_1.ApiOperation)({ summary: 'Get all conversations' }), (0, swagger_1.ApiResponse)({ status: 200, description: 'Return all conversations.' })];
|
194
|
-
_saveConversation_decorators = [(0, common_1.Post)('/conversation'), (0, swagger_1.ApiOperation)({ summary: 'Save new conversations' }), (0, swagger_1.ApiResponse)({ status: 201, description: 'The conversation has been successfully created.', type: conversation_entity_1.Conversation })];
|
195
|
-
_getConversationById_decorators = [(0, common_1.Get)('/conversation/:id'), (0, swagger_1.ApiOperation)({ summary: 'Get a conversation by ID' }), (0, swagger_1.ApiResponse)({ status: 200, description: 'Return the conversation.' })];
|
196
|
-
_updateConversation_decorators = [(0, common_1.Put)('/conversation/:id'), (0, swagger_1.ApiOperation)({ summary: 'Update a conversation by ID' }), (0, swagger_1.ApiResponse)({ status: 200, description: 'The conversation has been successfully updated.', type: conversation_entity_1.Conversation })];
|
197
|
-
_deleteConversationById_decorators = [(0, common_1.Delete)('/conversation/:id'), (0, swagger_1.ApiOperation)({ summary: 'Delete a conversation by ID' }), (0, swagger_1.ApiResponse)({ status: 200, description: 'Return the deleted conversation.' })];
|
198
|
-
_continueConversation_decorators = [(0, common_1.Post)('/chat'), (0, swagger_1.ApiOperation)({ summary: 'Continue the conversation' }), (0, swagger_1.ApiResponse)({ status: 200, description: 'Return the conversation.' })];
|
199
|
-
_getTTS_decorators = [(0, common_1.Post)('/tts'), (0, swagger_1.ApiOperation)({ summary: 'Generate TTS audio' }), (0, swagger_1.ApiResponse)({ status: 200, description: 'Return the TTS audio.' })];
|
200
|
-
_test_decorators = [(0, common_1.Get)('/test'), (0, swagger_1.ApiOperation)({ summary: 'Test the conversation AI' }), (0, swagger_1.ApiResponse)({ status: 200, description: 'Return the test result.' })];
|
201
|
-
__esDecorate(_classThis, null, _getConversations_decorators, { kind: "method", name: "getConversations", static: false, private: false, access: { has: function (obj) { return "getConversations" in obj; }, get: function (obj) { return obj.getConversations; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
202
|
-
__esDecorate(_classThis, null, _saveConversation_decorators, { kind: "method", name: "saveConversation", static: false, private: false, access: { has: function (obj) { return "saveConversation" in obj; }, get: function (obj) { return obj.saveConversation; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
203
|
-
__esDecorate(_classThis, null, _getConversationById_decorators, { kind: "method", name: "getConversationById", static: false, private: false, access: { has: function (obj) { return "getConversationById" in obj; }, get: function (obj) { return obj.getConversationById; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
204
|
-
__esDecorate(_classThis, null, _updateConversation_decorators, { kind: "method", name: "updateConversation", static: false, private: false, access: { has: function (obj) { return "updateConversation" in obj; }, get: function (obj) { return obj.updateConversation; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
205
|
-
__esDecorate(_classThis, null, _deleteConversationById_decorators, { kind: "method", name: "deleteConversationById", static: false, private: false, access: { has: function (obj) { return "deleteConversationById" in obj; }, get: function (obj) { return obj.deleteConversationById; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
206
|
-
__esDecorate(_classThis, null, _continueConversation_decorators, { kind: "method", name: "continueConversation", static: false, private: false, access: { has: function (obj) { return "continueConversation" in obj; }, get: function (obj) { return obj.continueConversation; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
207
|
-
__esDecorate(_classThis, null, _getTTS_decorators, { kind: "method", name: "getTTS", static: false, private: false, access: { has: function (obj) { return "getTTS" in obj; }, get: function (obj) { return obj.getTTS; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
208
|
-
__esDecorate(_classThis, null, _test_decorators, { kind: "method", name: "test", static: false, private: false, access: { has: function (obj) { return "test" in obj; }, get: function (obj) { return obj.test; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
209
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
210
|
-
ConversationAiController = _classThis = _classDescriptor.value;
|
211
|
-
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
212
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
213
|
-
})();
|
214
|
-
return ConversationAiController = _classThis;
|
215
|
-
}();
|
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 ai_models_service_1 = require("./ai-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 getConversationById(id) {
|
36
|
+
return this.conversationAiService.getConversationById(id);
|
37
|
+
}
|
38
|
+
async updateConversation(id, updateData) {
|
39
|
+
return this.conversationAiService.updateConversation(id, updateData);
|
40
|
+
}
|
41
|
+
async deleteConversationById(id) {
|
42
|
+
return this.conversationAiService.deleteConversationById(id);
|
43
|
+
}
|
44
|
+
async continueConversation(conversation) {
|
45
|
+
const messages = conversation.messages;
|
46
|
+
console.log('messages', messages);
|
47
|
+
const response = await this.aiModel.chat(messages);
|
48
|
+
console.log('response', response);
|
49
|
+
return response;
|
50
|
+
}
|
51
|
+
async test() {
|
52
|
+
return 'Hello World' + conversation_interface_1.TextEngines.MarkdownMultiMessages;
|
53
|
+
}
|
54
|
+
};
|
216
55
|
exports.ConversationAiController = ConversationAiController;
|
56
|
+
__decorate([
|
57
|
+
(0, common_1.Get)('/conversation'),
|
58
|
+
(0, swagger_1.ApiOperation)({ summary: 'Get all conversations' }),
|
59
|
+
(0, swagger_1.ApiResponse)({ status: 200, description: 'Return all conversations.' }),
|
60
|
+
__metadata("design:type", Function),
|
61
|
+
__metadata("design:paramtypes", []),
|
62
|
+
__metadata("design:returntype", Promise)
|
63
|
+
], ConversationAiController.prototype, "getConversations", null);
|
64
|
+
__decorate([
|
65
|
+
(0, common_1.Post)('/conversation'),
|
66
|
+
(0, swagger_1.ApiOperation)({ summary: 'Save new conversations' }),
|
67
|
+
(0, swagger_1.ApiResponse)({ status: 201, description: 'The conversation has been successfully created.', type: conversation_entity_1.Conversation }),
|
68
|
+
__param(0, (0, common_1.Body)()),
|
69
|
+
__metadata("design:type", Function),
|
70
|
+
__metadata("design:paramtypes", [Object]),
|
71
|
+
__metadata("design:returntype", Promise)
|
72
|
+
], ConversationAiController.prototype, "saveConversation", null);
|
73
|
+
__decorate([
|
74
|
+
(0, common_1.Get)('/conversation/:id'),
|
75
|
+
(0, swagger_1.ApiOperation)({ summary: 'Get a conversation by ID' }),
|
76
|
+
(0, swagger_1.ApiResponse)({ status: 200, description: 'Return the conversation.' }),
|
77
|
+
__param(0, (0, common_1.Param)('id')),
|
78
|
+
__metadata("design:type", Function),
|
79
|
+
__metadata("design:paramtypes", [String]),
|
80
|
+
__metadata("design:returntype", Promise)
|
81
|
+
], ConversationAiController.prototype, "getConversationById", null);
|
82
|
+
__decorate([
|
83
|
+
(0, common_1.Put)('/conversation/:id'),
|
84
|
+
(0, swagger_1.ApiOperation)({ summary: 'Update a conversation by ID' }),
|
85
|
+
(0, swagger_1.ApiResponse)({ status: 200, description: 'The conversation has been successfully updated.', type: conversation_entity_1.Conversation }),
|
86
|
+
__param(0, (0, common_1.Param)('id')),
|
87
|
+
__param(1, (0, common_1.Body)()),
|
88
|
+
__metadata("design:type", Function),
|
89
|
+
__metadata("design:paramtypes", [String, Object]),
|
90
|
+
__metadata("design:returntype", Promise)
|
91
|
+
], ConversationAiController.prototype, "updateConversation", null);
|
92
|
+
__decorate([
|
93
|
+
(0, common_1.Delete)('/conversation/:id'),
|
94
|
+
(0, swagger_1.ApiOperation)({ summary: 'Delete a conversation by ID' }),
|
95
|
+
(0, swagger_1.ApiResponse)({ status: 200, description: 'Return the deleted conversation.' }),
|
96
|
+
__param(0, (0, common_1.Param)('id')),
|
97
|
+
__metadata("design:type", Function),
|
98
|
+
__metadata("design:paramtypes", [String]),
|
99
|
+
__metadata("design:returntype", Promise)
|
100
|
+
], ConversationAiController.prototype, "deleteConversationById", null);
|
101
|
+
__decorate([
|
102
|
+
(0, common_1.Post)('/chat'),
|
103
|
+
(0, swagger_1.ApiOperation)({ summary: 'Continue the conversation' }),
|
104
|
+
(0, swagger_1.ApiResponse)({ status: 200, description: 'Return the conversation.' }),
|
105
|
+
__param(0, (0, common_1.Body)()),
|
106
|
+
__metadata("design:type", Function),
|
107
|
+
__metadata("design:paramtypes", [create_conversation_dto_1.ConversationDTO]),
|
108
|
+
__metadata("design:returntype", Promise)
|
109
|
+
], ConversationAiController.prototype, "continueConversation", null);
|
110
|
+
__decorate([
|
111
|
+
(0, common_1.Get)('/test'),
|
112
|
+
(0, swagger_1.ApiOperation)({ summary: 'Test the conversation AI' }),
|
113
|
+
(0, swagger_1.ApiResponse)({ status: 200, description: 'Return the test result.' }),
|
114
|
+
__metadata("design:type", Function),
|
115
|
+
__metadata("design:paramtypes", []),
|
116
|
+
__metadata("design:returntype", Promise)
|
117
|
+
], ConversationAiController.prototype, "test", null);
|
118
|
+
exports.ConversationAiController = ConversationAiController = __decorate([
|
119
|
+
(0, swagger_1.ApiTags)('conversation-ai-cards'),
|
120
|
+
(0, common_1.Controller)('api/conversation-ai-cards'),
|
121
|
+
__metadata("design:paramtypes", [conversation_ai_service_1.ConversationAiService,
|
122
|
+
ai_models_service_1.IAModelsService])
|
123
|
+
], ConversationAiController);
|
124
|
+
//# 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,gFAA2E;AAC3E,2EAAgE;AAChE,4EAAkG;AAClG,wEAAoF;AAGpF,2DAAsD;AAI/C,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IACnC,YACmB,qBAA4C,EAC5C,OAAwB;QADxB,0BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,YAAO,GAAP,OAAO,CAAiB;IAE1C,CAAC;IAKI,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,GAAG,YAAY,CAAC,QAAe,CAAC;QAC9C,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QAClC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACnD,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QAClC,OAAO,QAAQ,CAAC;IAClB,CAAC;IA0BK,AAAN,KAAK,CAAC,IAAI;QAER,OAAO,aAAa,GAAG,oCAAW,CAAC,qBAAqB,CAAC;IAC3D,CAAC;CACF,CAAA;AAlFY,4DAAwB;AAU7B;IAHL,IAAA,YAAG,EAAC,eAAe,CAAC;IACpB,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,uBAAuB,EAAE,CAAC;IAClD,IAAA,qBAAW,EAAC,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC;;;;gEAItE;AAKK;IAHL,IAAA,aAAI,EAAC,eAAe,CAAC;IACrB,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,wBAAwB,EAAE,CAAC;IACnD,IAAA,qBAAW,EAAC,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,iDAAiD,EAAE,IAAI,EAAE,kCAAY,EAAE,CAAC;IACzF,WAAA,IAAA,aAAI,GAAE,CAAA;;;;gEAE7B;AAKK;IAHL,IAAA,YAAG,EAAC,mBAAmB,CAAC;IACxB,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,0BAA0B,EAAE,CAAC;IACrD,IAAA,qBAAW,EAAC,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,0BAA0B,EAAE,CAAC;IAC3C,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;mEAErC;AAKK;IAHL,IAAA,YAAG,EAAC,mBAAmB,CAAC;IACxB,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,6BAA6B,EAAE,CAAC;IACxD,IAAA,qBAAW,EAAC,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,iDAAiD,EAAE,IAAI,EAAE,kCAAY,EAAE,CAAC;IACvF,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;IAAc,WAAA,IAAA,aAAI,GAAE,CAAA;;;;kEAExD;AAKK;IAHL,IAAA,eAAM,EAAC,mBAAmB,CAAC;IAC3B,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,6BAA6B,EAAE,CAAC;IACxD,IAAA,qBAAW,EAAC,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,kCAAkC,EAAE,CAAC;IAChD,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;sEAExC;AAKK;IAHL,IAAA,aAAI,EAAC,OAAO,CAAC;IACb,IAAA,sBAAY,EAAC,EAAE,OAAO,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;AA0BK;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;mCAjFU,wBAAwB;IAFpC,IAAA,iBAAO,EAAC,uBAAuB,CAAC;IAChC,IAAA,mBAAU,EAAC,2BAA2B,CAAC;qCAGI,+CAAqB;QACnC,mCAAe;GAHhC,wBAAwB,CAkFpC"}
|
@@ -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"}
|
@@ -1,74 +1,27 @@
|
|
1
1
|
"use strict";
|
2
|
-
var
|
3
|
-
|
4
|
-
|
5
|
-
var
|
6
|
-
|
7
|
-
var _, done = false;
|
8
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
9
|
-
var context = {};
|
10
|
-
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
11
|
-
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
12
|
-
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
13
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
14
|
-
if (kind === "accessor") {
|
15
|
-
if (result === void 0) continue;
|
16
|
-
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
17
|
-
if (_ = accept(result.get)) descriptor.get = _;
|
18
|
-
if (_ = accept(result.set)) descriptor.set = _;
|
19
|
-
if (_ = accept(result.init)) initializers.unshift(_);
|
20
|
-
}
|
21
|
-
else if (_ = accept(result)) {
|
22
|
-
if (kind === "field") initializers.unshift(_);
|
23
|
-
else descriptor[key] = _;
|
24
|
-
}
|
25
|
-
}
|
26
|
-
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
27
|
-
done = true;
|
28
|
-
};
|
29
|
-
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
30
|
-
var useValue = arguments.length > 2;
|
31
|
-
for (var i = 0; i < initializers.length; i++) {
|
32
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
33
|
-
}
|
34
|
-
return useValue ? value : void 0;
|
35
|
-
};
|
36
|
-
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
|
37
|
-
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
38
|
-
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
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;
|
39
7
|
};
|
40
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
41
9
|
exports.ConversationCardsModule = void 0;
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
var _classDecorators = [(0, common_1.Module)({
|
51
|
-
imports: [mongoose_1.MongooseModule.forFeature([{ name: conversation_entity_1.Conversation.name, schema: conversation_entity_1.ConversationSchema }])],
|
52
|
-
controllers: [conversation_ai_controller_1.ConversationAiController],
|
53
|
-
providers: [conversation_ai_service_1.ConversationAiService, tts_service_1.TTSService, ai_models_service_1.IAModelsService],
|
54
|
-
exports: [conversation_ai_service_1.ConversationAiService, ai_models_service_1.IAModelsService, tts_service_1.TTSService],
|
55
|
-
})];
|
56
|
-
var _classDescriptor;
|
57
|
-
var _classExtraInitializers = [];
|
58
|
-
var _classThis;
|
59
|
-
var ConversationCardsModule = _classThis = /** @class */ (function () {
|
60
|
-
function ConversationCardsModule_1() {
|
61
|
-
}
|
62
|
-
return ConversationCardsModule_1;
|
63
|
-
}());
|
64
|
-
__setFunctionName(_classThis, "ConversationCardsModule");
|
65
|
-
(function () {
|
66
|
-
var _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
67
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
68
|
-
ConversationCardsModule = _classThis = _classDescriptor.value;
|
69
|
-
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
70
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
71
|
-
})();
|
72
|
-
return ConversationCardsModule = _classThis;
|
73
|
-
}();
|
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
|
+
};
|
74
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 @@
|
|
1
|
+
{"version":3,"file":"conversation.controller.d.ts","sourceRoot":"","sources":["../src/conversation.controller.ts"],"names":[],"mappings":"AAGA,qBAEa,wBAAwB;IAI7B,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC;CAGlC"}
|
@@ -1,112 +1,33 @@
|
|
1
1
|
"use strict";
|
2
|
-
var
|
3
|
-
|
4
|
-
|
5
|
-
var
|
6
|
-
|
7
|
-
var _, done = false;
|
8
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
9
|
-
var context = {};
|
10
|
-
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
11
|
-
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
12
|
-
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
13
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
14
|
-
if (kind === "accessor") {
|
15
|
-
if (result === void 0) continue;
|
16
|
-
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
17
|
-
if (_ = accept(result.get)) descriptor.get = _;
|
18
|
-
if (_ = accept(result.set)) descriptor.set = _;
|
19
|
-
if (_ = accept(result.init)) initializers.unshift(_);
|
20
|
-
}
|
21
|
-
else if (_ = accept(result)) {
|
22
|
-
if (kind === "field") initializers.unshift(_);
|
23
|
-
else descriptor[key] = _;
|
24
|
-
}
|
25
|
-
}
|
26
|
-
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
27
|
-
done = true;
|
28
|
-
};
|
29
|
-
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
30
|
-
var useValue = arguments.length > 2;
|
31
|
-
for (var i = 0; i < initializers.length; i++) {
|
32
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
33
|
-
}
|
34
|
-
return useValue ? value : void 0;
|
35
|
-
};
|
36
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
37
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
38
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
39
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
40
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
41
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
42
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
43
|
-
});
|
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;
|
44
7
|
};
|
45
|
-
var
|
46
|
-
|
47
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
48
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
49
|
-
function step(op) {
|
50
|
-
if (f) throw new TypeError("Generator is already executing.");
|
51
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
52
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
53
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
54
|
-
switch (op[0]) {
|
55
|
-
case 0: case 1: t = op; break;
|
56
|
-
case 4: _.label++; return { value: op[1], done: false };
|
57
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
58
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
59
|
-
default:
|
60
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
61
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
62
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
63
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
64
|
-
if (t[2]) _.ops.pop();
|
65
|
-
_.trys.pop(); continue;
|
66
|
-
}
|
67
|
-
op = body.call(thisArg, _);
|
68
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
69
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
70
|
-
}
|
71
|
-
};
|
72
|
-
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
|
73
|
-
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
74
|
-
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
75
10
|
};
|
76
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
77
12
|
exports.ConversationAiController = void 0;
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
var _instanceExtraInitializers = [];
|
86
|
-
var _getCards_decorators;
|
87
|
-
var ConversationAiController = _classThis = /** @class */ (function () {
|
88
|
-
function ConversationAiController_1() {
|
89
|
-
__runInitializers(this, _instanceExtraInitializers);
|
90
|
-
}
|
91
|
-
ConversationAiController_1.prototype.getCards = function () {
|
92
|
-
return __awaiter(this, void 0, void 0, function () {
|
93
|
-
return __generator(this, function (_a) {
|
94
|
-
return [2 /*return*/, 'Hello World'];
|
95
|
-
});
|
96
|
-
});
|
97
|
-
};
|
98
|
-
return ConversationAiController_1;
|
99
|
-
}());
|
100
|
-
__setFunctionName(_classThis, "ConversationAiController");
|
101
|
-
(function () {
|
102
|
-
var _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
103
|
-
_getCards_decorators = [(0, common_1.Get)('/cards'), (0, swagger_1.ApiOperation)({ summary: 'Get the cards' }), (0, swagger_1.ApiResponse)({ status: 200, description: 'Return the cards.' })];
|
104
|
-
__esDecorate(_classThis, null, _getCards_decorators, { kind: "method", name: "getCards", static: false, private: false, access: { has: function (obj) { return "getCards" in obj; }, get: function (obj) { return obj.getCards; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
105
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
106
|
-
ConversationAiController = _classThis = _classDescriptor.value;
|
107
|
-
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
108
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
109
|
-
})();
|
110
|
-
return ConversationAiController = _classThis;
|
111
|
-
}();
|
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
|
+
};
|
112
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/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"}
|