@dataclouder/conversation-card-nestjs 0.0.19 → 0.0.21
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/ai-models.service.js +184 -0
- package/dist/clases/conversation.interface.js +51 -0
- package/dist/conversation-ai.controller.js +216 -0
- package/dist/conversation-ai.module.js +74 -0
- package/dist/conversation-cards.module.js +74 -0
- package/dist/conversation.controller.js +112 -0
- package/dist/dto/create-conversation.dto.js +85 -0
- package/dist/entities/conversation.entity.js +158 -0
- package/dist/index.js +23 -0
- package/dist/libs/conversation-cards/src/conversation-ai.controller.d.ts +1 -1
- package/dist/libs/conversation-cards/src/conversation-ai.controller.js +1 -1
- package/dist/libs/conversation-cards/src/conversation-ai.controller.js.map +1 -1
- package/dist/libs/conversation-cards/src/conversation-ai.module.js +1 -1
- package/dist/libs/conversation-cards/src/conversation-ai.module.js.map +1 -1
- package/dist/libs/conversation-cards/src/conversation-cards.module.js +1 -1
- package/dist/libs/conversation-cards/src/conversation-cards.module.js.map +1 -1
- package/dist/libs/conversation-cards/src/index.d.ts +3 -2
- package/dist/libs/conversation-cards/src/index.js +3 -2
- package/dist/libs/conversation-cards/src/index.js.map +1 -1
- package/dist/libs/conversation-cards/src/services/audio-transcription.service.d.ts +0 -7
- package/dist/libs/conversation-cards/src/services/audio-transcription.service.js +0 -32
- package/dist/libs/conversation-cards/src/services/audio-transcription.service.js.map +1 -1
- package/dist/libs/conversation-cards/src/services/conversation-ai.service.d.ts +1 -1
- package/dist/libs/conversation-cards/src/services/conversation-ai.service.js.map +1 -1
- package/dist/services/audio-transcription.service.js +27 -0
- package/dist/services/conversation-ai.service.js +151 -0
- package/dist/services/conversation-cards.service.js +63 -0
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/tts/tts-service.js +250 -0
- package/dist/tts/tts.classes.js +210 -0
- package/dist/tts/voices.js +217 -0
- package/package.json +1 -1
@@ -0,0 +1,112 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
3
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
4
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
5
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
6
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
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
|
+
});
|
44
|
+
};
|
45
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
46
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
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 });
|
75
|
+
};
|
76
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
77
|
+
exports.ConversationAiController = void 0;
|
78
|
+
var common_1 = require("@nestjs/common");
|
79
|
+
var swagger_1 = require("@nestjs/swagger");
|
80
|
+
var ConversationAiController = function () {
|
81
|
+
var _classDecorators = [(0, swagger_1.ApiTags)('conversation-cards-library'), (0, common_1.Controller)('api/conversation-cards-library')];
|
82
|
+
var _classDescriptor;
|
83
|
+
var _classExtraInitializers = [];
|
84
|
+
var _classThis;
|
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
|
+
}();
|
112
|
+
exports.ConversationAiController = ConversationAiController;
|
@@ -0,0 +1,85 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
3
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
4
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
5
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
6
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
37
|
+
exports.ConversationDTO = exports.CreateConversationDto = void 0;
|
38
|
+
// import { IsString, IsNotEmpty, IsOptional } from 'class-validator';
|
39
|
+
var swagger_1 = require("@nestjs/swagger");
|
40
|
+
var CreateConversationDto = function () {
|
41
|
+
var _a;
|
42
|
+
var _instanceExtraInitializers = [];
|
43
|
+
var _message_decorators;
|
44
|
+
var _message_initializers = [];
|
45
|
+
var _userId_decorators;
|
46
|
+
var _userId_initializers = [];
|
47
|
+
var _context_decorators;
|
48
|
+
var _context_initializers = [];
|
49
|
+
return _a = /** @class */ (function () {
|
50
|
+
function CreateConversationDto() {
|
51
|
+
this.message = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _message_initializers, void 0));
|
52
|
+
this.userId = __runInitializers(this, _userId_initializers, void 0);
|
53
|
+
this.context = __runInitializers(this, _context_initializers, void 0);
|
54
|
+
}
|
55
|
+
return CreateConversationDto;
|
56
|
+
}()),
|
57
|
+
(function () {
|
58
|
+
var _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
59
|
+
_message_decorators = [(0, swagger_1.ApiProperty)({
|
60
|
+
description: 'The message content of the conversation',
|
61
|
+
example: 'Hello, how can I help you today?',
|
62
|
+
})];
|
63
|
+
_userId_decorators = [(0, swagger_1.ApiProperty)({
|
64
|
+
description: 'The user ID associated with the conversation',
|
65
|
+
example: 'user123',
|
66
|
+
})];
|
67
|
+
_context_decorators = [(0, swagger_1.ApiProperty)({
|
68
|
+
description: 'Additional context for the conversation',
|
69
|
+
required: false,
|
70
|
+
example: { previousContext: 'User asked about weather' },
|
71
|
+
})];
|
72
|
+
__esDecorate(null, null, _message_decorators, { kind: "field", name: "message", static: false, private: false, access: { has: function (obj) { return "message" in obj; }, get: function (obj) { return obj.message; }, set: function (obj, value) { obj.message = value; } }, metadata: _metadata }, _message_initializers, _instanceExtraInitializers);
|
73
|
+
__esDecorate(null, null, _userId_decorators, { kind: "field", name: "userId", static: false, private: false, access: { has: function (obj) { return "userId" in obj; }, get: function (obj) { return obj.userId; }, set: function (obj, value) { obj.userId = value; } }, metadata: _metadata }, _userId_initializers, _instanceExtraInitializers);
|
74
|
+
__esDecorate(null, null, _context_decorators, { kind: "field", name: "context", static: false, private: false, access: { has: function (obj) { return "context" in obj; }, get: function (obj) { return obj.context; }, set: function (obj, value) { obj.context = value; } }, metadata: _metadata }, _context_initializers, _instanceExtraInitializers);
|
75
|
+
if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
76
|
+
})(),
|
77
|
+
_a;
|
78
|
+
}();
|
79
|
+
exports.CreateConversationDto = CreateConversationDto;
|
80
|
+
var ConversationDTO = /** @class */ (function () {
|
81
|
+
function ConversationDTO() {
|
82
|
+
}
|
83
|
+
return ConversationDTO;
|
84
|
+
}());
|
85
|
+
exports.ConversationDTO = ConversationDTO;
|
@@ -0,0 +1,158 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
3
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
4
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
5
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
6
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
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 });
|
39
|
+
};
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
41
|
+
exports.ConversationSchema = exports.Conversation = void 0;
|
42
|
+
var mongoose_1 = require("@nestjs/mongoose");
|
43
|
+
var mongoose_2 = require("mongoose");
|
44
|
+
var conversation_interface_1 = require("../clases/conversation.interface");
|
45
|
+
var Conversation = function () {
|
46
|
+
var _classDecorators = [(0, mongoose_1.Schema)({ timestamps: true })];
|
47
|
+
var _classDescriptor;
|
48
|
+
var _classExtraInitializers = [];
|
49
|
+
var _classThis;
|
50
|
+
var _instanceExtraInitializers = [];
|
51
|
+
var __id_decorators;
|
52
|
+
var __id_initializers = [];
|
53
|
+
var _id_decorators;
|
54
|
+
var _id_initializers = [];
|
55
|
+
var _version_decorators;
|
56
|
+
var _version_initializers = [];
|
57
|
+
var _title_decorators;
|
58
|
+
var _title_initializers = [];
|
59
|
+
var _characterCard_decorators;
|
60
|
+
var _characterCard_initializers = [];
|
61
|
+
var _textEngine_decorators;
|
62
|
+
var _textEngine_initializers = [];
|
63
|
+
var _conversationType_decorators;
|
64
|
+
var _conversationType_initializers = [];
|
65
|
+
var _lang_decorators;
|
66
|
+
var _lang_initializers = [];
|
67
|
+
var _assets_decorators;
|
68
|
+
var _assets_initializers = [];
|
69
|
+
var _tts_decorators;
|
70
|
+
var _tts_initializers = [];
|
71
|
+
var _voice_decorators;
|
72
|
+
var _voice_initializers = [];
|
73
|
+
var _secondaryVoice_decorators;
|
74
|
+
var _secondaryVoice_initializers = [];
|
75
|
+
var _speed_decorators;
|
76
|
+
var _speed_initializers = [];
|
77
|
+
var _speedRate_decorators;
|
78
|
+
var _speedRate_initializers = [];
|
79
|
+
var _metaApp_decorators;
|
80
|
+
var _metaApp_initializers = [];
|
81
|
+
var _createdAt_decorators;
|
82
|
+
var _createdAt_initializers = [];
|
83
|
+
var _updatedAt_decorators;
|
84
|
+
var _updatedAt_initializers = [];
|
85
|
+
var Conversation = _classThis = /** @class */ (function () {
|
86
|
+
function Conversation_1() {
|
87
|
+
this._id = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, __id_initializers, void 0));
|
88
|
+
this.id = __runInitializers(this, _id_initializers, void 0);
|
89
|
+
this.version = __runInitializers(this, _version_initializers, void 0);
|
90
|
+
this.title = __runInitializers(this, _title_initializers, void 0);
|
91
|
+
this.characterCard = __runInitializers(this, _characterCard_initializers, void 0);
|
92
|
+
this.textEngine = __runInitializers(this, _textEngine_initializers, void 0);
|
93
|
+
this.conversationType = __runInitializers(this, _conversationType_initializers, void 0);
|
94
|
+
this.lang = __runInitializers(this, _lang_initializers, void 0);
|
95
|
+
this.assets = __runInitializers(this, _assets_initializers, void 0);
|
96
|
+
this.tts = __runInitializers(this, _tts_initializers, void 0);
|
97
|
+
this.voice = __runInitializers(this, _voice_initializers, void 0);
|
98
|
+
this.secondaryVoice = __runInitializers(this, _secondaryVoice_initializers, void 0);
|
99
|
+
this.speed = __runInitializers(this, _speed_initializers, void 0);
|
100
|
+
this.speedRate = __runInitializers(this, _speedRate_initializers, void 0);
|
101
|
+
this.metaApp = __runInitializers(this, _metaApp_initializers, void 0);
|
102
|
+
this.createdAt = __runInitializers(this, _createdAt_initializers, void 0);
|
103
|
+
this.updatedAt = __runInitializers(this, _updatedAt_initializers, void 0);
|
104
|
+
}
|
105
|
+
return Conversation_1;
|
106
|
+
}());
|
107
|
+
__setFunctionName(_classThis, "Conversation");
|
108
|
+
(function () {
|
109
|
+
var _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
110
|
+
__id_decorators = [(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, auto: true })];
|
111
|
+
_id_decorators = [(0, mongoose_1.Prop)()];
|
112
|
+
_version_decorators = [(0, mongoose_1.Prop)({ required: false })];
|
113
|
+
_title_decorators = [(0, mongoose_1.Prop)({ required: false })];
|
114
|
+
_characterCard_decorators = [(0, mongoose_1.Prop)({ type: Object, required: false })];
|
115
|
+
_textEngine_decorators = [(0, mongoose_1.Prop)({ required: true, enum: conversation_interface_1.TextEngines })];
|
116
|
+
_conversationType_decorators = [(0, mongoose_1.Prop)({ required: true, enum: conversation_interface_1.ConversationType })];
|
117
|
+
_lang_decorators = [(0, mongoose_1.Prop)({ required: false })];
|
118
|
+
_assets_decorators = [(0, mongoose_1.Prop)({ type: Object, required: false })];
|
119
|
+
_tts_decorators = [(0, mongoose_1.Prop)({ type: Object, required: false })];
|
120
|
+
_voice_decorators = [(0, mongoose_1.Prop)({ required: false })];
|
121
|
+
_secondaryVoice_decorators = [(0, mongoose_1.Prop)({ required: false })];
|
122
|
+
_speed_decorators = [(0, mongoose_1.Prop)({ required: false })];
|
123
|
+
_speedRate_decorators = [(0, mongoose_1.Prop)({ required: false })];
|
124
|
+
_metaApp_decorators = [(0, mongoose_1.Prop)({ type: Object, required: false })];
|
125
|
+
_createdAt_decorators = [(0, mongoose_1.Prop)()];
|
126
|
+
_updatedAt_decorators = [(0, mongoose_1.Prop)()];
|
127
|
+
__esDecorate(null, null, __id_decorators, { kind: "field", name: "_id", static: false, private: false, access: { has: function (obj) { return "_id" in obj; }, get: function (obj) { return obj._id; }, set: function (obj, value) { obj._id = value; } }, metadata: _metadata }, __id_initializers, _instanceExtraInitializers);
|
128
|
+
__esDecorate(null, null, _id_decorators, { kind: "field", name: "id", static: false, private: false, access: { has: function (obj) { return "id" in obj; }, get: function (obj) { return obj.id; }, set: function (obj, value) { obj.id = value; } }, metadata: _metadata }, _id_initializers, _instanceExtraInitializers);
|
129
|
+
__esDecorate(null, null, _version_decorators, { kind: "field", name: "version", static: false, private: false, access: { has: function (obj) { return "version" in obj; }, get: function (obj) { return obj.version; }, set: function (obj, value) { obj.version = value; } }, metadata: _metadata }, _version_initializers, _instanceExtraInitializers);
|
130
|
+
__esDecorate(null, null, _title_decorators, { kind: "field", name: "title", static: false, private: false, access: { has: function (obj) { return "title" in obj; }, get: function (obj) { return obj.title; }, set: function (obj, value) { obj.title = value; } }, metadata: _metadata }, _title_initializers, _instanceExtraInitializers);
|
131
|
+
__esDecorate(null, null, _characterCard_decorators, { kind: "field", name: "characterCard", static: false, private: false, access: { has: function (obj) { return "characterCard" in obj; }, get: function (obj) { return obj.characterCard; }, set: function (obj, value) { obj.characterCard = value; } }, metadata: _metadata }, _characterCard_initializers, _instanceExtraInitializers);
|
132
|
+
__esDecorate(null, null, _textEngine_decorators, { kind: "field", name: "textEngine", static: false, private: false, access: { has: function (obj) { return "textEngine" in obj; }, get: function (obj) { return obj.textEngine; }, set: function (obj, value) { obj.textEngine = value; } }, metadata: _metadata }, _textEngine_initializers, _instanceExtraInitializers);
|
133
|
+
__esDecorate(null, null, _conversationType_decorators, { kind: "field", name: "conversationType", static: false, private: false, access: { has: function (obj) { return "conversationType" in obj; }, get: function (obj) { return obj.conversationType; }, set: function (obj, value) { obj.conversationType = value; } }, metadata: _metadata }, _conversationType_initializers, _instanceExtraInitializers);
|
134
|
+
__esDecorate(null, null, _lang_decorators, { kind: "field", name: "lang", static: false, private: false, access: { has: function (obj) { return "lang" in obj; }, get: function (obj) { return obj.lang; }, set: function (obj, value) { obj.lang = value; } }, metadata: _metadata }, _lang_initializers, _instanceExtraInitializers);
|
135
|
+
__esDecorate(null, null, _assets_decorators, { kind: "field", name: "assets", static: false, private: false, access: { has: function (obj) { return "assets" in obj; }, get: function (obj) { return obj.assets; }, set: function (obj, value) { obj.assets = value; } }, metadata: _metadata }, _assets_initializers, _instanceExtraInitializers);
|
136
|
+
__esDecorate(null, null, _tts_decorators, { kind: "field", name: "tts", static: false, private: false, access: { has: function (obj) { return "tts" in obj; }, get: function (obj) { return obj.tts; }, set: function (obj, value) { obj.tts = value; } }, metadata: _metadata }, _tts_initializers, _instanceExtraInitializers);
|
137
|
+
__esDecorate(null, null, _voice_decorators, { kind: "field", name: "voice", static: false, private: false, access: { has: function (obj) { return "voice" in obj; }, get: function (obj) { return obj.voice; }, set: function (obj, value) { obj.voice = value; } }, metadata: _metadata }, _voice_initializers, _instanceExtraInitializers);
|
138
|
+
__esDecorate(null, null, _secondaryVoice_decorators, { kind: "field", name: "secondaryVoice", static: false, private: false, access: { has: function (obj) { return "secondaryVoice" in obj; }, get: function (obj) { return obj.secondaryVoice; }, set: function (obj, value) { obj.secondaryVoice = value; } }, metadata: _metadata }, _secondaryVoice_initializers, _instanceExtraInitializers);
|
139
|
+
__esDecorate(null, null, _speed_decorators, { kind: "field", name: "speed", static: false, private: false, access: { has: function (obj) { return "speed" in obj; }, get: function (obj) { return obj.speed; }, set: function (obj, value) { obj.speed = value; } }, metadata: _metadata }, _speed_initializers, _instanceExtraInitializers);
|
140
|
+
__esDecorate(null, null, _speedRate_decorators, { kind: "field", name: "speedRate", static: false, private: false, access: { has: function (obj) { return "speedRate" in obj; }, get: function (obj) { return obj.speedRate; }, set: function (obj, value) { obj.speedRate = value; } }, metadata: _metadata }, _speedRate_initializers, _instanceExtraInitializers);
|
141
|
+
__esDecorate(null, null, _metaApp_decorators, { kind: "field", name: "metaApp", static: false, private: false, access: { has: function (obj) { return "metaApp" in obj; }, get: function (obj) { return obj.metaApp; }, set: function (obj, value) { obj.metaApp = value; } }, metadata: _metadata }, _metaApp_initializers, _instanceExtraInitializers);
|
142
|
+
__esDecorate(null, null, _createdAt_decorators, { kind: "field", name: "createdAt", static: false, private: false, access: { has: function (obj) { return "createdAt" in obj; }, get: function (obj) { return obj.createdAt; }, set: function (obj, value) { obj.createdAt = value; } }, metadata: _metadata }, _createdAt_initializers, _instanceExtraInitializers);
|
143
|
+
__esDecorate(null, null, _updatedAt_decorators, { kind: "field", name: "updatedAt", static: false, private: false, access: { has: function (obj) { return "updatedAt" in obj; }, get: function (obj) { return obj.updatedAt; }, set: function (obj, value) { obj.updatedAt = value; } }, metadata: _metadata }, _updatedAt_initializers, _instanceExtraInitializers);
|
144
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
145
|
+
Conversation = _classThis = _classDescriptor.value;
|
146
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
147
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
148
|
+
})();
|
149
|
+
return Conversation = _classThis;
|
150
|
+
}();
|
151
|
+
exports.Conversation = Conversation;
|
152
|
+
exports.ConversationSchema = mongoose_1.SchemaFactory.createForClass(Conversation);
|
153
|
+
exports.ConversationSchema.pre('save', function (next) {
|
154
|
+
if (this.isNew) {
|
155
|
+
this.id = this._id.toString();
|
156
|
+
}
|
157
|
+
next();
|
158
|
+
});
|
package/dist/index.js
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
+
};
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
+
__exportStar(require("./conversation-cards.module"), exports);
|
18
|
+
__exportStar(require("./services/conversation-cards.service"), exports);
|
19
|
+
__exportStar(require("./conversation-ai.controller"), exports);
|
20
|
+
__exportStar(require("./services/conversation-ai.service"), exports);
|
21
|
+
__exportStar(require("./tts/tts-service"), exports);
|
22
|
+
__exportStar(require("./ai-models.service"), exports);
|
23
|
+
__exportStar(require("./clases/conversation.interface"), exports);
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import { FastifyReply } from 'fastify';
|
2
|
+
import { ConversationAiService } from './services/conversation-ai.service';
|
2
3
|
import { ConversationDTO } from './dto/create-conversation.dto';
|
3
4
|
import { ChatMessageDict, IConversationCard } from './clases/conversation.interface';
|
4
5
|
import { Conversation, ConversationDocument } from './entities/conversation.entity';
|
5
6
|
import { TTSDto } from './tts/tts.classes';
|
6
7
|
import { TTSService } from './tts/tts-service';
|
7
8
|
import { IAModelsService } from './ai-models.service';
|
8
|
-
import { ConversationAiService } from './services/conversation-ai.service';
|
9
9
|
export declare class ConversationAiController {
|
10
10
|
private readonly conversationAiService;
|
11
11
|
private readonly aiModel;
|
@@ -15,13 +15,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.ConversationAiController = void 0;
|
16
16
|
const common_1 = require("@nestjs/common");
|
17
17
|
const swagger_1 = require("@nestjs/swagger");
|
18
|
+
const conversation_ai_service_1 = require("./services/conversation-ai.service");
|
18
19
|
const create_conversation_dto_1 = require("./dto/create-conversation.dto");
|
19
20
|
const conversation_interface_1 = require("./clases/conversation.interface");
|
20
21
|
const conversation_entity_1 = require("./entities/conversation.entity");
|
21
22
|
const tts_classes_1 = require("./tts/tts.classes");
|
22
23
|
const tts_service_1 = require("./tts/tts-service");
|
23
24
|
const ai_models_service_1 = require("./ai-models.service");
|
24
|
-
const conversation_ai_service_1 = require("./services/conversation-ai.service");
|
25
25
|
let ConversationAiController = class ConversationAiController {
|
26
26
|
constructor(conversationAiService, aiModel, ttsService) {
|
27
27
|
this.conversationAiService = conversationAiService;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"conversation-ai.controller.js","sourceRoot":"","sources":["../../../../src/conversation-ai.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAsF;AACtF,6CAAqE;AAGrE,2EAAgE;AAChE,4EAAkG;AAClG,wEAAoF;AACpF,mDAA2C;AAC3C,mDAA+C;AAC/C,2DAAsD;
|
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;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,EA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0;
|
|
10
10
|
const common_1 = require("@nestjs/common");
|
11
11
|
const mongoose_1 = require("@nestjs/mongoose");
|
12
12
|
const conversation_ai_controller_1 = require("./conversation-ai.controller");
|
13
|
-
const conversation_ai_service_1 = require("./services/conversation-ai.service");
|
14
13
|
const conversation_entity_1 = require("./entities/conversation.entity");
|
15
14
|
const tts_service_1 = require("./tts/tts-service");
|
16
15
|
const ai_models_service_1 = require("./ai-models.service");
|
16
|
+
const conversation_ai_service_1 = require("./services/conversation-ai.service");
|
17
17
|
let ConversationAiModule = class ConversationAiModule {
|
18
18
|
};
|
19
19
|
exports.ConversationAiModule = ConversationAiModule;
|
@@ -1 +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,
|
1
|
+
{"version":3,"file":"conversation-ai.module.js","sourceRoot":"","sources":["../../../../src/conversation-ai.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,+CAAkD;AAClD,6EAAwE;AACxE,wEAAkF;AAClF,mDAA+C;AAC/C,2DAAsD;AACtD,gFAA2E;AAQpE,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"}
|
@@ -10,10 +10,10 @@ exports.ConversationCardsModule = void 0;
|
|
10
10
|
const common_1 = require("@nestjs/common");
|
11
11
|
const mongoose_1 = require("@nestjs/mongoose");
|
12
12
|
const conversation_ai_controller_1 = require("./conversation-ai.controller");
|
13
|
-
const conversation_ai_service_1 = require("./services/conversation-ai.service");
|
14
13
|
const conversation_entity_1 = require("./entities/conversation.entity");
|
15
14
|
const tts_service_1 = require("./tts/tts-service");
|
16
15
|
const ai_models_service_1 = require("./ai-models.service");
|
16
|
+
const conversation_ai_service_1 = require("./services/conversation-ai.service");
|
17
17
|
let ConversationCardsModule = class ConversationCardsModule {
|
18
18
|
};
|
19
19
|
exports.ConversationCardsModule = ConversationCardsModule;
|
@@ -1 +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,
|
1
|
+
{"version":3,"file":"conversation-cards.module.js","sourceRoot":"","sources":["../../../../src/conversation-cards.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,+CAAkD;AAClD,6EAAwE;AACxE,wEAAkF;AAClF,mDAA+C;AAC/C,2DAAsD;AACtD,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,wBAAU,EAAE,mCAAe,CAAC;QAC/D,OAAO,EAAE,CAAC,+CAAqB,EAAE,mCAAe,EAAE,wBAAU,CAAC;KAC9D,CAAC;GACW,uBAAuB,CAAG"}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
export * from './conversation-cards.module';
|
2
2
|
export * from './services/conversation-cards.service';
|
3
3
|
export * from './conversation-ai.controller';
|
4
|
-
export * from './services/conversation-cards.service';
|
5
4
|
export * from './services/conversation-ai.service';
|
6
|
-
export * from './
|
5
|
+
export * from './tts/tts-service';
|
6
|
+
export * from './ai-models.service';
|
7
|
+
export * from './clases/conversation.interface';
|
@@ -17,7 +17,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./conversation-cards.module"), exports);
|
18
18
|
__exportStar(require("./services/conversation-cards.service"), exports);
|
19
19
|
__exportStar(require("./conversation-ai.controller"), exports);
|
20
|
-
__exportStar(require("./services/conversation-cards.service"), exports);
|
21
20
|
__exportStar(require("./services/conversation-ai.service"), exports);
|
22
|
-
__exportStar(require("./
|
21
|
+
__exportStar(require("./tts/tts-service"), exports);
|
22
|
+
__exportStar(require("./ai-models.service"), exports);
|
23
|
+
__exportStar(require("./clases/conversation.interface"), exports);
|
23
24
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA4C;AAC5C,wEAAsD;AACtD,+DAA6C;AAC7C,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA4C;AAC5C,wEAAsD;AACtD,+DAA6C;AAC7C,qEAAmD;AACnD,oDAAkC;AAClC,sDAAoC;AACpC,kEAAgD"}
|
@@ -1,33 +1 @@
|
|
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.AudioTranscriptionService = void 0;
|
13
|
-
const common_1 = require("@nestjs/common");
|
14
|
-
const config_1 = require("@nestjs/config");
|
15
|
-
let AudioTranscriptionService = class AudioTranscriptionService {
|
16
|
-
constructor(configService) {
|
17
|
-
this.configService = configService;
|
18
|
-
}
|
19
|
-
async transcribeAudio(audioBuffer) {
|
20
|
-
try {
|
21
|
-
}
|
22
|
-
catch (error) {
|
23
|
-
console.error('Error transcribing audio:', error);
|
24
|
-
throw error;
|
25
|
-
}
|
26
|
-
}
|
27
|
-
};
|
28
|
-
exports.AudioTranscriptionService = AudioTranscriptionService;
|
29
|
-
exports.AudioTranscriptionService = AudioTranscriptionService = __decorate([
|
30
|
-
(0, common_1.Injectable)(),
|
31
|
-
__metadata("design:paramtypes", [config_1.ConfigService])
|
32
|
-
], AudioTranscriptionService);
|
33
1
|
//# sourceMappingURL=audio-transcription.service.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"audio-transcription.service.js","sourceRoot":"","sources":["../../../../../src/services/audio-transcription.service.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"audio-transcription.service.js","sourceRoot":"","sources":["../../../../../src/services/audio-transcription.service.ts"],"names":[],"mappings":""}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { Model } from 'mongoose';
|
2
|
-
import { Conversation, ConversationDocument } from '../entities/conversation.entity';
|
3
2
|
import { IConversationCard } from '../clases/conversation.interface';
|
3
|
+
import { Conversation, ConversationDocument } from '../entities/conversation.entity';
|
4
4
|
export declare class ConversationAiService {
|
5
5
|
private conversationModel;
|
6
6
|
private readonly groqClient;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"conversation-ai.service.js","sourceRoot":"","sources":["../../../../../src/services/conversation-ai.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,+CAA+C;AAC/C,uCAAiC;AACjC,uCAA4B;AAE5B,qCAAmC;
|
1
|
+
{"version":3,"file":"conversation-ai.service.js","sourceRoot":"","sources":["../../../../../src/services/conversation-ai.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,+CAA+C;AAC/C,uCAAiC;AACjC,uCAA4B;AAE5B,qCAAmC;AAGnC,yEAAqF;AAG9E,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAGhC,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,gBAAgB,CAAC,YAA+B;QACpD,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE;YACxB,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC;SAC5B;QAED,MAAM,eAAe,GAAG,IAAI,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC;QACjE,OAAO,eAAe,CAAC,IAAI,EAAE,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,EAAU,EAAE,UAAiC;QACpE,MAAM,GAAG,GAAG,IAAI,kBAAQ,CAAC,EAAE,CAAC,CAAC;QAC7B,OAAO,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,GAAG,EAAE,UAAU,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACzF,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,OAAO,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC;IAC9C,CAAC;IAED,KAAK,CAAC,mBAAmB,CAAC,EAAU;QAClC,MAAM,GAAG,GAAG,IAAI,kBAAQ,CAAC,EAAE,CAAC,CAAC;QAC7B,OAAO,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IACrD,CAAC;IAED,KAAK,CAAC,sBAAsB,CAAC,EAAU;QACrC,MAAM,GAAG,GAAG,IAAI,kBAAQ,CAAC,EAAE,CAAC,CAAC;QAC7B,OAAO,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IAC9D,CAAC;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,27 @@
|
|
1
|
+
// import { Injectable } from '@nestjs/common';
|
2
|
+
// import OpenAI from 'openai';
|
3
|
+
// import { ConfigService } from '@nestjs/config';
|
4
|
+
// @Injectable()
|
5
|
+
// export class AudioTranscriptionService {
|
6
|
+
// private openai: OpenAI;
|
7
|
+
// constructor(private configService: ConfigService) {
|
8
|
+
// this.openai = new OpenAI({
|
9
|
+
// apiKey: this.configService.get<string>('OPENAI_API_KEY'),
|
10
|
+
// });
|
11
|
+
// }
|
12
|
+
// async transcribeAudio(audioBuffer: Buffer): Promise<any> {
|
13
|
+
// try {
|
14
|
+
// const file = new File([audioBuffer], 'audio.mp3', { type: 'audio/mpeg' });
|
15
|
+
// const transcription = await this.openai.audio.transcriptions.create({
|
16
|
+
// model: 'whisper-1',
|
17
|
+
// file: file,
|
18
|
+
// response_format: 'verbose_json',
|
19
|
+
// timestamp_granularities: ['word'],
|
20
|
+
// });
|
21
|
+
// return transcription;
|
22
|
+
// } catch (error) {
|
23
|
+
// console.error('Error transcribing audio:', error);
|
24
|
+
// throw error;
|
25
|
+
// }
|
26
|
+
// }
|
27
|
+
// }
|