From fa47573a94ece223c383c70fb75eb6bfa459a41f Mon Sep 17 00:00:00 2001 From: zcr Date: Tue, 5 May 2026 15:33:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AF=B9=E8=AF=9D=E8=83=8C?= =?UTF-8?q?=E6=99=AF=E4=BF=A1=E6=81=AF=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/deep_agent/agents/main_agent.py | 6 +++--- src/server/deep_agent/init_prompt.py | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/server/deep_agent/agents/main_agent.py b/src/server/deep_agent/agents/main_agent.py index 225f927..9ced4fb 100755 --- a/src/server/deep_agent/agents/main_agent.py +++ b/src/server/deep_agent/agents/main_agent.py @@ -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""" diff --git a/src/server/deep_agent/init_prompt.py b/src/server/deep_agent/init_prompt.py index 902aea2..7ea33f6 100755 --- a/src/server/deep_agent/init_prompt.py +++ b/src/server/deep_agent/init_prompt.py @@ -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.