mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-09-24 23:10:40 +08:00
add test
This commit is contained in:
@@ -35,4 +35,4 @@ async def test_action_planner():
|
||||
role.recv(Message(content=task, cause_by=BossRequirement))
|
||||
|
||||
await role._think() # it will choose mathskill.Add
|
||||
assert "1100" == (await role._act()).content.result
|
||||
assert "1100" == (await role._act()).content
|
||||
|
||||
@@ -39,4 +39,4 @@ async def test_basic_planner():
|
||||
# assuming sk_agent will think he needs WriterSkill.Brainstorm and WriterSkill.Translate
|
||||
assert "WriterSkill.Brainstorm" in role.plan.generated_plan.result
|
||||
assert "WriterSkill.Translate" in role.plan.generated_plan.result
|
||||
await role._act()
|
||||
# assert "SALUT" in (await role._act()).content #content will be some French
|
||||
|
||||
@@ -65,7 +65,7 @@ class SkAgent(Role):
|
||||
if isinstance(self.planner, BasicPlanner):
|
||||
result = await self.planner.execute_plan_async(self.plan, self.kernel)
|
||||
elif any(isinstance(self.planner, cls) for cls in [SequentialPlanner, ActionPlanner]):
|
||||
result = await self.plan.invoke_async()
|
||||
result = (await self.plan.invoke_async()).result
|
||||
logger.info(result)
|
||||
|
||||
msg = Message(content=result, role=self.profile, cause_by=type(self._rc.todo))
|
||||
|
||||
Reference in New Issue
Block a user