Add your description here
Project description
DebugAgent
A barebone MVP of an agent-based python debugger. The system is built on top of PDB, the official python debugger.
For the moment, two main things happen:
- The Output of the Pdb debugger becomes the input of the Agent, and viceversa;
- The Agent's actions are limited by a custom Python Interpreter(kindly borrowed from the smolagents library), that limits the harm of the Agent.
This is not by any mean a finished application, but it seems to be working incredebily good as is.
How to use it
The user experience is straight forward:
Clone the package and install(a PyPi version is coming in the future)
git clone https://github.com/marcoslashpro/DebugAgent && cd DebugAgent
uv pip install -e .
That's it for the installation, now you should a debug_agent package from where you can import the agent.
The intended use is as a decorator on the risky function, like this:
from debug_agent import Agent
@Agent
def some_risky_function():
return 'hello' / 10
Once the function raises an exception, then the decorator will launch the post-mortem analysis of the code. The Agent will then start interacting with the debugger, using its commands to analyze the error, outputting a summary of the task at the end of the debugging session.
Optionally, you can also provide parameters to the decorator, which allows us to set a temperature for the model, the n_steps that the agent should take, and the model_id, in order to specify a different model.
Keep in mind tho, that for the moment, the only models available are the one that can be used through the ChatHuggingFace Langchain interface.
Considerations
For the moment, the agent seems to perform pretty well on minor errors, such as ZeroDivisionErrors, TypeError, ValueErrors, while showcasing the ability to dig into the stacktrace in order to find where the error originated from. I think that, as the prompt improves and, if we get to that point, with some debugging-specific fine-tuning, this could become a valuable application for python developers.
Happy Coding!
And come back to me, if you find any problems while using the debugger.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file debug_agent-0.1.0.tar.gz.
File metadata
- Download URL: debug_agent-0.1.0.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1564660c7f0e0e02acd0f32ba74d747a1ab52586b15ac5dd137d73a4a4bcebb4
|
|
| MD5 |
762bf6fd40565f737f49c30240edb65e
|
|
| BLAKE2b-256 |
8d3222583dba7561757757ba70ec2d2758461e552924fbf4877831505cbae721
|
File details
Details for the file debug_agent-0.1.0-py3-none-any.whl.
File metadata
- Download URL: debug_agent-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ff7e69fa04196dae9872bc089ebfd6b8dc8bed9b8d4cb4ce617cc8ac9a96292
|
|
| MD5 |
87be8c78d294a9cdb2ede3c1876d7c0f
|
|
| BLAKE2b-256 |
f982e3f4871d4afca1cb99ca941edeb92b983daff6c1caa950b02a3461b06cd1
|