-
-
Notifications
You must be signed in to change notification settings - Fork 371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds Err array with exceptions captured #34
Conversation
Improves traceback formatting, adds a workbook. (My local PC isn't set up to actually call ChatGPT yet, though) |
Looks like this is not quite functioning as expected yet:
I believe we will need to do everything we need to with |
Also, the example notebook looks like it isn't resolving the model id. |
@ellisonbg Can you elaborate more on the model ID resolution issue you are facing? The implementation didn't respect the model ID for the HuggingFace Hub provider, but that bug should now be fixed in the latest release (0.4.0). |
After discussion, the model ID resolution issue was related to an issue with my dev environment; I was still running 0.3.0 code. Rerunning |
Updated screen shot in original description; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! Left a few comments.
This needs to be reconciled with #48. So exception.py
should be moved to packages/jupyter-ai-magics/jupyter_ai_magics
, and the load_ipython_extension
and unload_ipython_extension
functions should be defined there in __init__.py
as well.
Then in jupyter_ai
, you can declare:
# expose jupyter_ai_magics ipython extension
from jupyter_ai_magics import load_ipython_extension, unload_ipython_extension
These imports expose the extension hooks to IPython in jupyter_ai
. 😁
fc11c55
to
f2cdd0d
Compare
f2cdd0d
to
93213bb
Compare
Changes made in subsequent code pushes
* Defines exception handler * Reraises exception * More detailed traceback * Adds improved formatting, example workbook * Uses chatgpt model * Uses shell.showtraceback * Displays traceback info from tb, needs to return a structured traceback * Returns a list of strings or None * Shows traceback, updates sample notebook * Avoids using tb for traceback, updates example notebook * Mentions jupyter_ai_magics everywhere * Expose jupyter_ai_magics in jupyter_ai * Removes unload_ipython_extension * Removes import of unload * Simplifies error capture * Update sample errors doc * Reinstates jupyter_ai as extension name * Disables ANSI color strings so that the error is captured in text * Sample notebook w/non-color error * Handles syntax errors * Reinstates unload_ipython_extension * Reverts _magics from docs
* Defines exception handler * Reraises exception * More detailed traceback * Adds improved formatting, example workbook * Uses chatgpt model * Uses shell.showtraceback * Displays traceback info from tb, needs to return a structured traceback * Returns a list of strings or None * Shows traceback, updates sample notebook * Avoids using tb for traceback, updates example notebook * Mentions jupyter_ai_magics everywhere * Expose jupyter_ai_magics in jupyter_ai * Removes unload_ipython_extension * Removes import of unload * Simplifies error capture * Update sample errors doc * Reinstates jupyter_ai as extension name * Disables ANSI color strings so that the error is captured in text * Sample notebook w/non-color error * Handles syntax errors * Reinstates unload_ipython_extension * Reverts _magics from docs
Fixes #41.
If a particular cell causes an exception, captures the text of the exception in a special
Err
array, with the same indexing asIn
andOut
.Handles
SyntaxError
s specifically.