Spaces:
Sleeping
Sleeping
File size: 599 Bytes
cacd58c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | import asyncio
from code_debug_env.client import CodeDebugEnv
from code_debug_env.models import Action
async def test():
async with CodeDebugEnv(base_url="http://127.0.0.1:8000") as env:
obs = await env.reset(task_id="task_easy")
print("Reset OK:", obs.observation.buggy_code[:20])
action = Action(patch="def foo(): pass", task_id="task_easy")
print("Sending step...")
try:
res = await env.step(action)
print("Step OK", res)
except Exception as e:
print("Exception during step:", repr(e))
asyncio.run(test())
|