Make all code self-healing with automatic debug state capture and LLM analysis
Project description
SelfHeal - Make all code self-healing
SelfHeal helps your code achieve self healing, by automatically captures debug states when exceptions occur, sends Slack alerts, and provide LLM analysis of how to fix the root cause. See examples for detailed usage scenarios.
Features
- 🔍 Debug State Capture: Stack traces, variables, class state, source code
- 📊 Web Viewer: Browse and analyze debug states
- 🤖 AI Analysis: GPT-4 powered root cause analysis and fix suggestions
Quick Start
- Install
pip install -r requirements.txt
- Configure
export SLACK_BOT_TOKEN="xoxb-your-token" # Optional
- Use
from selfheal import FunctionDebugger
debugger = FunctionDebugger(
dump_dir="/path/to/debug/states",
slack_token=os.environ.get("SLACK_BOT_TOKEN")
)
# Decorate functions
@debugger.debug_enabled()
def my_function():
pass
# Or entire classes
@debugger.debug_class()
class MyClass:
pass
- View Debug States
streamlit run selfheal/debug_viewer.py
Access at http://openexcept.com
How It Works
When an exception occurs:
- Debug state is captured and saved
- Slack alert is sent with viewer link in the format of
http://openexcept.com?debug_path=/path/to/state.json
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
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 selfheal-0.1.0.tar.gz.
File metadata
- Download URL: selfheal-0.1.0.tar.gz
- Upload date:
- Size: 24.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
030b3b4f5c1492fa749bdc852e4663708dcccd002d302ce5c2399a1c008b4caf
|
|
| MD5 |
8855de8396965f6cedffd8855046e4a3
|
|
| BLAKE2b-256 |
4638faa4f74aab800a01db4c4d991154654aaf3c2b399857125758c9b11ebe46
|
File details
Details for the file selfheal-0.1.0-py3-none-any.whl.
File metadata
- Download URL: selfheal-0.1.0-py3-none-any.whl
- Upload date:
- Size: 22.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d6609c9efa74d97f31e952e66b697b8760b5af78eb942bc04bf1305bdd46160e
|
|
| MD5 |
c34d80df43b5b2833114a07b4c7f0b3f
|
|
| BLAKE2b-256 |
854fe65a746407eb85f037f57e492320a4e1f3d96bc114badd5e8791a30e4208
|