小优化,产品愿景,视觉规范,交互和导航大版本

This commit is contained in:
Nostars Developer
2026-04-16 18:11:35 +08:00
parent 5878f7d9f4
commit 10f9c0061a
51 changed files with 5010 additions and 847 deletions

View File

@@ -46,6 +46,7 @@ SYSTEM_PROMPT = """\
- 如果用户提供了参考图(支持多张),将参考图的风格元素融入生成 prompt
- 理解多张参考图各自的角色(如"图1的主体 + 图2的风格/视角"),并在 prompt 中准确传达
- 理解用户在图片上的标注(框选区域 + 文字批注),精准定位需要修改的部分
- 将一张图片转换为多个不同视角(使用 transform_view 工具),适合建筑、物体等需要从不同角度查看的场景
## 工作流程
1. 理解用户需求,必要时追问细节(尺寸、风格、用途等)
@@ -268,9 +269,13 @@ async def run_agent_loop(
tc_data = tool_calls_data[idx]
tool_name = tc_data["name"]
tool_message = (
"正在进行视角变换..." if tool_name == "transform_view"
else "正在生成图片..."
)
yield {
"type": "tool_start",
"data": {"tool": tool_name, "message": "正在生成图片..."},
"data": {"tool": tool_name, "message": tool_message},
}
try:
@@ -292,7 +297,29 @@ async def run_agent_loop(
},
}
if result.get("images"):
if result.get("error") and not result.get("success"):
yield {
"type": "tool_error",
"data": {
"tool": tool_name,
"errors": [result["error"]],
"model_name": used_model,
},
}
if tool_name == "transform_view" and result.get("images"):
# transform_view 返回带视角信息的图片列表
image_urls = [v["url"] for v in result["images"]]
yield {
"type": "image_result",
"data": {
"images": image_urls,
"prompt_used": "",
"model_name": used_model,
"view_info": result["images"],
},
}
elif result.get("images"):
yield {
"type": "image_result",
"data": {