mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-05 14:55:18 +02:00
add new test instance.
This commit is contained in:
parent
3ea4b3200b
commit
65db6683e6
1 changed files with 17 additions and 0 deletions
|
|
@ -32,3 +32,20 @@ async def test_make_tools2():
|
|||
result, res_type = await ep.run(tool_code)
|
||||
assert res_type is True
|
||||
print(result)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_make_tools3():
|
||||
code = '''import pandas as pd\npath = "./tests/data/test.csv"\ndf = pd.read_csv(path)\ndata = df.copy()\n
|
||||
data['started_at'] = data['started_at'].apply(lambda r: pd.to_datetime(r))\n
|
||||
data['ended_at'] = data['ended_at'].apply(lambda r: pd.to_datetime(r))\n
|
||||
data['duration_hour'] = (data['ended_at'] - data['started_at']).dt.seconds/3600\ndata.head()'''
|
||||
msgs = [{'role': 'assistant', 'content': code}]
|
||||
mt = MakeTools()
|
||||
tool_code = await mt.run(msgs)
|
||||
print(tool_code)
|
||||
ep = ExecutePyCode()
|
||||
tool_code = tool_code
|
||||
result, res_type = await ep.run(tool_code)
|
||||
assert res_type is True
|
||||
print(result)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue