Skip to main content

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:

  1. The Output of the Pdb debugger becomes the input of the Agent, and viceversa;
  2. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

debug_agent-0.1.1.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

debug_agent-0.1.1-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file debug_agent-0.1.1.tar.gz.

File metadata

  • Download URL: debug_agent-0.1.1.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for debug_agent-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0051fa59ca1bcb7a2fc76aada97ee85722d7c517df0f99207c141112c1a5f4fd
MD5 40015f03a405b8f073bcf199784958ee
BLAKE2b-256 a2fa1768a2d133b583d2e39380d1c34b18554b90c01a8d6723bbb68d29795ba3

See more details on using hashes here.

File details

Details for the file debug_agent-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: debug_agent-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for debug_agent-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e124b86d809877534b11450749f521a32cfefdf1137e927900421bdf40f2cb85
MD5 85851ccda0a84c4e1acc742532751f99
BLAKE2b-256 db9e9d5aa051c2afefbcd57870bdfdd5f86deb1725da376520cb882ec23b6373

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page