Spaces:
Sleeping
Sleeping
Download test_client.py from luciferai-devil/code-debug-env: direct link, hf CLI and curl.
- Browser
- Download file 599 Bytes
-
https://huggingface.co/spaces/luciferai-devil/code-debug-env/resolve/main/test_client.py
- Command line
-
hf download hf://spaces/luciferai-devil/code-debug-env/test_client.py
-
curl -L -o test_client.py https://huggingface.co/spaces/luciferai-devil/code-debug-env/resolve/main/test_client.py
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()) | |