diff --git a/components/canvas/CanvasChatPanel.tsx b/components/canvas/CanvasChatPanel.tsx index 5b6089405..7879bba21 100644 --- a/components/canvas/CanvasChatPanel.tsx +++ b/components/canvas/CanvasChatPanel.tsx @@ -1007,7 +1007,7 @@ function extractCanvasImageAnalysisSection(content: string): CanvasAnalysisSecti } function normalizeVideoParamsForProvider( - params: VideoGenerationParams | null | undefined, + params: Partial | null | undefined, providerType?: string, capability?: VideoToolCapabilityContract | null ): VideoGenerationParams { diff --git a/components/chat.tsx b/components/chat.tsx index 1a5afbff9..cc19661a3 100644 --- a/components/chat.tsx +++ b/components/chat.tsx @@ -81,7 +81,7 @@ function normalizeImageParamsForProvider( } function normalizeVideoParamsForProvider( - params: VideoGenerationParams | null | undefined, + params: Partial | null | undefined, providerType?: string, capability?: VideoToolCapabilityContract | null ): VideoGenerationParams { diff --git a/lib/ai/tools/generate-video.ts b/lib/ai/tools/generate-video.ts index 0cc815473..1788407d6 100644 --- a/lib/ai/tools/generate-video.ts +++ b/lib/ai/tools/generate-video.ts @@ -483,10 +483,10 @@ export function generateVideo({ dataStream }: { dataStream: any }) { .describe("视频宽高比"), duration: z .number() - .min(2) - .max(12) + .min(1) + .max(600) .default(5) - .describe("视频时长(2-12秒)"), + .describe("视频时长(秒)。优先使用当前视频模型配置的秒数档位,服务端会按模型能力动态校验。"), watermark: z.boolean().default(true).describe("是否添加水印"), cameraFixed: z.boolean().default(false).describe("是否固定摄像头"), seed: z.number().optional().describe("随机种子(可选)"), diff --git a/types/ai.ts b/types/ai.ts index 3b0e15a23..6f92f910e 100644 --- a/types/ai.ts +++ b/types/ai.ts @@ -73,7 +73,7 @@ export interface VideoGenerationOptions { // 视频参数 resolution?: VideoResolution; ratio?: VideoRatio; - duration?: number; // 2-12 秒 + duration?: number; // 按模型能力或管理员配置的秒数档位 fps?: number; // 帧率(默认 24) watermark?: boolean; // 是否包含水印 cameraFixed?: boolean; // 是否固定摄像头