mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-11 15:15:18 +02:00
fixbug: type error
This commit is contained in:
parent
6ff2767e25
commit
eec69e64a3
2 changed files with 4 additions and 1 deletions
|
|
@ -90,6 +90,8 @@ You should follow the following Standard Operating Procedure:
|
|||
|
||||
class DetectIntent(Action):
|
||||
async def run(self, user_requirement: str) -> Tuple[str, str]:
|
||||
if not isinstance(user_requirement, str):
|
||||
raise ValueError(f"str type error: {user_requirement}")
|
||||
intentions = "\n".join([f"{si.type_name}: {si.value.description}" for si in SOPItem])
|
||||
prompt = DETECT_PROMPT.format(user_requirement=user_requirement, intentions=intentions)
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,8 @@ class MGX(DataInterpreter):
|
|||
|
||||
async def _detect_intent(self, user_msgs: List[Message] = None, **kwargs):
|
||||
todo = DetectIntent(context=self.context)
|
||||
request_with_sop, sop_type = await todo.run(user_msgs)
|
||||
user_requirement = "\n".join([f"> {i.role}: {i.content}" for i in user_msgs])
|
||||
request_with_sop, sop_type = await todo.run(user_requirement)
|
||||
logger.info(f"{sop_type} {request_with_sop}")
|
||||
return request_with_sop
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue