mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-02 14:45:17 +02:00
merge
This commit is contained in:
parent
f8bea537c0
commit
aa17c25056
2 changed files with 7 additions and 1 deletions
|
|
@ -8,6 +8,7 @@ from metagpt.roles.di.mgx import MGX
|
|||
requirement = (
|
||||
# "design a game using Gym (an open source Python library), including a graphical interface and interactive gameplay"
|
||||
'Create a "2048 game"'
|
||||
# "Create a 2048 Game"
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,11 @@
|
|||
import asyncio
|
||||
from typing import Dict
|
||||
|
||||
from metagpt.actions.di.detect_intent import DetectIntent
|
||||
from metagpt.actions.di.detect_intent import DetectIntent, SOPItem
|
||||
from metagpt.logs import logger
|
||||
from metagpt.roles.di.data_interpreter import DataInterpreter
|
||||
from metagpt.schema import Message
|
||||
from metagpt.tools.tool_recommend import BM25ToolRecommender
|
||||
|
||||
|
||||
class MGX(DataInterpreter):
|
||||
|
|
@ -18,6 +19,10 @@ class MGX(DataInterpreter):
|
|||
todo = DetectIntent(context=self.context)
|
||||
request_with_sop, sop_type = await todo.run(user_msg)
|
||||
logger.info(f"{sop_type} {request_with_sop}")
|
||||
if sop_type == SOPItem.SOFTWARE_DEVELOPMENT.type_name:
|
||||
self.tool_recommender = BM25ToolRecommender(tools=["software development"])
|
||||
else:
|
||||
self.tool_recommender = BM25ToolRecommender(tools=["<all>"])
|
||||
return request_with_sop
|
||||
|
||||
async def _plan_and_act(self) -> Message:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue