fixbug: di run

This commit is contained in:
莘权 马 2024-03-30 20:19:46 +08:00
parent eedba3038d
commit a27fcd7e52
2 changed files with 17 additions and 3 deletions

View file

@ -7,11 +7,17 @@ import pytest
from metagpt.context import Context
from metagpt.roles.di.mgx import MGX
from metagpt.schema import Message
from tests.metagpt.actions.test_intent_detect import DEMO_CONTENT
from tests.metagpt.actions.test_intent_detect import DEMO1_CONTENT, DEMO_CONTENT
@pytest.mark.asyncio
@pytest.mark.parametrize("user_messages", [[Message.model_validate(i) for i in DEMO_CONTENT if i["role"] == "user"]])
@pytest.mark.parametrize(
"user_messages",
[
[Message.model_validate(i) for i in DEMO_CONTENT if i["role"] == "user"],
[Message.model_validate(i) for i in DEMO1_CONTENT if i["role"] == "user"],
],
)
async def test_mgx(user_messages: List[Message]):
ctx = Context()
mgx = MGX(context=ctx, tools=["<all>"])