Spaces:
Sleeping
Sleeping
| """Auto-Heal Agent: ????? ?????? ??????? ???????.""" | |
| import logging | |
| from typing import Dict, Any | |
| from api.deps import get_logger | |
| logger = get_logger("kapo.agent.auto_heal") | |
| ERROR_MAP = { | |
| "ModuleNotFoundError": "pip install <package>", | |
| "command not found": "apt-get install <package>", | |
| "SyntaxError": "???? ????? ????? ????? ????????", | |
| "Permission denied": "???? ?? ??????? ?????? ?? ?????? ???? ?????", | |
| } | |
| class AutoHealAgent: | |
| def suggest(self, error_text: str, step: Dict[str, Any]) -> Dict[str, Any]: | |
| """?????? ??? ????? ???? ??? ?????.""" | |
| for key, fix in ERROR_MAP.items(): | |
| if key in error_text: | |
| return {"error": error_text, "suggested_fix": fix, "step": step} | |
| return {"error": error_text, "suggested_fix": "???? ?? ????? ??????"} | |