mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-14 15:25:17 +02:00
fixbug: intent detect
This commit is contained in:
parent
de77fccc9a
commit
32223805a0
3 changed files with 62 additions and 36 deletions
24
tests/metagpt/roles/di/test_mgx.py
Normal file
24
tests/metagpt/roles/di/test_mgx.py
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
from typing import List
|
||||
|
||||
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
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.parametrize("user_messages", [[Message.model_validate(i) for i in DEMO_CONTENT if i["role"] == "user"]])
|
||||
async def test_mgx(user_messages: List[Message]):
|
||||
ctx = Context()
|
||||
mgx = MGX(context=ctx)
|
||||
|
||||
for i in user_messages:
|
||||
await mgx.run(i)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
pytest.main([__file__, "-s"])
|
||||
Loading…
Add table
Add a link
Reference in a new issue