修复对话背景信息配置

This commit is contained in:
zcr
2026-05-05 16:11:13 +08:00
parent fa47573a94
commit a8f52dbdaa
2 changed files with 12 additions and 13 deletions

View File

@@ -106,20 +106,18 @@ def user_role_prompt(request: ModelRequest) -> str:
# ==================== 家具设计背景(加强版) ====================
design_context = f"""
[Highest priority directive - must be strictly followed]
The furniture design background currently selected by the user is as follows:
- Category/Type: {ctx.type or 'unspecified'}
[Internal highest priority design background - only for thinking, not output to users]
Furniture design settings selected by the current user:
- Category: {ctx.type or 'unspecified'}
- Region: {ctx.region or 'unspecified'}
- Style / Style: {ctx.style or 'unspecified'}
- Style: {ctx.style or 'unspecified'}
【Core Execution Rules】
1. When the user requires the generation of any visual content such as line drafts, sketches, design drawings, renderings, pictures, renderings, etc., the design must be 100% based on the above three settings.
2. When thinking about tasks related to generating images, the first step must be to state: [Current design background] Type: {ctx.type} | Region: {ctx.region} | Style: {ctx.style}
3. When generating plain text (reports, analyses, suggestions), there is no need to repeatedly emphasize the above settings, just reply in a normal professional tone.
4. If the user wants pictures + reports at the same time, they must be processed separately.
Now the user says: "Design it" → Please start designing directly based on the above background, and do not ask for known information such as type, style, region, etc.
[Strict implementation of requirements]
- When generating any pictures, line drawings, or renderings, the design must be strictly based on the above three settings.
- The above background information is only for your internal thinking and decision-making. **Never** directly tell the user "The current design background is..." or list the Type/Region/Style in the reply.
- Respond naturally and fluently, giving design plans and descriptions directly like a professional furniture designer.
- It is forbidden to say "I need to generate prompt words", "I will generate line draft prompt words", "XX style has been generated" and other internal processes.
- Simply describe the design results naturally from the user's perspective.
"""
# ==================== Report 状态 ====================

View File

@@ -222,12 +222,13 @@ def create_structured_retrieval_tool(workspace_dir):
indent=2
)
json_path = json_path.replace(workspace_dir, "")
# ── 6. 只回傳摘要 ──────────────────────────────────────────────
return {
"status": "success",
"items_count": len(top_items),
"json_path": json_path,
"summary": f"已提取 {len(top_items)} 個高相關片段,儲存於 {json_path}"
"summary": f"{len(top_items)} highly relevant fragments have been extracted and stored in {json_path}"
}
return structured_retrieval