mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-14 15:25:17 +02:00
feat: +unit test
This commit is contained in:
parent
c73911af82
commit
143d51b3b5
1 changed files with 7 additions and 2 deletions
|
|
@ -17,14 +17,15 @@ from metagpt.tools.prompt_writer import (
|
|||
)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.usefixtures("llm_api")
|
||||
def test_gpt_prompt_generator(llm_api):
|
||||
async def test_gpt_prompt_generator(llm_api):
|
||||
generator = GPTPromptGenerator()
|
||||
example = (
|
||||
"商品名称:WonderLab 新肌果味代餐奶昔 小胖瓶 胶原蛋白升级版 饱腹代餐粉6瓶 75g/瓶(6瓶/盒) 店铺名称:金力宁食品专营店 " "品牌:WonderLab 保质期:1年 产地:中国 净含量:450g"
|
||||
)
|
||||
|
||||
results = llm_api.ask_batch(generator.gen(example))
|
||||
results = await llm_api.aask_batch(generator.gen(example))
|
||||
logger.info(results)
|
||||
assert len(results) > 0
|
||||
|
||||
|
|
@ -58,3 +59,7 @@ def test_beagec_template():
|
|||
assert any(
|
||||
"Edit and revise this document to improve its grammar, vocabulary, spelling, and style." in r for r in results
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
pytest.main([__file__, "-s"])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue