mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-21 14:05:17 +02:00
support multi write_code steps for one task
This commit is contained in:
parent
32fc276245
commit
4c4d9547ff
3 changed files with 13 additions and 5 deletions
|
|
@ -106,11 +106,11 @@ class ToolRecommender(BaseModel):
|
|||
Wrap recommended tools with their info in a string, which can be used directly in a prompt.
|
||||
"""
|
||||
recommended_tools = await self.recommend_tools(**kwargs)
|
||||
if fix:
|
||||
recommended_tools.extend([self.tools[tool_name] for tool_name in fix if tool_name in self.tools])
|
||||
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