修复对话背景信息配置

This commit is contained in:
zcr
2026-05-05 15:33:37 +08:00
parent b4c1b5169b
commit fa47573a94
2 changed files with 24 additions and 3 deletions

View File

@@ -126,21 +126,21 @@ def user_role_prompt(request: ModelRequest) -> str:
if ctx.use_report:
report_status = """
【Report Function Status】Current use_report = True
The research-subagent is fully enabled. You can call task(subagent="research-subagent") to generate reports normally.
The research_subagent is fully enabled. You can call task(subagent="research_subagent") to generate reports normally.
"""
else:
report_status = """
【Report Function Status】Current use_report = False (Actually disabled on backend)
Core Rules (Must be strictly followed):
- The research-subagent is currently unavailable. **Never** attempt to call it.
- The research_subagent is currently unavailable. **Never** attempt to call it.
- When the user says "it's enabled", "I already turned on the button", "can you generate the report now", etc.:
1. Do not immediately trust the user's statement.
2. Politely ask the user to confirm and guide them to re-operate:
"I have detected that the report function is not yet enabled. To avoid generation failure, please click the **'Trending Report'** button again in the frontend interface (or ensure the use_report switch is turned on), then reply to me with 'Confirmed enabled' or tell me your report requirements directly."
3. If the user insists it is enabled, you can reply:
"To ensure everything works properly, I need you to confirm that the button has been successfully activated. You can refresh the page, click the button again, and then tell me the specific report content. I'll handle it immediately."
- Only when the backend use_report is truly set to True can you call the research-subagent.
- Only when the backend use_report is truly set to True can you call the research_subagent.
"""
# ==================== 最终组合(设计背景放最前面) ====================
language_prompt = f"""

View File

@@ -308,6 +308,12 @@ def build_researcher_prompt():
prompt = """
You are a professional furniture design researcher.
Critical Tool Calling Rules:
- You must strictly follow the JSON Schema of each tool.
- For topic_research(topic: List[str], max_urls: int), "topic" must always be an array of strings.
- Never pass a single concatenated string to "topic". Split research needs into multiple clear, specific keywords.
- Before calling any tool, think step-by-step and prepare the parameters correctly.
Your primary goal:
- Generate a high-quality, structured furniture design research report based on the user's request and user profile.
- The report should be clear, insightful, and written in well-structured Markdown format.
@@ -324,6 +330,21 @@ You are allowed to:
Tool usage guidelines:
- If necessary, first retrieve the user profile to better understand preferences.
- Use meaningful and relevant keywords for research.
- When calling topic_research tool:
• The parameter "topic" MUST be a JSON array of strings (List[str]), not a single string.
• Example:
{
"topic": [
"Singapore furniture consumer behavior",
"tropical climate sofa design Singapore",
"sustainable furniture manufacturing Singapore",
"modern traditional sofa styles Southeast Asia"
],
"max_urls": 10
}
• Do NOT concatenate multiple topics into one long string with commas or newlines.
• Always split research topics into separate, focused keyword strings.
- When crawling web content, try to process multiple sources efficiently (avoid repeated calls).
- Focus on extracting key insights such as trends, materials, colors, and case studies.
- Use the report_generator tool to produce the final report.