Learn from an error and its fix in one call. Args: error_type: Type of error error_message: Full error message fix: Fix that was applied success: Whether fix worked context: Additional context
(self, error_type: str, error_message: str,
fix: str, success: bool = True,
context: Dict = None)
| 242 | info(f"Recorded fix for {pattern.error_type}: {fix[:50]}...") |
| 243 | |
| 244 | def learn_from_error(self, error_type: str, error_message: str, |
| 245 | fix: str, success: bool = True, |
| 246 | context: Dict = None): |
| 247 | """ |
| 248 | Learn from an error and its fix in one call. |
| 249 | |
| 250 | Args: |
| 251 | error_type: Type of error |
| 252 | error_message: Full error message |
| 253 | fix: Fix that was applied |
| 254 | success: Whether fix worked |
| 255 | context: Additional context |
| 256 | """ |
| 257 | key = self.record_error(error_type, error_message, context) |
| 258 | self.record_fix(key, fix, success) |
| 259 | |
| 260 | def find_similar_errors(self, error_type: str, error_message: str, |
| 261 | limit: int = 5) -> List[Tuple[ErrorPattern, float]]: |