@vargai/gateway 0.1.3 → 0.1.5
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/dist/index.js +29 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14164,7 +14164,19 @@ class VargVideoModel {
|
|
|
14164
14164
|
if (options.aspectRatio)
|
|
14165
14165
|
params.aspect_ratio = options.aspectRatio;
|
|
14166
14166
|
if (options.files && options.files.length > 0) {
|
|
14167
|
-
|
|
14167
|
+
const fileUrls = [];
|
|
14168
|
+
for (const f of options.files) {
|
|
14169
|
+
if (f.type === "url") {
|
|
14170
|
+
fileUrls.push({ url: f.url });
|
|
14171
|
+
} else if (f.type === "file") {
|
|
14172
|
+
const fileData = f;
|
|
14173
|
+
const uploaded = await this.client.uploadFile(new Blob([fileData.data], { type: fileData.mediaType }), fileData.mediaType);
|
|
14174
|
+
fileUrls.push({ url: uploaded.url });
|
|
14175
|
+
}
|
|
14176
|
+
}
|
|
14177
|
+
if (fileUrls.length > 0) {
|
|
14178
|
+
params.files = fileUrls;
|
|
14179
|
+
}
|
|
14168
14180
|
}
|
|
14169
14181
|
if (options.providerOptions?.varg) {
|
|
14170
14182
|
params.provider_options = options.providerOptions.varg;
|
|
@@ -14200,6 +14212,21 @@ class VargImageModel {
|
|
|
14200
14212
|
};
|
|
14201
14213
|
if (options.aspectRatio)
|
|
14202
14214
|
params.aspect_ratio = options.aspectRatio;
|
|
14215
|
+
if (options.files && options.files.length > 0) {
|
|
14216
|
+
const fileUrls = [];
|
|
14217
|
+
for (const f of options.files) {
|
|
14218
|
+
if (f.type === "url") {
|
|
14219
|
+
fileUrls.push({ url: f.url });
|
|
14220
|
+
} else if (f.type === "file") {
|
|
14221
|
+
const fileData = f;
|
|
14222
|
+
const uploaded = await this.client.uploadFile(new Blob([fileData.data], { type: fileData.mediaType }), fileData.mediaType);
|
|
14223
|
+
fileUrls.push({ url: uploaded.url });
|
|
14224
|
+
}
|
|
14225
|
+
}
|
|
14226
|
+
if (fileUrls.length > 0) {
|
|
14227
|
+
params.files = fileUrls;
|
|
14228
|
+
}
|
|
14229
|
+
}
|
|
14203
14230
|
if (options.providerOptions?.varg) {
|
|
14204
14231
|
params.provider_options = options.providerOptions.varg;
|
|
14205
14232
|
}
|
|
@@ -14239,8 +14266,7 @@ class VargSpeechModel {
|
|
|
14239
14266
|
warnings,
|
|
14240
14267
|
response: {
|
|
14241
14268
|
timestamp: new Date,
|
|
14242
|
-
modelId: this.modelId
|
|
14243
|
-
headers: undefined
|
|
14269
|
+
modelId: this.modelId
|
|
14244
14270
|
}
|
|
14245
14271
|
};
|
|
14246
14272
|
}
|