Skip to content

Commit a34d4ef

Browse files
committed
fix: normalize video generation fallbacks
1 parent b4ff3aa commit a34d4ef

5 files changed

Lines changed: 16 additions & 7 deletions

File tree

extensions/fal/video-generation-provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const SEEDANCE_REFERENCE_MAX_AUDIOS_BY_MODEL = Object.fromEntries(
5252
SEEDANCE_2_REFERENCE_VIDEO_MODELS.map((model) => [model, SEEDANCE_REFERENCE_MAX_AUDIOS]),
5353
);
5454
const DEFAULT_HTTP_TIMEOUT_MS = 30_000;
55-
const DEFAULT_OPERATION_TIMEOUT_MS = 600_000;
55+
const DEFAULT_OPERATION_TIMEOUT_MS = 1_200_000;
5656
const POLL_INTERVAL_MS = 5_000;
5757

5858
type FalVideoResponse = {

extensions/google/video-generation-provider.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ describe("google video generation provider", () => {
4040
});
4141

4242
it("declares explicit mode capabilities", () => {
43-
expectExplicitVideoGenerationCapabilities(buildGoogleVideoGenerationProvider());
43+
const provider = buildGoogleVideoGenerationProvider();
44+
expectExplicitVideoGenerationCapabilities(provider);
45+
expect(provider.capabilities.generate?.supportsAudio).toBe(false);
46+
expect(provider.capabilities.imageToVideo?.supportsAudio).toBe(false);
47+
expect(provider.capabilities.videoToVideo?.supportsAudio).toBe(false);
4448
});
4549

4650
it("submits generation and returns inline video bytes", async () => {
@@ -89,6 +93,7 @@ describe("google video generation provider", () => {
8993
}),
9094
}),
9195
);
96+
expect(request?.config).not.toHaveProperty("generateAudio");
9297
expect(request?.config).not.toHaveProperty("numberOfVideos");
9398
expect(request?.config).not.toHaveProperty("generateAudio");
9499
expect(result.videos).toHaveLength(1);

extensions/google/video-generation-provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { createGoogleGenAI, type GoogleGenAIClient } from "./google-genai-runtim
2626

2727
const DEFAULT_TIMEOUT_MS = 180_000;
2828
const POLL_INTERVAL_MS = 10_000;
29-
const MAX_POLL_ATTEMPTS = 90;
29+
const MAX_POLL_ATTEMPTS = 120;
3030
const GOOGLE_VIDEO_EMPTY_RESULT_MESSAGE =
3131
"Google video generation response missing generated videos";
3232

extensions/minimax/video-generation-provider.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ installMinimaxProviderHttpMockCleanup();
2929

3030
describe("minimax video generation provider", () => {
3131
it("declares explicit mode capabilities", () => {
32-
expectExplicitVideoGenerationCapabilities(buildMinimaxVideoGenerationProvider());
32+
const provider = buildMinimaxVideoGenerationProvider();
33+
expectExplicitVideoGenerationCapabilities(provider);
34+
expect(provider.capabilities.generate?.resolutions).toEqual(["768P", "1080P"]);
35+
expect(provider.capabilities.imageToVideo?.resolutions).toEqual(["768P", "1080P"]);
3336
});
3437

3538
it("creates a task, polls status, and downloads the generated video", async () => {

extensions/minimax/video-generation-provider.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ import type {
1919
const DEFAULT_MINIMAX_VIDEO_BASE_URL = "https://api.minimax.io";
2020
const DEFAULT_MINIMAX_VIDEO_MODEL = "MiniMax-Hailuo-2.3";
2121
const DEFAULT_TIMEOUT_MS = 120_000;
22+
const DEFAULT_OPERATION_TIMEOUT_MS = 1_200_000;
2223
const POLL_INTERVAL_MS = 10_000;
23-
const MAX_POLL_ATTEMPTS = 90;
24+
const MAX_POLL_ATTEMPTS = 120;
2425
const MINIMAX_MODEL_ALLOWED_DURATIONS: Readonly<Record<string, readonly number[]>> = {
2526
"MiniMax-Hailuo-2.3": [6, 10],
2627
"MiniMax-Hailuo-02": [6, 10],
@@ -323,7 +324,7 @@ function buildMinimaxVideoProvider(providerId: string): VideoGenerationProvider
323324

324325
const fetchFn = fetch;
325326
const deadline = createProviderOperationDeadline({
326-
timeoutMs: req.timeoutMs,
327+
timeoutMs: req.timeoutMs ?? DEFAULT_OPERATION_TIMEOUT_MS,
327328
label: "MiniMax video generation",
328329
});
329330
const { baseUrl, allowPrivateNetwork, headers, dispatcherPolicy } =
@@ -387,7 +388,7 @@ function buildMinimaxVideoProvider(providerId: string): VideoGenerationProvider
387388
headers,
388389
timeoutMs: resolveProviderOperationTimeoutMs({
389390
deadline,
390-
defaultTimeoutMs: DEFAULT_TIMEOUT_MS,
391+
defaultTimeoutMs: DEFAULT_OPERATION_TIMEOUT_MS,
391392
}),
392393
baseUrl,
393394
fetchFn,

0 commit comments

Comments
 (0)