From 1c992c69fe7c9d2814198fded7e25a7fd3194726 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Thu, 10 Sep 2026 14:05:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=88=86=E7=A6=BB=E4=B8=8E?= =?UTF-8?q?=E8=AF=86=E5=88=AB=E5=91=BD=E4=BB=A4=E8=AF=B4=E6=98=8E=EF=BC=8C?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=B5=8C=E5=A5=97=E6=A0=BC=E5=BC=8F=E4=B8=8E?= =?UTF-8?q?=E7=BB=93=E6=9E=84=E5=8C=96=E6=8C=87=E5=BC=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/ui_editor/commands/recognition.rs | 4 ++-- .../ui_editor/commands/separation/prompt.rs | 18 ++++++++++++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/recognition.rs b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/recognition.rs index 49750b04e..c95a4c781 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/recognition.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/recognition.rs @@ -44,13 +44,13 @@ const SYSTEM_PROMPT: &str = r#" * 由于每个截图未必是完整的, 可能是局部的, 每棵树描述清楚每个截图上UI的层次结构即可 * 不同树的共用框架/层次/...请使用使用相同的名称描述. 不同状态/变体名称使用相同的前缀, 用后缀区别 * 粒度要求: 尽可能细致, 以可交互,方便程序化控制的最小单位为准. 包括不限于: icon, 进度条的底槽、填充和外框; slider的底槽, dragger等. - * 为每个节点直接返回 component. +* 为每个节点直接返回 component. 无背景的逻辑容器返回 "PureNode",不要返回 null. 有背景的容器推荐使用Simple+不锁定宽高比的Image component. 目前我们只做识别, 不要求图片字体参数. 每个节点最多返回一个 component;需要多个视觉层时拆成多个节点。 文字组件要求: 艺术字等作为图片组件, 其余正常文字要作为单独的节点识别. - +* 不鼓励兄弟节点相互重叠, 对于背景等元素, 请promote为父节点的组件, 不要再建单独的兄弟节点承载. "#; #[derive(Clone, Debug, Deserialize, PartialEq, Serialize, JsonSchema)] diff --git a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/prompt.rs b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/prompt.rs index 95dd80ef4..a91a94889 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/prompt.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/prompt.rs @@ -35,10 +35,6 @@ pub(super) fn gen_binding_prompt(nodes: Vec<&SeparationNode>) -> String { let binding_system_prompt = format!( r#" You will be given a src UI design image and a processed image, where some ui elements are separated. - Here were the separation requirements: - ``` - {SHARED_SEPARATION_REQ} - ``` You need to recognize and review the separation using the given tool. field notes: * extracted_area MUST be the recognized area from the processed image, INSTEAD OF from the src image. @@ -47,6 +43,20 @@ pub(super) fn gen_binding_prompt(nodes: Vec<&SeparationNode>) -> String { Do not copy, infer, or reuse the source node rectangle. The src image is only for identifying which semantic UI element belongs to to_node. + Here were the separation requirements: + ``` + {SHARED_SEPARATION_REQ} + ``` + And you should also review if the extracted's successfully meet the src image: + * shape + * color + * style + * edge process + ... + + if not, use `NeedRework` data structure in the tool to indicate the (it should be from which) node id and advice. + your advice (less than 20 words) will be used to improve the separation in the next time. + these node need handle: "# );