mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-05 13:52:38 +02:00
apply data_analyst to role_zero
This commit is contained in:
parent
a2f809263a
commit
ddaecf12eb
5 changed files with 83 additions and 117 deletions
|
|
@ -101,7 +101,7 @@ class ToolRecommender(BaseModel):
|
|||
|
||||
return ranked_tools
|
||||
|
||||
async def get_recommended_tool_info(self, **kwargs) -> str:
|
||||
async def get_recommended_tool_info(self, fix: list[str] = None, **kwargs) -> str:
|
||||
"""
|
||||
Wrap recommended tools with their info in a string, which can be used directly in a prompt.
|
||||
"""
|
||||
|
|
@ -109,6 +109,8 @@ class ToolRecommender(BaseModel):
|
|||
if not recommended_tools:
|
||||
return ""
|
||||
tool_schemas = {tool.name: tool.schemas for tool in recommended_tools}
|
||||
if fix:
|
||||
tool_schemas.update({tool.name: tool.schemas for tool in self.tools.values() if tool.name in fix})
|
||||
return TOOL_INFO_PROMPT.format(tool_schemas=tool_schemas)
|
||||
|
||||
async def recall_tools(self, context: str = "", plan: Plan = None, topk: int = 20) -> list[Tool]:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue