| | |
| | | export interface ProjectStatus { |
| | | session_id: string; |
| | | current_stage: string; |
| | | status: string; |
| | | status: Record<string, string>; |
| | | error: string | null; |
| | | stages_completed: string[]; |
| | | } |
| | | |
| | | export interface StreamEvent { |
| | |
| | | |
| | | export async function startProject(params: { |
| | | idea: string; |
| | | file_path?: string; |
| | | style?: string; |
| | | video_ratio?: string; |
| | | llm_model?: string; |
| | |
| | | video_model?: string; |
| | | scene_number?: number; |
| | | enable_concurrency?: boolean; |
| | | web_search?: boolean; |
| | | expand_idea?: boolean; |
| | | episodes?: number; |
| | | }): Promise<{ session_id: string; status: string; params: any }> { |
| | | const resp = await fetch('/api/project/start', { |
| | | method: 'POST', |
| | |
| | | |
| | | export async function deleteSession( |
| | | sessionId: string, |
| | | password: string, |
| | | ): Promise<{ status: string }> { |
| | | const resp = await fetch(`/api/sessions/${sessionId}`, { |
| | | method: 'DELETE', |
| | | headers: { 'Content-Type': 'application/json' }, |
| | | body: JSON.stringify({ password }), |
| | | }); |
| | | if (!resp.ok) { |
| | | const err = await resp.json().catch(() => ({ detail: '删除失败' })); |