code-debug-env / test_client.py
luciferai-devil's picture
Upload folder using huggingface_hub
cacd58c verified
raw
history blame contribute delete
599 Bytes
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())