Skip to content
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

Show error animation in code cell when error is triggered #1144

Open
andrewfulton9 opened this issue Dec 9, 2024 · 3 comments
Open

Show error animation in code cell when error is triggered #1144

andrewfulton9 opened this issue Dec 9, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@andrewfulton9
Copy link
Contributor

With JupyterLab #15344 the ability to add an error animation to a code call was added.

image

It should be relatively straight forward to allow the jupyter-ai completers to enable this functionality.

Problem

The jupyter-ai error reporting on inline completion differs from jupyterlab completer. Currently jupyterlab shows a flashing icon in the cell, while jupyter-ai has a notification warning

Proposed Solution

I propose allowing jupyter-ai to emit the error field when there is an error in the generation process. I am not sure if this should be in place of the error notification, or alongside of it. The benefit of keeping it alongside the current notification would be that the current notification gives more context.

Additional context

@Darshan808
Copy link
Member

Hi @andrewfulton9
I wanted to let you know that I used your branch as a reference while working on this issue. It provided a good starting point!
I've submitted a PR trying to address this issue and would really appreciate it if you could take a look and provide some feedback.
Link to PR: #1197

@Darshan808
Copy link
Member

Hi @andrewfulton9
I just wanted to know whether you saw the error animation in code cell after returning item containing error field from fetch function of JaiInlineProvider. Because I am having some issues with jupyterlab after installing jupyter-ai. I am seeing some version incompatible issues in console and the code changes in jupyterlab aren't being reflected. Could you let me know if you faced the same issue. Or how you approached this?

Before installing jupyter-ai

Image

After installing jupyter-ai

Image

Image

@andrewfulton9
Copy link
Contributor Author

I think the code here is your problem. The results with the error field are never actually returned to the inline-completer as it is in your PR currently. If you remove the code I linked. I think it should work.

Here is a messy branch that I was using for testing locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants