Custom Excepthook with Enhancement

What My Project Does:

It a project which replaces the default python excepthook `sys.excepthook` with a custom one which leverages the `rich` library to enhance the traceback and LLM `GROQ` to fix the error.

Target Audience:

Just a toy project

Comparison:

It an attempt to replicate what I saw here from an image, which only showcased LLM `Deepseek` fixing the code when an error is encountered.

This my attempt includes the error fixing using `GROQ` and enhances the output using `rich`. In the `__main__` module, if there is a presence of `#: enhance`, the custom excepthook if triggered will enhance the traceback into a beautiful tree, if there is a presence of `#: fix`, the custom excepthook will use `GROQ` to fix the error in the `__main__` module.

Image the showcase

The image samples’ `__main__` has an intentional exception trigger and the terminal showing the enhanced exception

The GitHub page

The GitHub page with the source code

submitted by /u/No_Date8616 to r/Python
[link] [comments]


Commentaires

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *