From e0cc3e8d1bdae3222c6eb0d90b7d578a49ea3cfe Mon Sep 17 00:00:00 2001 From: Yizhou Chi Date: Mon, 12 Aug 2024 15:32:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9quick=20think=20response=20ca?= =?UTF-8?q?tegory=20=E4=B8=B4=E6=97=B6if=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- metagpt/prompts/di/role_zero.py | 2 +- metagpt/roles/di/role_zero.py | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/metagpt/prompts/di/role_zero.py b/metagpt/prompts/di/role_zero.py index 2aea566ae..765825198 100644 --- a/metagpt/prompts/di/role_zero.py +++ b/metagpt/prompts/di/role_zero.py @@ -129,7 +129,7 @@ For requests that are unclear, lack sufficient detail, or are outside the system - Out of Expertise: Requests for specialized advice (e.g., medical or legal advice) or highly technical tasks beyond the model's scope. - Unrealistic Scope: Overly broad requests that are impossible to address meaningfully in a single response (e.g., "Tell me everything about..."). -**Note:** Before categorizing a request as TASK, consider whether the user has provided sufficient information to proceed with the task. If the request is complex but lacks essential details, it may fall under AMBIGUOUS. +**Note:** Before categorizing a request as TASK, consider whether the user has provided sufficient information to proceed with the task. If the request is complex but lacks essential details or the mentioned files, it should fall under AMBIGUOUS. {examples} diff --git a/metagpt/roles/di/role_zero.py b/metagpt/roles/di/role_zero.py index 019bdba51..e87dae750 100644 --- a/metagpt/roles/di/role_zero.py +++ b/metagpt/roles/di/role_zero.py @@ -256,17 +256,13 @@ class RoleZero(Role): context = self.llm.format_msg(memory + [UserMessage(content=QUICK_THINK_PROMPT)]) intent_result = await self.llm.aask(context) - if "QUICK" in intent_result: - # llm call with the original context + if "QUICK" in intent_result or "AMBIGUOUS " in intent_result: # llm call with the original context async with ThoughtReporter(enable_llm_stream=True) as reporter: await reporter.async_report({"type": "quick"}) answer = await self.llm.aask(self.llm.format_msg(memory)) elif "SEARCH" in intent_result: query = "\n".join(str(msg) for msg in memory) answer = await SearchEnhancedQA().run(query) - elif "AMBIGUOUS " in intent_result: - # TODO: out of domain, ask human for help - pass if answer: self.rc.memory.add(AIMessage(content=answer, cause_by=RunCommand))