From 46e7c2c05c13ac0ac6a1b90065f60f16ced9a43b Mon Sep 17 00:00:00 2001 From: lidanyang Date: Wed, 10 Jul 2024 11:25:34 +0800 Subject: [PATCH] use keyword retriever for DataAnalyst --- metagpt/strategy/experience_retriever.py | 9 ++------- tests/metagpt/roles/di/run_data_analyst.py | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/metagpt/strategy/experience_retriever.py b/metagpt/strategy/experience_retriever.py index 63ca4fcbd..04807ebec 100644 --- a/metagpt/strategy/experience_retriever.py +++ b/metagpt/strategy/experience_retriever.py @@ -638,6 +638,8 @@ class KeywordExpRetriever(ExpRetriever): return DEPLOY_EXAMPLE elif "issue" in context.lower(): return FIX_ISSUE_EXAMPLE + elif "https:" or "http:" in context.lower(): + return WEB_SCRAPING_EXAMPLE elif exp_type == "task": if "diagnose" in context.lower(): return SEARCH_SYMBOL_EXAMPLE @@ -1018,10 +1020,3 @@ Here is the command to finish the current task and parse the html content: ... """ - - -class WebExpRetriever(ExpRetriever): - """A simple experience retriever that returns manually crafted examples.""" - - def retrieve(self, context: str = "") -> str: - return WEB_SCRAPING_EXAMPLE diff --git a/tests/metagpt/roles/di/run_data_analyst.py b/tests/metagpt/roles/di/run_data_analyst.py index 9c1f72394..445f8f800 100644 --- a/tests/metagpt/roles/di/run_data_analyst.py +++ b/tests/metagpt/roles/di/run_data_analyst.py @@ -33,7 +33,7 @@ NEWS_36KR_REQ = """从36kr创投平台https://pitchhub.36kr.com/financing-flash """ WIKIPEDIA_SEARCH_REQ = """ -Search for `LLM` on Wikipedia and print all the meaningful significances of the entry. +Search for `LLM` on https://www.wikipedia.org/ and print all the meaningful significances of the entry. """ STACKOVERFLOW_CLICK_REQ = """