GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - roma-guru/smart-exceptions: Better Python Stacktraces with power of AI.

BranchesTags
Open more actions menu

Latest commit

 

History

43 Commits
43 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
smart_exceptions
smart_exceptions
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
LICENSE.txt
LICENSE.txt
 
 
README.md
README.md
 
 
example.ipynb
example.ipynb
 
 
example.py
example.py
 
 
screenshot.png
screenshot.png
 
 
setup.cfg
setup.cfg
 
 
setup.py
setup.py
 
 

Repository files navigation

smart-exceptions

Better Python Stacktraces with power of AI. Now your problems are solved at the same moment they're arised!

Installation

pip install smart-exceptions

Usage

In file:

import smart_exceptions as se
se.init("your-openai-token")
se.install_handler()
...[code causing exception]...

In [debug] console global exception handler is suppressed and have to call GPT explicitly:

>>> import smart_exceptions as se; se.init("your-openai-token")
>>> ...[code causing exception]...
>>> se.ask_gpt()

You can provide token explicitly or implicitly via $OPENAI_TOKEN env variable. Also you can specify proxy explicitly or via $OPENAI_PROXY.

Pytest support

Place this in conftest.py:

import smart_exceptions as se
se.init()


def pytest_exception_interact(node, call, report):
    exc_info = (call.excinfo.type, call.excinfo.value, call.excinfo.traceback[0]._rawentry)
    se.gpt_backend.ask_gpt(exc_info)

Demo

Smart Exceptions Demo

Click to go to Youtube.

About

Better Python Stacktraces with power of AI.

Resources

Readme
MIT license
Activity

Stars

4 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.