优化视频创作
This commit is contained in:
@@ -40,7 +40,6 @@ from .creation_agent import (
|
||||
apply_restart_intent,
|
||||
apply_session_params,
|
||||
emit_final_confirm_gate,
|
||||
emit_prompt_gate,
|
||||
is_greeting,
|
||||
is_restart_intent,
|
||||
restore_gated_step_after_cancel,
|
||||
@@ -174,11 +173,11 @@ _STEP_CONTINUE_INSTRUCTIONS = {
|
||||
"不要再写策略,不要调用 write_prompt,不要出片。"
|
||||
),
|
||||
"plan": (
|
||||
"用户已确认视频方案。若尚未写出 Prompt,调用 write_prompt 展示出片 Prompt;"
|
||||
"不要重写策略/方案,不要出积分确认卡或直接出片。"
|
||||
"用户已确认视频方案。补齐完整 video_prompt 后直接调用 write_prompt 整理后台出片指令并给出积分确认卡;"
|
||||
"不要重写策略/方案,也不要直接出片。"
|
||||
),
|
||||
"prompt": (
|
||||
"用户已确认出片 Prompt。不要再写策略/方案/Prompt;"
|
||||
"用户已确认后台出片指令。不要再写策略/方案;"
|
||||
"平台会出积分确认卡,等用户点开始生成。"
|
||||
),
|
||||
}
|
||||
@@ -193,8 +192,8 @@ _STEP_REVISE_INSTRUCTIONS = {
|
||||
"(含完整 video_prompt 存档);写完即停,不要同轮 write_prompt 或出片。"
|
||||
),
|
||||
"prompt": (
|
||||
"用户要求修改出片 Prompt。根据反馈只重新调用 write_prompt 写一版修订 Prompt;"
|
||||
"写完即停,不要出积分确认卡或直接出片。"
|
||||
"用户要求修改出片细节。根据反馈只重新调用 write_prompt 整理一版修订指令;"
|
||||
"完成后给出积分确认卡,不要直接出片。"
|
||||
),
|
||||
}
|
||||
|
||||
@@ -249,17 +248,21 @@ def _handle_step_confirm_answer(
|
||||
return None, True, _STEP_CONTINUE_INSTRUCTIONS["strategy"]
|
||||
|
||||
if step == "plan":
|
||||
emitted = emit_prompt_gate(conversation)
|
||||
if not emitted:
|
||||
# 缓存丢了:让 agent 补 write_prompt
|
||||
confirm = emit_final_confirm_gate(conversation)
|
||||
if confirm is None:
|
||||
# 兼容旧会话或缓存丢失:让 agent 补齐后台出片指令,再直接给出积分确认。
|
||||
return None, True, _STEP_CONTINUE_INSTRUCTIONS["plan"]
|
||||
conversation.agent_status = CreationConversation.AgentStatus.AWAITING_USER
|
||||
conversation.save(update_fields=["agent_status", "updated_at"])
|
||||
return JsonResponse({
|
||||
credits = int((confirm.payload or {}).get("estimated_credits") or 0)
|
||||
body = {
|
||||
"conversation_id": str(conversation.id),
|
||||
"agent_status": conversation.agent_status,
|
||||
"messages": [CreationMessageSerializer(m).data for m in emitted],
|
||||
}, status=200), False, ""
|
||||
"messages": [CreationMessageSerializer(confirm).data],
|
||||
}
|
||||
if credits:
|
||||
body["estimated_credits"] = credits
|
||||
return JsonResponse(body, status=200), False, ""
|
||||
|
||||
if step == "prompt":
|
||||
confirm = emit_final_confirm_gate(conversation)
|
||||
|
||||
Reference in New Issue
Block a user