mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 04:40:43 +00:00
fix: normalize video generation fallbacks
This commit is contained in:
@@ -52,7 +52,7 @@ const SEEDANCE_REFERENCE_MAX_AUDIOS_BY_MODEL = Object.fromEntries(
|
||||
SEEDANCE_2_REFERENCE_VIDEO_MODELS.map((model) => [model, SEEDANCE_REFERENCE_MAX_AUDIOS]),
|
||||
);
|
||||
const DEFAULT_HTTP_TIMEOUT_MS = 30_000;
|
||||
const DEFAULT_OPERATION_TIMEOUT_MS = 600_000;
|
||||
const DEFAULT_OPERATION_TIMEOUT_MS = 1_200_000;
|
||||
const POLL_INTERVAL_MS = 5_000;
|
||||
|
||||
type FalVideoResponse = {
|
||||
|
||||
@@ -40,7 +40,11 @@ describe("google video generation provider", () => {
|
||||
});
|
||||
|
||||
it("declares explicit mode capabilities", () => {
|
||||
expectExplicitVideoGenerationCapabilities(buildGoogleVideoGenerationProvider());
|
||||
const provider = buildGoogleVideoGenerationProvider();
|
||||
expectExplicitVideoGenerationCapabilities(provider);
|
||||
expect(provider.capabilities.generate?.supportsAudio).toBe(false);
|
||||
expect(provider.capabilities.imageToVideo?.supportsAudio).toBe(false);
|
||||
expect(provider.capabilities.videoToVideo?.supportsAudio).toBe(false);
|
||||
});
|
||||
|
||||
it("submits generation and returns inline video bytes", async () => {
|
||||
@@ -89,6 +93,7 @@ describe("google video generation provider", () => {
|
||||
}),
|
||||
}),
|
||||
);
|
||||
expect(request?.config).not.toHaveProperty("generateAudio");
|
||||
expect(request?.config).not.toHaveProperty("numberOfVideos");
|
||||
expect(request?.config).not.toHaveProperty("generateAudio");
|
||||
expect(result.videos).toHaveLength(1);
|
||||
|
||||
@@ -26,7 +26,7 @@ import { createGoogleGenAI, type GoogleGenAIClient } from "./google-genai-runtim
|
||||
|
||||
const DEFAULT_TIMEOUT_MS = 180_000;
|
||||
const POLL_INTERVAL_MS = 10_000;
|
||||
const MAX_POLL_ATTEMPTS = 90;
|
||||
const MAX_POLL_ATTEMPTS = 120;
|
||||
const GOOGLE_VIDEO_EMPTY_RESULT_MESSAGE =
|
||||
"Google video generation response missing generated videos";
|
||||
|
||||
|
||||
@@ -29,7 +29,10 @@ installMinimaxProviderHttpMockCleanup();
|
||||
|
||||
describe("minimax video generation provider", () => {
|
||||
it("declares explicit mode capabilities", () => {
|
||||
expectExplicitVideoGenerationCapabilities(buildMinimaxVideoGenerationProvider());
|
||||
const provider = buildMinimaxVideoGenerationProvider();
|
||||
expectExplicitVideoGenerationCapabilities(provider);
|
||||
expect(provider.capabilities.generate?.resolutions).toEqual(["768P", "1080P"]);
|
||||
expect(provider.capabilities.imageToVideo?.resolutions).toEqual(["768P", "1080P"]);
|
||||
});
|
||||
|
||||
it("creates a task, polls status, and downloads the generated video", async () => {
|
||||
|
||||
@@ -19,8 +19,9 @@ import type {
|
||||
const DEFAULT_MINIMAX_VIDEO_BASE_URL = "https://api.minimax.io";
|
||||
const DEFAULT_MINIMAX_VIDEO_MODEL = "MiniMax-Hailuo-2.3";
|
||||
const DEFAULT_TIMEOUT_MS = 120_000;
|
||||
const DEFAULT_OPERATION_TIMEOUT_MS = 1_200_000;
|
||||
const POLL_INTERVAL_MS = 10_000;
|
||||
const MAX_POLL_ATTEMPTS = 90;
|
||||
const MAX_POLL_ATTEMPTS = 120;
|
||||
const MINIMAX_MODEL_ALLOWED_DURATIONS: Readonly<Record<string, readonly number[]>> = {
|
||||
"MiniMax-Hailuo-2.3": [6, 10],
|
||||
"MiniMax-Hailuo-02": [6, 10],
|
||||
@@ -323,7 +324,7 @@ function buildMinimaxVideoProvider(providerId: string): VideoGenerationProvider
|
||||
|
||||
const fetchFn = fetch;
|
||||
const deadline = createProviderOperationDeadline({
|
||||
timeoutMs: req.timeoutMs,
|
||||
timeoutMs: req.timeoutMs ?? DEFAULT_OPERATION_TIMEOUT_MS,
|
||||
label: "MiniMax video generation",
|
||||
});
|
||||
const { baseUrl, allowPrivateNetwork, headers, dispatcherPolicy } =
|
||||
@@ -387,7 +388,7 @@ function buildMinimaxVideoProvider(providerId: string): VideoGenerationProvider
|
||||
headers,
|
||||
timeoutMs: resolveProviderOperationTimeoutMs({
|
||||
deadline,
|
||||
defaultTimeoutMs: DEFAULT_TIMEOUT_MS,
|
||||
defaultTimeoutMs: DEFAULT_OPERATION_TIMEOUT_MS,
|
||||
}),
|
||||
baseUrl,
|
||||
fetchFn,
|
||||
|
||||
Reference in New Issue
Block a user