优化全能创作
This commit is contained in:
@@ -144,3 +144,35 @@ def drain_asset_reviews_task(self) -> str:
|
||||
drain_asset_reviews_task.apply_async(countdown=45)
|
||||
return "ok"
|
||||
|
||||
|
||||
|
||||
@app.task(bind=True, max_retries=0)
|
||||
def run_creation_agent_turn_task(
|
||||
self,
|
||||
conversation_id: str,
|
||||
user_id: str,
|
||||
text: str = "",
|
||||
refs: list | None = None,
|
||||
model_config_id: str | None = None,
|
||||
record_user_message: bool = True,
|
||||
force_creative_turn: bool = False,
|
||||
continuation_instruction: str = "",
|
||||
) -> str:
|
||||
"""全能创作 · Agent 整理方案(tool loop)在 worker 内跑,离开页面也不中断。
|
||||
失败自收成 ERROR + idle(见 run_creation_agent_turn),故 max_retries=0。
|
||||
|
||||
队列由 CREATION_AGENT_TASK_QUEUE 决定(本地常用 airshelf.local,避免与未部署该任务的
|
||||
远程 worker 共用 celery 队列时被偷走 → NotRegistered / 永久 planning)。
|
||||
"""
|
||||
from apps.ai.creation_agent import run_creation_agent_turn
|
||||
|
||||
return run_creation_agent_turn(
|
||||
conversation_id=conversation_id,
|
||||
user_id=str(user_id),
|
||||
text=text or "",
|
||||
refs=refs or [],
|
||||
model_config_id=model_config_id,
|
||||
record_user_message=record_user_message,
|
||||
force_creative_turn=force_creative_turn,
|
||||
continuation_instruction=continuation_instruction or "",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user