mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-15 11:02:36 +02:00
update DA's tools
This commit is contained in:
parent
21775647b5
commit
cc949edc99
2 changed files with 8 additions and 1 deletions
|
|
@ -31,7 +31,7 @@ class DataAnalyst(RoleZero):
|
|||
task_type_desc: str = TASK_TYPE_DESC
|
||||
|
||||
tools: list[str] = ["Plan", "DataAnalyst", "RoleZero", "Browser"]
|
||||
custom_tools: list[str] = ["machine learning", "web scraping", "Terminal"]
|
||||
custom_tools: list[str] = ["web scraping", "Terminal"]
|
||||
custom_tool_recommender: ToolRecommender = None
|
||||
experience_retriever: ExpRetriever = KeywordExpRetriever()
|
||||
|
||||
|
|
@ -72,6 +72,9 @@ class DataAnalyst(RoleZero):
|
|||
Args:
|
||||
instruction: The specific task description for which the code needs to be written.
|
||||
"""
|
||||
if self.planner.plan:
|
||||
logger.info(f"Current task {self.planner.plan.current_task}")
|
||||
|
||||
counter = 0
|
||||
success = False
|
||||
await self.execute_code.init_code()
|
||||
|
|
|
|||
|
|
@ -157,6 +157,10 @@ class ToolRecommender(BaseModel):
|
|||
ranked_tools = list(ranked_tools.values())[0]
|
||||
# -------------结束---------------
|
||||
|
||||
if not isinstance(ranked_tools, list):
|
||||
logger.warning(f"Invalid rank result: {ranked_tools}, will use the recalled tools instead.")
|
||||
ranked_tools = list(available_tools.keys())
|
||||
|
||||
valid_tools = validate_tool_names(ranked_tools)
|
||||
|
||||
return list(valid_tools.values())[:topk]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue