healing-agent 0.2.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- healing_agent-0.2.4/.cursorignore +138 -0
- healing_agent-0.2.4/.github/workflows/python-publish.yml +49 -0
- healing_agent-0.2.4/.gitignore +179 -0
- healing_agent-0.2.4/CHANGELOG.md +75 -0
- healing_agent-0.2.4/LICENSE +21 -0
- healing_agent-0.2.4/PKG-INFO +159 -0
- healing_agent-0.2.4/README.md +126 -0
- healing_agent-0.2.4/examples/healing_agent_config.py +78 -0
- healing_agent-0.2.4/examples/tests/api_test.py +37 -0
- healing_agent-0.2.4/examples/tests/buggy_code_example.py +101 -0
- healing_agent-0.2.4/examples/tests/test_code_fixer.py +38 -0
- healing_agent-0.2.4/examples/tests/test_json_decode_error.py +50 -0
- healing_agent-0.2.4/healing_agent/__init__.py +15 -0
- healing_agent-0.2.4/healing_agent/agent_tools/tool_check_env_variables.py +19 -0
- healing_agent-0.2.4/healing_agent/agent_tools/tool_json_fixer.py +80 -0
- healing_agent-0.2.4/healing_agent/agent_tools/tool_list_files_functions.py +116 -0
- healing_agent-0.2.4/healing_agent/ai_broker.py +202 -0
- healing_agent-0.2.4/healing_agent/ai_code_fixer.py +174 -0
- healing_agent-0.2.4/healing_agent/ai_hint_generator.py +89 -0
- healing_agent-0.2.4/healing_agent/code_backup.py +36 -0
- healing_agent-0.2.4/healing_agent/code_replacer.py +160 -0
- healing_agent-0.2.4/healing_agent/config_loader.py +39 -0
- healing_agent-0.2.4/healing_agent/configurator.py +34 -0
- healing_agent-0.2.4/healing_agent/exception_handler.py +271 -0
- healing_agent-0.2.4/healing_agent/exception_saver.py +37 -0
- healing_agent-0.2.4/healing_agent/healing_agent.py +154 -0
- healing_agent-0.2.4/healing_agent/healing_agent_config.py +78 -0
- healing_agent-0.2.4/pyproject.toml +58 -0
- healing_agent-0.2.4/scripts/github_package_upload.py +152 -0
- healing_agent-0.2.4/scripts/overall_test.py +135 -0
- healing_agent-0.2.4/scripts/pypi_release.py +93 -0
- healing_agent-0.2.4/scripts/test_file_generator.py +40 -0
- healing_agent-0.2.4/scripts/test_runner.py +66 -0
- healing_agent-0.2.4/tests/api_test.py +37 -0
- healing_agent-0.2.4/tests/buggy_code_example.py +149 -0
- healing_agent-0.2.4/tests/test_code_fixer.py +38 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# Add directories or file patterns to ignore during indexing (e.g. foo/ or *.csv)
|
|
2
|
+
*.json
|
|
3
|
+
*.txt
|
|
4
|
+
*.pyc
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
tests/healing_agent_exceptions
|
|
8
|
+
tests/healing_agent_backups
|
|
9
|
+
|
|
10
|
+
# Byte-compiled / optimized / DLL files
|
|
11
|
+
__pycache__/
|
|
12
|
+
*.py[cod]
|
|
13
|
+
*$py.class
|
|
14
|
+
|
|
15
|
+
# C extensions
|
|
16
|
+
*.so
|
|
17
|
+
|
|
18
|
+
# Distribution / packaging
|
|
19
|
+
dist/
|
|
20
|
+
build/
|
|
21
|
+
develop-eggs/
|
|
22
|
+
dist/
|
|
23
|
+
downloads/
|
|
24
|
+
eggs/
|
|
25
|
+
.eggs/
|
|
26
|
+
lib/
|
|
27
|
+
lib64/
|
|
28
|
+
parts/
|
|
29
|
+
sdist/
|
|
30
|
+
var/
|
|
31
|
+
wheels/
|
|
32
|
+
share/python-wheels/
|
|
33
|
+
*.egg-info/
|
|
34
|
+
.installed.cfg
|
|
35
|
+
*.egg
|
|
36
|
+
MANIFEST
|
|
37
|
+
|
|
38
|
+
# PyInstaller
|
|
39
|
+
# Usually these files are written by a python script from a template
|
|
40
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
41
|
+
*.manifest
|
|
42
|
+
*.spec
|
|
43
|
+
|
|
44
|
+
# Installer logs
|
|
45
|
+
pip-log.txt
|
|
46
|
+
pip-delete-this-directory.txt
|
|
47
|
+
|
|
48
|
+
# Unit test / coverage reports
|
|
49
|
+
htmlcov/
|
|
50
|
+
.tox/
|
|
51
|
+
.nox/
|
|
52
|
+
.coverage
|
|
53
|
+
.coverage.*
|
|
54
|
+
.cache
|
|
55
|
+
nosetests.xml
|
|
56
|
+
coverage.xml
|
|
57
|
+
*.cover
|
|
58
|
+
*.py,cover
|
|
59
|
+
.hypothesis/
|
|
60
|
+
.pytest_cache/
|
|
61
|
+
cover/
|
|
62
|
+
|
|
63
|
+
# Translations
|
|
64
|
+
*.mo
|
|
65
|
+
*.pot
|
|
66
|
+
|
|
67
|
+
# Django stuff:
|
|
68
|
+
*.log
|
|
69
|
+
local_settings.py
|
|
70
|
+
db.sqlite3
|
|
71
|
+
db.sqlite3-journal
|
|
72
|
+
|
|
73
|
+
# Flask stuff:
|
|
74
|
+
instance/
|
|
75
|
+
.webassets-cache
|
|
76
|
+
|
|
77
|
+
# Scrapy stuff:
|
|
78
|
+
.scrapy
|
|
79
|
+
|
|
80
|
+
# Sphinx documentation
|
|
81
|
+
docs/_build/
|
|
82
|
+
|
|
83
|
+
# PyBuilder
|
|
84
|
+
.pybuilder/
|
|
85
|
+
target/
|
|
86
|
+
|
|
87
|
+
# Jupyter Notebook
|
|
88
|
+
.ipynb_checkpoints
|
|
89
|
+
|
|
90
|
+
# IPython
|
|
91
|
+
profile_default/
|
|
92
|
+
ipython_config.py
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
98
|
+
__pypackages__/
|
|
99
|
+
|
|
100
|
+
# Celery stuff
|
|
101
|
+
celerybeat-schedule
|
|
102
|
+
celerybeat.pid
|
|
103
|
+
|
|
104
|
+
# SageMath parsed files
|
|
105
|
+
*.sage.py
|
|
106
|
+
|
|
107
|
+
# Spyder project settings
|
|
108
|
+
.spyderproject
|
|
109
|
+
.spyproject
|
|
110
|
+
|
|
111
|
+
# Rope project settings
|
|
112
|
+
.ropeproject
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
# mypy
|
|
116
|
+
.mypy_cache/
|
|
117
|
+
.dmypy.json
|
|
118
|
+
dmypy.json
|
|
119
|
+
|
|
120
|
+
# Pyre type checker
|
|
121
|
+
.pyre/
|
|
122
|
+
|
|
123
|
+
# pytype static type analyzer
|
|
124
|
+
.pytype/
|
|
125
|
+
|
|
126
|
+
# Cython debug symbols
|
|
127
|
+
cython_debug/
|
|
128
|
+
|
|
129
|
+
# PyCharm
|
|
130
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
131
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
132
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
133
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
134
|
+
#.idea/
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
# IDE specific files
|
|
138
|
+
.vscode/
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
name: Publish Python Package
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*' # Trigger on version tags
|
|
7
|
+
workflow_dispatch: # Allow manual trigger
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build-and-publish:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
environment:
|
|
13
|
+
name: release
|
|
14
|
+
url: https://pypi.org/p/healing-agent
|
|
15
|
+
|
|
16
|
+
permissions:
|
|
17
|
+
id-token: write
|
|
18
|
+
contents: read
|
|
19
|
+
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
- name: Set up Python
|
|
23
|
+
uses: actions/setup-python@v5
|
|
24
|
+
with:
|
|
25
|
+
python-version: '3.x'
|
|
26
|
+
- name: Install build tools
|
|
27
|
+
run: |
|
|
28
|
+
python -m pip install --upgrade pip
|
|
29
|
+
pip install build twine
|
|
30
|
+
- name: Build package
|
|
31
|
+
run: python -m build
|
|
32
|
+
|
|
33
|
+
# Publish to Test PyPI on every tag
|
|
34
|
+
- name: Publish to Test PyPI
|
|
35
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
36
|
+
with:
|
|
37
|
+
repository-url: https://test.pypi.org/legacy/
|
|
38
|
+
packages-dir: dist/
|
|
39
|
+
verbose: true
|
|
40
|
+
print-hash: true
|
|
41
|
+
|
|
42
|
+
# Publish to PyPI only on releases
|
|
43
|
+
- name: Publish to PyPI
|
|
44
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
|
45
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
46
|
+
with:
|
|
47
|
+
packages-dir: dist/
|
|
48
|
+
verbose: true
|
|
49
|
+
print-hash: true
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
config.py
|
|
2
|
+
*.json
|
|
3
|
+
ideas.md
|
|
4
|
+
.tokens
|
|
5
|
+
.ideas
|
|
6
|
+
.initial_prompt
|
|
7
|
+
|
|
8
|
+
tests/_healing_agent_exceptions
|
|
9
|
+
tests/_healing_agent_backups
|
|
10
|
+
|
|
11
|
+
# Byte-compiled / optimized / DLL files
|
|
12
|
+
__pycache__/
|
|
13
|
+
*.py[cod]
|
|
14
|
+
*$py.class
|
|
15
|
+
|
|
16
|
+
# C extensions
|
|
17
|
+
*.so
|
|
18
|
+
|
|
19
|
+
# Distribution / packaging
|
|
20
|
+
dist/
|
|
21
|
+
build/
|
|
22
|
+
develop-eggs/
|
|
23
|
+
dist/
|
|
24
|
+
downloads/
|
|
25
|
+
eggs/
|
|
26
|
+
.eggs/
|
|
27
|
+
lib/
|
|
28
|
+
lib64/
|
|
29
|
+
parts/
|
|
30
|
+
sdist/
|
|
31
|
+
var/
|
|
32
|
+
wheels/
|
|
33
|
+
share/python-wheels/
|
|
34
|
+
*.egg-info/
|
|
35
|
+
.installed.cfg
|
|
36
|
+
*.egg
|
|
37
|
+
MANIFEST
|
|
38
|
+
|
|
39
|
+
# PyInstaller
|
|
40
|
+
# Usually these files are written by a python script from a template
|
|
41
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
42
|
+
*.manifest
|
|
43
|
+
*.spec
|
|
44
|
+
|
|
45
|
+
# Installer logs
|
|
46
|
+
pip-log.txt
|
|
47
|
+
pip-delete-this-directory.txt
|
|
48
|
+
|
|
49
|
+
# Unit test / coverage reports
|
|
50
|
+
htmlcov/
|
|
51
|
+
.tox/
|
|
52
|
+
.nox/
|
|
53
|
+
.coverage
|
|
54
|
+
.coverage.*
|
|
55
|
+
.cache
|
|
56
|
+
nosetests.xml
|
|
57
|
+
coverage.xml
|
|
58
|
+
*.cover
|
|
59
|
+
*.py,cover
|
|
60
|
+
.hypothesis/
|
|
61
|
+
.pytest_cache/
|
|
62
|
+
cover/
|
|
63
|
+
|
|
64
|
+
# Translations
|
|
65
|
+
*.mo
|
|
66
|
+
*.pot
|
|
67
|
+
|
|
68
|
+
# Django stuff:
|
|
69
|
+
*.log
|
|
70
|
+
local_settings.py
|
|
71
|
+
db.sqlite3
|
|
72
|
+
db.sqlite3-journal
|
|
73
|
+
|
|
74
|
+
# Flask stuff:
|
|
75
|
+
instance/
|
|
76
|
+
.webassets-cache
|
|
77
|
+
|
|
78
|
+
# Scrapy stuff:
|
|
79
|
+
.scrapy
|
|
80
|
+
|
|
81
|
+
# Sphinx documentation
|
|
82
|
+
docs/_build/
|
|
83
|
+
|
|
84
|
+
# PyBuilder
|
|
85
|
+
.pybuilder/
|
|
86
|
+
target/
|
|
87
|
+
|
|
88
|
+
# Jupyter Notebook
|
|
89
|
+
.ipynb_checkpoints
|
|
90
|
+
|
|
91
|
+
# IPython
|
|
92
|
+
profile_default/
|
|
93
|
+
ipython_config.py
|
|
94
|
+
|
|
95
|
+
# pyenv
|
|
96
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
97
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
98
|
+
# .python-version
|
|
99
|
+
|
|
100
|
+
# pipenv
|
|
101
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
102
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
103
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
104
|
+
# install all needed dependencies.
|
|
105
|
+
#Pipfile.lock
|
|
106
|
+
|
|
107
|
+
# poetry
|
|
108
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
109
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
110
|
+
# commonly ignored for libraries.
|
|
111
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
112
|
+
#poetry.lock
|
|
113
|
+
|
|
114
|
+
# pdm
|
|
115
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
116
|
+
#pdm.lock
|
|
117
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
118
|
+
# in version control.
|
|
119
|
+
# https://pdm.fming.dev/#use-with-ide
|
|
120
|
+
.pdm.toml
|
|
121
|
+
|
|
122
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
123
|
+
__pypackages__/
|
|
124
|
+
|
|
125
|
+
# Celery stuff
|
|
126
|
+
celerybeat-schedule
|
|
127
|
+
celerybeat.pid
|
|
128
|
+
|
|
129
|
+
# SageMath parsed files
|
|
130
|
+
*.sage.py
|
|
131
|
+
|
|
132
|
+
# Environments
|
|
133
|
+
.env
|
|
134
|
+
.venv
|
|
135
|
+
env/
|
|
136
|
+
venv/
|
|
137
|
+
ENV/
|
|
138
|
+
env.bak/
|
|
139
|
+
venv.bak/
|
|
140
|
+
|
|
141
|
+
# Spyder project settings
|
|
142
|
+
.spyderproject
|
|
143
|
+
.spyproject
|
|
144
|
+
|
|
145
|
+
# Rope project settings
|
|
146
|
+
.ropeproject
|
|
147
|
+
|
|
148
|
+
# mkdocs documentation
|
|
149
|
+
/site
|
|
150
|
+
|
|
151
|
+
# mypy
|
|
152
|
+
.mypy_cache/
|
|
153
|
+
.dmypy.json
|
|
154
|
+
dmypy.json
|
|
155
|
+
|
|
156
|
+
# Pyre type checker
|
|
157
|
+
.pyre/
|
|
158
|
+
|
|
159
|
+
# pytype static type analyzer
|
|
160
|
+
.pytype/
|
|
161
|
+
|
|
162
|
+
# Cython debug symbols
|
|
163
|
+
cython_debug/
|
|
164
|
+
|
|
165
|
+
# PyCharm
|
|
166
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
167
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
168
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
169
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
170
|
+
#.idea/
|
|
171
|
+
|
|
172
|
+
# Virtual environments
|
|
173
|
+
venv/
|
|
174
|
+
env/
|
|
175
|
+
.env/
|
|
176
|
+
|
|
177
|
+
# IDE specific files
|
|
178
|
+
.vscode/
|
|
179
|
+
.idea/
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.2.4] - 2024-11-10
|
|
9
|
+
### Added
|
|
10
|
+
- New test
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- Improved error context capture (preparation for v0.3.0)
|
|
14
|
+
- Source code verification removed (seems unnecessary)
|
|
15
|
+
|
|
16
|
+
## [0.2.3] - 2024-11-05
|
|
17
|
+
### Added
|
|
18
|
+
- Saving global and local variables to context
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
- Improved readme
|
|
22
|
+
|
|
23
|
+
## [0.2.2] - 2024-11-04
|
|
24
|
+
### Added
|
|
25
|
+
- UTF-8 support on source code
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
- JSON export and console output improvements
|
|
29
|
+
|
|
30
|
+
## [0.2.1] - 2024-10-31
|
|
31
|
+
### Added
|
|
32
|
+
- Better AI API error handling
|
|
33
|
+
- Performance optimizations in healing_agent decorator
|
|
34
|
+
- This changelog file
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
- Minor optimizations and bug fixes
|
|
38
|
+
- Updated JSONDecodeError handling
|
|
39
|
+
- Updated diagram
|
|
40
|
+
|
|
41
|
+
## [0.2.0] - 2024-10-31
|
|
42
|
+
### Added
|
|
43
|
+
- New hints feature for better error resolution
|
|
44
|
+
- Enhanced handling of different exception types
|
|
45
|
+
- Optimized configuration system
|
|
46
|
+
|
|
47
|
+
### Changed
|
|
48
|
+
- Improved overall code structure
|
|
49
|
+
- Enhanced error handling capabilities
|
|
50
|
+
|
|
51
|
+
## [0.1.2] - 2024-10-30
|
|
52
|
+
### Added
|
|
53
|
+
- Special JSON DECODE error handling
|
|
54
|
+
|
|
55
|
+
### Changed
|
|
56
|
+
- Streamlined import system
|
|
57
|
+
- Updated decorator parameters
|
|
58
|
+
|
|
59
|
+
## [0.1.1] - 2024-10-29
|
|
60
|
+
### Changed
|
|
61
|
+
- Improved packaging configuration
|
|
62
|
+
- Various small updates and optimizations
|
|
63
|
+
|
|
64
|
+
## [0.1.0] - 2024-10-29
|
|
65
|
+
### Added
|
|
66
|
+
- Initial release
|
|
67
|
+
- Basic error handling functionality
|
|
68
|
+
- Core healing agent features
|
|
69
|
+
- Basic documentation
|
|
70
|
+
|
|
71
|
+
[0.2.1]: https://github.com/matebenyovszky/healing-agent/compare/v0.2.0...v0.2.1
|
|
72
|
+
[0.2.0]: https://github.com/matebenyovszky/healing-agent/compare/v0.1.2...v0.2.0
|
|
73
|
+
[0.1.2]: https://github.com/matebenyovszky/healing-agent/compare/v0.1.1...v0.1.2
|
|
74
|
+
[0.1.1]: https://github.com/matebenyovszky/healing-agent/compare/v0.1.0...v0.1.1
|
|
75
|
+
[0.1.0]: https://github.com/matebenyovszky/healing-agent/releases/tag/v0.1.0
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 matebenyovszky
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: healing_agent
|
|
3
|
+
Version: 0.2.4
|
|
4
|
+
Summary: An AI-powered agent that helps fix and heal buggy code
|
|
5
|
+
Project-URL: Homepage, https://github.com/matebenyovszky/healing-agent
|
|
6
|
+
Project-URL: Bug Tracker, https://github.com/matebenyovszky/healing-agent/issues
|
|
7
|
+
Project-URL: Documentation, https://github.com/matebenyovszky/healing-agent#readme
|
|
8
|
+
Project-URL: Repository, https://github.com/matebenyovszky/healing-agent.git
|
|
9
|
+
Project-URL: Changelog, https://github.com/matebenyovszky/healing-agent/blob/main/CHANGELOG.md
|
|
10
|
+
Author-email: Mรกtรฉ Benyovszky <benyovszky.mate.work@outlook.com>
|
|
11
|
+
License: MIT
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Keywords: agent,ai,automation,bug-fixing,code-healing,code-repair,debugging,developer-tools,error-handling,exception-handling,openai
|
|
14
|
+
Classifier: Development Status :: 3 - Alpha
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Intended Audience :: Information Technology
|
|
17
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
18
|
+
Classifier: Natural Language :: English
|
|
19
|
+
Classifier: Operating System :: OS Independent
|
|
20
|
+
Classifier: Programming Language :: Python :: 3
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
25
|
+
Classifier: Topic :: Software Development :: Debuggers
|
|
26
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
27
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
28
|
+
Requires-Python: >=3.9
|
|
29
|
+
Requires-Dist: astor
|
|
30
|
+
Requires-Dist: openai>=1.12.0
|
|
31
|
+
Requires-Dist: requests>=2.28.2
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
|
|
34
|
+
# Healing Agent ๐ฉบ
|
|
35
|
+
|
|
36
|
+
Healer Agent is an intelligent code assistant that catches with detailed context and fixes errors in your Python code. It leverages the power of AI to provide smart suggestions and corrections, helping you write more robust and "self-healing" code.
|
|
37
|
+
|
|
38
|
+
โ ๏ธ Not intended for production use. Be extra careful with the optional AUTO_FIX function, as although it makes backups of your code, it actually changes and runs your code. โ ๏ธ
|
|
39
|
+
|
|
40
|
+
Goal: first actually usable autonomous coding agent in production
|
|
41
|
+
|
|
42
|
+
## Features โจ
|
|
43
|
+
|
|
44
|
+
- ๐จ Automatic error detection and handling of diverse exception types
|
|
45
|
+
- ๐ก Smart error analysis and solution suggestions (auto-generated fixing hints and code)
|
|
46
|
+
- ๐ Comprehensive error analysis including exception details, stack traces, local and globalvariables and root cause identification
|
|
47
|
+
- ๐ง Advanced AI-powered code healing using LLMs of different providers
|
|
48
|
+
- ๐ง Zero-config integration with Python projects (just import and decorate)
|
|
49
|
+
- ๐พ Robust error tracking and debugging:
|
|
50
|
+
- Exception context saved to JSON (code, error details, function info and args)
|
|
51
|
+
- Automatic code backups before fixes
|
|
52
|
+
- Detailed analysis results and fix history
|
|
53
|
+
- Quick test of fixes
|
|
54
|
+
- ๐ค (Optionally) Fully automated operation with minimal human intervention
|
|
55
|
+
|
|
56
|
+
## How it works ๐ง
|
|
57
|
+
|
|
58
|
+
```mermaid
|
|
59
|
+
graph TD
|
|
60
|
+
A[Import healing_agent] --> B[Configuration: AI access etc.]
|
|
61
|
+
B --> C[Decorate functions with healing_agent]
|
|
62
|
+
C --> D[Run Code / Execute Functions]
|
|
63
|
+
D -->|No problem| L[Success]
|
|
64
|
+
D -->|Exception?| F[Get and Save Detailed Context]
|
|
65
|
+
F --> G[Auto-generate Fixing Hints and Code with AI]
|
|
66
|
+
G --> H[Test Generated Code]
|
|
67
|
+
H --> I[Create backup]
|
|
68
|
+
I --> J[Apply Code Fixes]
|
|
69
|
+
J --> D
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Installation ๐ป
|
|
73
|
+
|
|
74
|
+
To install Healing Agent, follow these steps:
|
|
75
|
+
|
|
76
|
+
PIP package from GitHub:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
pip install git+https://github.com/matebenyovszky/healing-agent
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
OR from source:
|
|
83
|
+
|
|
84
|
+
1. Clone the repository:
|
|
85
|
+
```bash
|
|
86
|
+
git clone https://github.com/matebenyovszky/healing-agent.git
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
2. Navigate to the project directory:
|
|
90
|
+
```bash
|
|
91
|
+
cd healing-agent
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
3. Install:
|
|
95
|
+
```bash
|
|
96
|
+
pip install -e .
|
|
97
|
+
```
|
|
98
|
+
OR run overall test to install and test functionality:
|
|
99
|
+
```bash
|
|
100
|
+
python scripts/overall_test.py
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Usage ๐ง
|
|
104
|
+
|
|
105
|
+
To use Healing Agent in your project, follow these steps:
|
|
106
|
+
|
|
107
|
+
1. Import the `healing_agent` decorator in your Python file:
|
|
108
|
+
```python
|
|
109
|
+
import healing_agent
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
2. Decorate the function you want to monitor with `@healing_agent`:
|
|
113
|
+
```python
|
|
114
|
+
@healing_agent
|
|
115
|
+
def your_function():
|
|
116
|
+
# Your code here
|
|
117
|
+
```
|
|
118
|
+
You can also pass parameters to the decorator to change the behavior set in the config file:
|
|
119
|
+
```python
|
|
120
|
+
@healing_agent(AUTO_FIX=False)
|
|
121
|
+
def your_function():
|
|
122
|
+
# Your code here
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
3. Run your Python script as usual. Healing Agent will automatically detect, save context and attempt to fix any errors that occur within the decorated function.
|
|
126
|
+
|
|
127
|
+
Context (and code file backup in case of auto-fix) is saved to a JSON/Python file in the same directory as your script with actual timestamp in the filename.
|
|
128
|
+
|
|
129
|
+
## Configuration โ๏ธ
|
|
130
|
+
|
|
131
|
+
Healing Agent provides extensive configuration options through the `healing_agent_config.py` file, which defines essential settings such as the AI provider and API credentials. The configuration system follows these principles:
|
|
132
|
+
|
|
133
|
+
1. **Automatic Configuration Loading**: On startup, Healing Agent attempts to load settings from `healing_agent_config.py`
|
|
134
|
+
2. **Fallback Mechanism**: If the configuration file is not found, the system falls back to pre-defined default settings
|
|
135
|
+
3. **Auto-Configuration**: When no configuration file exists, Healing Agent automatically creates one in the default user directory
|
|
136
|
+
|
|
137
|
+
### Supported AI Providers
|
|
138
|
+
|
|
139
|
+
Healing Agent integrates with multiple AI providers - list could be extended:
|
|
140
|
+
- OpenAI
|
|
141
|
+
- Azure OpenAI
|
|
142
|
+
- LiteLLM
|
|
143
|
+
- Anthropic
|
|
144
|
+
- Ollama
|
|
145
|
+
|
|
146
|
+
**Note**: While multiple providers are supported, Azure OpenAI has been extensively tested. Support for other providers is under active development (feedback welcome).
|
|
147
|
+
|
|
148
|
+
## Testing ๐งช
|
|
149
|
+
|
|
150
|
+
To test Healing Agent, you can use the `scripts/test_file_generator.py` script to generate test files in the `tests` directory. `overall_test.py` will run all tests and provide a report on the functionality of Healing Agent.
|
|
151
|
+
|
|
152
|
+
## Use Cases ๐ก
|
|
153
|
+
|
|
154
|
+
- **Development**: Use Healing Agent during development to catch and fix errors early, and let AI generate fixes for your code. This is what you would do anyways, but now it's automated. ๐
|
|
155
|
+
- **Educational Tool**: Use Healing Agent as a learning tool to understand AI coding capabilities and limitations.
|
|
156
|
+
|
|
157
|
+
## Cooking open source ๐ณ
|
|
158
|
+
|
|
159
|
+
Healing Agent is distributed under the MIT License. See `LICENSE` for more information. Feedback and contributions are welcome!
|