mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-27 14:25:20 +02:00
add test_write_code_with_udfs.
This commit is contained in:
parent
b7624d7298
commit
116e7718ba
1 changed files with 13 additions and 1 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import asyncio
|
||||
import pytest
|
||||
|
||||
from metagpt.actions.write_analysis_code import WriteCodeByGenerate, WriteCodeWithTools
|
||||
from metagpt.actions.write_analysis_code import WriteCodeByGenerate, WriteCodeWithTools, WriteCodeWithUDFs
|
||||
from metagpt.actions.execute_code import ExecutePyCode
|
||||
from metagpt.schema import Message, Plan, Task
|
||||
from metagpt.logs import logger
|
||||
|
|
@ -311,3 +311,15 @@ async def test_write_code_reuse_code_long_for_wine():
|
|||
success_rate = sum(success) / trials_num
|
||||
logger.info(f"success rate: {success_rate :.2f}")
|
||||
assert success_rate >= 0.8
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_write_code_with_udfs():
|
||||
wudf = WriteCodeWithUDFs()
|
||||
ep = ExecutePyCode()
|
||||
rsp = await wudf.run("Get Apple stock data for the past 90 days.")
|
||||
logger.info(rsp)
|
||||
assert 'metagpt' in rsp
|
||||
output, output_type = await ep.run(rsp)
|
||||
assert output_type is True
|
||||
logger.info(output)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue