mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-08 15:05:17 +02:00
fix translate
This commit is contained in:
parent
235b5b5189
commit
de259a2531
1 changed files with 3 additions and 2 deletions
|
|
@ -12,14 +12,15 @@ from metagpt.logs import logger
|
|||
from metagpt.tools.translator import Translator
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.usefixtures("llm_api")
|
||||
def test_translate(llm_api):
|
||||
async def test_translate(llm_api):
|
||||
poetries = [
|
||||
("Let life be beautiful like summer flowers", "花"),
|
||||
("The ancient Chinese poetries are all songs.", "中国"),
|
||||
]
|
||||
for i, j in poetries:
|
||||
prompt = Translator.translate_prompt(i)
|
||||
rsp = llm_api.ask_batch([prompt])
|
||||
rsp = await llm_api.aask(prompt)
|
||||
logger.info(rsp)
|
||||
assert j in rsp
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue