vidspotai-shared 1.0.33 → 1.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.
- package/lib/services/aiGen/providers/bytedance/bytedance.service.d.ts.map +1 -1
- package/lib/services/aiGen/providers/bytedance/bytedance.service.js +22 -2
- package/lib/services/tts/providers/elevenlabs.service.d.ts +1 -0
- package/lib/services/tts/providers/elevenlabs.service.d.ts.map +1 -1
- package/lib/services/tts/providers/elevenlabs.service.js +4 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bytedance.service.d.ts","sourceRoot":"","sources":["../../../../../src/services/aiGen/providers/bytedance/bytedance.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,UAAU,CAAC;AASlB,qBAAa,gBAAiB,SAAQ,wBAAwB;IAC5D,OAAO,CAAC,QAAQ,CAAC,OAAO,CACsD;IAExE,aAAa,CACjB,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"bytedance.service.d.ts","sourceRoot":"","sources":["../../../../../src/services/aiGen/providers/bytedance/bytedance.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,UAAU,CAAC;AASlB,qBAAa,gBAAiB,SAAQ,wBAAwB;IAC5D,OAAO,CAAC,QAAQ,CAAC,OAAO,CACsD;IAExE,aAAa,CACjB,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,qBAAqB,CAAC;IA0F3B,gBAAgB,CAAC,EACrB,IAAI,EACJ,cAAc,EACd,cAAyB,GAC1B,EAAE,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IA8FjD,aAAa,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM;CAoCjD"}
|
|
@@ -31,8 +31,8 @@ class ByteDanceService extends baseAiGenProvider_service_1.BaseAiGenProviderServ
|
|
|
31
31
|
// Optional image → Image-to-Video (first frame)
|
|
32
32
|
if (params.inputImageUrl) {
|
|
33
33
|
content.push({
|
|
34
|
-
type: "
|
|
35
|
-
image_url: params.inputImageUrl,
|
|
34
|
+
type: "image_url",
|
|
35
|
+
image_url: { url: params.inputImageUrl },
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
const body = {
|
|
@@ -56,6 +56,26 @@ class ByteDanceService extends baseAiGenProvider_service_1.BaseAiGenProviderServ
|
|
|
56
56
|
});
|
|
57
57
|
if (!resp.ok) {
|
|
58
58
|
const errText = await resp.text();
|
|
59
|
+
let parsed;
|
|
60
|
+
try {
|
|
61
|
+
parsed = JSON.parse(errText);
|
|
62
|
+
}
|
|
63
|
+
catch { /* ignore */ }
|
|
64
|
+
const code = parsed?.error?.code;
|
|
65
|
+
const param = parsed?.error?.param;
|
|
66
|
+
const message = parsed?.error?.message ?? "";
|
|
67
|
+
if (code === "InputTextSensitiveContentDetected") {
|
|
68
|
+
throw new Error("Your prompt contains content that violates the content policy. Please modify your prompt and try again.");
|
|
69
|
+
}
|
|
70
|
+
if (code === "InvalidParameter" && param === "image_url") {
|
|
71
|
+
if (message.includes("aspect ratio")) {
|
|
72
|
+
throw new Error("Your input image's aspect ratio is not supported by this model. Please use an image with an aspect ratio between 0.40 and 2.50 (e.g. 1:1, 9:16, 16:9).");
|
|
73
|
+
}
|
|
74
|
+
if (message.includes("width") || message.includes("height") || message.includes("px")) {
|
|
75
|
+
throw new Error("Your input image is too small. Please use an image with a minimum width of 300px.");
|
|
76
|
+
}
|
|
77
|
+
throw new Error(`Your input image is not valid: ${message}`);
|
|
78
|
+
}
|
|
59
79
|
throw new Error(`ByteDance generateVideo failed (${resp.status}): ${errText}`);
|
|
60
80
|
}
|
|
61
81
|
const data = await resp.json();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BaseTtsProviderService, TtsParams, TtsResult } from "../types";
|
|
2
2
|
export declare class ElevenLabsService extends BaseTtsProviderService {
|
|
3
3
|
private readonly baseUrl;
|
|
4
|
+
private readonly apiKey;
|
|
4
5
|
constructor();
|
|
5
6
|
generate(params: TtsParams): Promise<TtsResult>;
|
|
6
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elevenlabs.service.d.ts","sourceRoot":"","sources":["../../../../src/services/tts/providers/elevenlabs.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAExE,qBAAa,iBAAkB,SAAQ,sBAAsB;IAC3D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkC;;
|
|
1
|
+
{"version":3,"file":"elevenlabs.service.d.ts","sourceRoot":"","sources":["../../../../src/services/tts/providers/elevenlabs.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAExE,qBAAa,iBAAkB,SAAQ,sBAAsB;IAC3D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkC;IAE1D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;;IAW1B,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;CA+BtD"}
|
|
@@ -11,9 +11,11 @@ class ElevenLabsService extends types_1.BaseTtsProviderService {
|
|
|
11
11
|
constructor() {
|
|
12
12
|
super();
|
|
13
13
|
this.baseUrl = "https://api.elevenlabs.io/v1";
|
|
14
|
-
|
|
14
|
+
const raw = process.env.ELEVENLABS_API_KEY?.trim();
|
|
15
|
+
if (!raw) {
|
|
15
16
|
throw new Error("Missing ELEVENLABS_API_KEY in environment variables");
|
|
16
17
|
}
|
|
18
|
+
this.apiKey = raw;
|
|
17
19
|
}
|
|
18
20
|
async generate(params) {
|
|
19
21
|
const voiceId = params.voiceId ?? elevenlabs_1.elevenlabsConfig.defaultVoiceId;
|
|
@@ -27,7 +29,7 @@ class ElevenLabsService extends types_1.BaseTtsProviderService {
|
|
|
27
29
|
},
|
|
28
30
|
}, {
|
|
29
31
|
headers: {
|
|
30
|
-
"xi-api-key":
|
|
32
|
+
"xi-api-key": this.apiKey,
|
|
31
33
|
"Content-Type": "application/json",
|
|
32
34
|
Accept: "audio/mpeg",
|
|
33
35
|
},
|