diff --git a/components/SmartChatBox/api.ts b/components/SmartChatBox/api.ts index 6804d64..51d551f 100644 --- a/components/SmartChatBox/api.ts +++ b/components/SmartChatBox/api.ts @@ -75,6 +75,10 @@ function isShotVideoGeneration(data: any): data is ShotVideoGeneration { return data && 'prompt_json' in data && 'urls' in data && 'completed_count' in data && 'total_count' in data; } +function displayText(title: string, content: string, isLast: boolean = false) { + return `${content ? `${title}: ${content}${isLast ? '' : '\n'}` : ''}` +} + /** * 系统消息转换为blocks数组 */ @@ -153,7 +157,7 @@ function transformSystemMessage( if (isShotSketchGeneration(customData)) { blocks = [{ type: 'text', - text: `🎬 Storyboard static frame generation \nShot type: ${customData.shot_type}\nAtmosphere: ${customData.atmosphere}\nKey action: ${customData.key_action}` + text: `🎬 Storyboard static frame generation \n${displayText('Shot type', customData.shot_type)}${displayText('Atmosphere', customData.atmosphere)}${displayText('Key action', customData.key_action, true)}` }, { type: 'image', url: customData.url diff --git a/components/pages/work-flow/use-workflow-data.tsx b/components/pages/work-flow/use-workflow-data.tsx index 0305917..470ca09 100644 --- a/components/pages/work-flow/use-workflow-data.tsx +++ b/components/pages/work-flow/use-workflow-data.tsx @@ -115,24 +115,24 @@ export function useWorkflowData() { } }, [taskObject.currentStage]); - const generateEditPlan = useCallback(async (isInit?: boolean) => { - if (isLoaded) { - return; - } - localStorage.setItem(`isLoaded_plan_${episodeId}`, 'true'); - isInit && await getGenerateEditPlan({ project_id: episodeId }); - openEditPlan(); - }, [episodeId]); + // const generateEditPlan = useCallback(async (isInit?: boolean) => { + // if (isLoaded) { + // return; + // } + // localStorage.setItem(`isLoaded_plan_${episodeId}`, 'true'); + // isInit && await getGenerateEditPlan({ project_id: episodeId }); + // openEditPlan(); + // }, [episodeId]); const openEditPlan = useCallback(async () => { window.open(`https://smartcut.movieflow.ai/ai-editor/${episodeId}?token=${token}&user_id=${useid}`, '_target'); }, [episodeId]); - useEffect(() => { - if (!from && canGoToCut && taskObject.status !== 'COMPLETED') { - generateEditPlan(true); - } - }, [canGoToCut, taskObject.status]); + // useEffect(() => { + // if (!from && canGoToCut && taskObject.status !== 'COMPLETED') { + // generateEditPlan(true); + // } + // }, [canGoToCut, taskObject.status]); useUpdateEffect(() => { @@ -407,8 +407,8 @@ export function useWorkflowData() { const titleResponse = await getScriptTitle({ project_id: episodeId }); console.log('titleResponse', titleResponse); if (titleResponse.successful) { - taskCurrent.title = titleResponse.data.title; - taskCurrent.tags = titleResponse.data.tags || []; + taskCurrent.title = titleResponse.data.name; + taskCurrent.tags = titleResponse.data.description.tags || []; } }