@dataclouder/nest-vertex 0.0.32 → 0.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -30,7 +30,9 @@ let VertexTtsAdapterController = class VertexTtsAdapterController {
|
|
|
30
30
|
const audioBuffer = await this.nestTtsService.synthesizeSpeech(body);
|
|
31
31
|
if (!audioBuffer) {
|
|
32
32
|
this.logger.error('Synthesis resulted in null buffer');
|
|
33
|
-
throw new nest_core_1.AppException({
|
|
33
|
+
throw new nest_core_1.AppException({
|
|
34
|
+
error_message: 'Could not generate audio for the given input.',
|
|
35
|
+
});
|
|
34
36
|
}
|
|
35
37
|
res.header('Content-Length', audioBuffer.length.toString());
|
|
36
38
|
this.logger.log(`Successfully synthesized audio (${audioBuffer.length} bytes)`);
|
|
@@ -53,10 +55,26 @@ __decorate([
|
|
|
53
55
|
type: 'object',
|
|
54
56
|
properties: {
|
|
55
57
|
text: { type: 'string', example: 'Hello world' },
|
|
56
|
-
languageCode: {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
languageCode: {
|
|
59
|
+
type: 'string',
|
|
60
|
+
example: 'en-US',
|
|
61
|
+
description: 'Optional language code (default: en-US)',
|
|
62
|
+
},
|
|
63
|
+
ssmlGender: {
|
|
64
|
+
type: 'string',
|
|
65
|
+
example: 'NEUTRAL',
|
|
66
|
+
description: 'Optional SSML gender (default: NEUTRAL)',
|
|
67
|
+
},
|
|
68
|
+
voiceName: {
|
|
69
|
+
type: 'string',
|
|
70
|
+
example: 'en-US-Neural2-F',
|
|
71
|
+
description: 'Optional specific voice name',
|
|
72
|
+
},
|
|
73
|
+
audioEncoding: {
|
|
74
|
+
type: 'string',
|
|
75
|
+
example: 'MP3',
|
|
76
|
+
description: 'Optional audio encoding (default: MP3)',
|
|
77
|
+
},
|
|
60
78
|
},
|
|
61
79
|
required: ['text'],
|
|
62
80
|
},
|
|
@@ -70,8 +88,15 @@ __decorate([
|
|
|
70
88
|
], VertexTtsAdapterController.prototype, "synthesizeSpeech", null);
|
|
71
89
|
__decorate([
|
|
72
90
|
(0, common_1.Get)('list'),
|
|
73
|
-
(0, swagger_1.ApiOperation)({
|
|
74
|
-
|
|
91
|
+
(0, swagger_1.ApiOperation)({
|
|
92
|
+
summary: 'List available TTS voices, optionally filtered by language',
|
|
93
|
+
}),
|
|
94
|
+
(0, swagger_1.ApiQuery)({
|
|
95
|
+
name: 'languageCode',
|
|
96
|
+
required: false,
|
|
97
|
+
type: String,
|
|
98
|
+
description: 'Optional language code (e.g., en-US) to filter voices',
|
|
99
|
+
}),
|
|
75
100
|
__param(0, (0, common_1.Query)('languageCode')),
|
|
76
101
|
__metadata("design:type", Function),
|
|
77
102
|
__metadata("design:paramtypes", [String]),
|
package/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export * from './services/ai-sdk-chat.service';
|
|
|
13
13
|
export * from './services/adapter-llm.service';
|
|
14
14
|
export * from './services/adapter-image-gen.service';
|
|
15
15
|
export * from './services/generated-asset.service';
|
|
16
|
+
export * from './services/vertex-veo-genai.service';
|
|
16
17
|
export * from './models/gemini-models';
|
|
17
18
|
export * from './models/adapter.models';
|
|
18
19
|
export * from './models/google-voices';
|
package/index.js
CHANGED
|
@@ -29,6 +29,7 @@ __exportStar(require("./services/ai-sdk-chat.service"), exports);
|
|
|
29
29
|
__exportStar(require("./services/adapter-llm.service"), exports);
|
|
30
30
|
__exportStar(require("./services/adapter-image-gen.service"), exports);
|
|
31
31
|
__exportStar(require("./services/generated-asset.service"), exports);
|
|
32
|
+
__exportStar(require("./services/vertex-veo-genai.service"), exports);
|
|
32
33
|
__exportStar(require("./models/gemini-models"), exports);
|
|
33
34
|
__exportStar(require("./models/adapter.models"), exports);
|
|
34
35
|
__exportStar(require("./models/google-voices"), exports);
|
package/package.json
CHANGED
|
@@ -126,7 +126,7 @@ let VertexVeoGenaiService = class VertexVeoGenaiService {
|
|
|
126
126
|
while (!operation.done) {
|
|
127
127
|
seconds += 5;
|
|
128
128
|
this.logger.log(`Waiting for video generation to complete... (${seconds}s)`);
|
|
129
|
-
await new Promise(
|
|
129
|
+
await new Promise(resolve => setTimeout(resolve, 5000));
|
|
130
130
|
operation = await this.genAI.operations.getVideosOperation({
|
|
131
131
|
operation: operation,
|
|
132
132
|
});
|
|
@@ -137,8 +137,9 @@ let VertexVeoGenaiService = class VertexVeoGenaiService {
|
|
|
137
137
|
downloadPath: `${filename}`,
|
|
138
138
|
});
|
|
139
139
|
this.logger.log(` ❗️ La api tiene un error, no me avisa cunado descarga el video. esperando 3 segundos.....`);
|
|
140
|
-
await new Promise(
|
|
140
|
+
await new Promise(resolve => setTimeout(resolve, 3000));
|
|
141
141
|
const videoBuffer = await fs.readFile(filename);
|
|
142
|
+
console.log('Subiendo video a storage', filename, process.env.STORAGE_BUCKET);
|
|
142
143
|
const uploadResult = await this.cloudStorageService.uploadFileAndMakePublic(process.env.STORAGE_BUCKET, `generated-videos/${filename}`, videoBuffer, 'video/mp4');
|
|
143
144
|
this.logger.log(`Generated video uploaded to ${uploadResult.url}`);
|
|
144
145
|
return {
|