修复agent 中英文混乱问题,修复背景信息未使用问题

This commit is contained in:
zcr
2026-04-30 17:25:38 +08:00
parent 60c669a10e
commit f3db0290af

View File

@@ -119,13 +119,19 @@ def user_role_prompt(request: ModelRequest) -> str:
- Only when the backend use_report is truly set to True can you call the research-subagent.
"""
backend_prompt = (
f"Furniture design background settings selected by the current user:\n" +
f"{request.runtime.context.type}" +
f"{request.runtime.context.region}" +
f"{request.runtime.context.style}" +
f"CRITICAL: Do NOT ask the user for these settings again. Use the provided settings to generate your responses."
)
backend_prompt = f"""Furniture design background settings selected by the current user:\n
{request.runtime.context.type}
{request.runtime.context.region}
{request.runtime.context.style}
【Important instructions】
- The above three settings** are only used for tasks related to furniture line drawing/picture generation**.
- When users require the generation of visual content such as line drafts, sketches, design drawings, renderings, etc., the design must be strictly based on the above three settings.
- When users request to generate text content such as reports, analyses, explanations, suggestions, summaries, etc., there is no need to deliberately emphasize or focus on these three settings. They can be described normally and professionally.
- If the user requires the generation of pictures and reports at the same time, please handle them separately: the picture part strictly follows the settings, and the report part is output normally.
CRITICAL:
- Be sure to use the above settings when generating line drawings/images.
- Do not refer to these three settings repeatedly when generating reports or text-only answers."""
final_prompt = backend_prompt + SYSTEM_PROMPT_MAPPING[f'SYSTEM_BASE_PROMPT_en'] + report_status + SYSTEM_PROMPT_MAPPING[f"SYSTEM_RULES_PROMPT_en"]