feat(short-drama-agent-front): 补齐后端生产与质量功能
This commit is contained in:
1 parent
967c4ebea1
commit
470b52e26d
52 files changed
+3754
-1075
No files matched your search
@@ -4,7 +4,6 @@ import type {
|
||||
GenerateKeyframeInput,
|
||||
GenerateKeyframesInput,
|
||||
GenerateQualityVideosInput,
|
||||
KeyframeBatchResult,
|
||||
KeyframeReadiness,
|
||||
KeyframeGenerationPreview,
|
||||
KeyframeSpec,
|
||||
@@ -12,6 +11,8 @@ import type {
|
||||
ProjectVideoInputPlan,
|
||||
PromptReadiness,
|
||||
ProductionPlan,
|
||||
ProductionPlanInput,
|
||||
ProductionStartInput,
|
||||
ProviderInputSpec,
|
||||
ProjectProductionStatus,
|
||||
RetryVideosResult,
|
||||
@@ -56,29 +57,32 @@ export const productionApi = {
|
||||
request<ProviderInputSpec>(`${shotPath(shotId)}/provider-input-spec?provider=${encodeURIComponent(provider)}`, {
|
||||
signal
|
||||
}),
|
||||
/** 查询当前计划,不生成图片、视频或提示词。 */
|
||||
plan: (projectId: string, signal?: AbortSignal, providers?: { imageProvider?: string; videoProvider?: string }) => {
|
||||
const params = new URLSearchParams()
|
||||
if (providers?.imageProvider) params.set('imageProvider', providers.imageProvider)
|
||||
if (providers?.videoProvider) params.set('videoProvider', providers.videoProvider)
|
||||
const query = params.size ? `?${params}` : ''
|
||||
return request<ProductionPlan>(`${projectPath(projectId)}/production/plan${query}`, { signal })
|
||||
},
|
||||
/**
|
||||
* 使用正式 POST 预检当前生产计划,不产生生成费用。
|
||||
* @param projectId 正式项目 ID
|
||||
* @param signal 取消信号
|
||||
* @param input 与启动同源的模型及图片参数
|
||||
* @returns 后端实际生产计划
|
||||
*/
|
||||
plan: (projectId: string, signal?: AbortSignal, input: ProductionPlanInput = {}) =>
|
||||
request<ProductionPlan>(`${projectPath(projectId)}/production/plan`, {
|
||||
method: 'POST',
|
||||
body: input,
|
||||
signal
|
||||
}),
|
||||
/** 读取真实主资产完成状态,不能用任务提交回执代替。 */
|
||||
status: (projectId: string, signal?: AbortSignal) =>
|
||||
request<ProjectProductionStatus>(`${projectPath(projectId)}/production/status`, { signal }),
|
||||
startPipeline: (
|
||||
projectId: string,
|
||||
input?: {
|
||||
imageProvider?: string
|
||||
videoProvider?: string
|
||||
stopAfter?: 'keyframes' | 'videoPrompts'
|
||||
keyframeLimit?: number
|
||||
}
|
||||
) =>
|
||||
/**
|
||||
* 启动有限范围的串联生产,最终结果通过任务查询取得。
|
||||
* @param projectId 正式项目 ID
|
||||
* @param input 模型、断点、停止阶段和各阶段上限
|
||||
* @returns 真实后台任务观察句柄
|
||||
*/
|
||||
startPipeline: (projectId: string, input: ProductionStartInput = {}) =>
|
||||
request<WorkflowExecutionStart>(`${projectPath(projectId)}/production/start`, {
|
||||
method: 'POST',
|
||||
body: input ?? {}
|
||||
body: input
|
||||
}),
|
||||
promptReadiness: (projectId: string, force: boolean, signal?: AbortSignal) =>
|
||||
request<PromptReadiness>(`${projectPath(projectId)}/video-prompts/readiness?force=${force}`, { signal }),
|
||||
@@ -96,8 +100,14 @@ export const productionApi = {
|
||||
}),
|
||||
keyframeReadiness: (projectId: string, force: boolean, signal?: AbortSignal) =>
|
||||
request<KeyframeReadiness>(`${projectPath(projectId)}/keyframes/readiness?force=${force}`, { signal }),
|
||||
/**
|
||||
* 后台批量生成普通首帧候选。
|
||||
* @param projectId 正式项目 ID
|
||||
* @param input 当前生成范围和模型参数
|
||||
* @returns 真实后台任务观察句柄
|
||||
*/
|
||||
generateKeyframes: (projectId: string, input: GenerateKeyframesInput) =>
|
||||
request<KeyframeBatchResult>(`${projectPath(projectId)}/keyframes/generate`, {
|
||||
request<WorkflowExecutionStart>(`${projectPath(projectId)}/keyframes/generate`, {
|
||||
method: 'POST',
|
||||
body: input,
|
||||
timeoutMs: 0
|
||||
|
||||
Reference in new issue
Block a user