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

Option for auto-learning project root #290

Open
dlqqq opened this issue Jul 24, 2023 · 10 comments
Open

Option for auto-learning project root #290

dlqqq opened this issue Jul 24, 2023 · 10 comments
Labels
enhancement New feature or request project:learn-ask /learn and /ask commands, discoverability
Milestone

Comments

@dlqqq
Copy link
Member

dlqqq commented Jul 24, 2023

Problem

Some users would like to automatically invoke /learn on their entire project root at server start to make local RAG easier.

Proposed Solution

Right now, I think whether this should be implemented is still an open discussion. I personally am against this, as it violates our principle of never implicitly invoking upstream models without an explicit user action.

@dlqqq dlqqq added enhancement New feature or request project:learn-ask /learn and /ask commands, discoverability labels Jul 24, 2023
@JasonWeill JasonWeill added this to the Future milestone Jul 27, 2023
@liyongsea
Copy link

Hi, our team has been working on the jupytercoder as a chrome extension. It would be amazing if we could integrate this natively into the jupyter notebook. Starcoder has been trained on purpose on some notebook data to incoporate the output of the cell.
Do you think this will fit into the principle that dlqqq mention above ? @JasonWeill
Otherwise we are very happy to start trying to implement this

@dlqqq
Copy link
Member Author

dlqqq commented Aug 11, 2023

@liyongsea Could you offer some more details on what you want your PR to implement? We can provide helpful guidance to help navigate your team through our code.

@liyongsea
Copy link

It is basicly a codex link plugin for jupyter notebook. Currently it is implemented as a chrome extension. We use a trick to simulate the input of a user by modifying the DOM
Here is a demo of the expected behavior https://twitter.com/BigCodeProject/status/1654174953565044736
Here is what we want to do:

  • read the content of the cells, including the output
  • send to starcoder, which has been trained specifically on notebook
  • suggest to result as grey text
    I would like to first validate the interest of such a plugin

@dlqqq
Copy link
Member Author

dlqqq commented Aug 14, 2023

@liyongsea We are most certainly open to the idea, and would welcome a PR. But this feature would have to live inside the current labextension code and not as a separate Chrome extension to be used with Jupyter AI. I expect this to be a fairly difficult task, as you would have to use some JupyterLab autocomplete API in addition to streaming LLM responses from the Jupyter AI server extension.

I also wanted to emphasize that this is not something we wish to offer by default. We would never want to automatically send the contents of a user's notebook to a remote LLM without their explicit consent.

@liyongsea
Copy link

liyongsea commented Aug 15, 2023

Hi @dlqqq thank you for your reply !

But this feature would have to live inside the current labextension code and not as a separate Chrome extension to be used with Jupyter AI

This is also our will, because with the chrome extension, we modify directly the DOM, which is very difficult to maintain

I expect this to be a fairly difficult task, as you would have to use some JupyterLab autocomplete API in addition to streaming LLM responses from the Jupyter AI server extension.

It would be nice if you could point us to a starting point. The difficult part in our previous experience, is to find an appropriate way to modify the input cell in the notebook

I also wanted to emphasize that this is not something we wish to offer by default

Totally agree.

@dlqqq
Copy link
Member Author

dlqqq commented Aug 15, 2023

@liyongsea I would highly recommend two resources:

  1. The JupyterLab extension development guide

  2. The JupyterLab JavaScript API documentation

The way to do pretty much anything client-side is via the JupyterLab JavaScript API, which unfortunately isn't that well-documented. I think the best way to learn extension development is to look at our source code. Keep in mind the JavaScript entry point is almost always under src/index.tsx for any labextension.

@liyongsea
Copy link

Hi @dlqqq ,
We have made some progress. This is a functionning prototype.
Here is the main idea:

  • add a new side bar in https://github.com/jupyterlab/jupyter-ai/blob/main/packages/jupyter-ai/src/index.ts to configurate the autocomplete fonctionality
  • add keydown event listen (in a frist version, user has to type something to trigger the autocomplete. Will improve it very soon)
    It would be part of the current jupyter ai. User will have to activate the plugin. In a first version, user will use a key to trigger the auto complete.
    If you think this make sense, we will create a PR. Is there any coding style/testing best practice for us to respect ? Who do you think is the bes person to review the PR ?

@liyongsea
Copy link

Hi @dlqqq
We have built a functionning prototype, shall I create a PR for you to review ?

@dlqqq
Copy link
Member Author

dlqqq commented Aug 31, 2023

@liyongsea Please feel free to submit a PR! We welcome all contributions. I can help with the review.

@liyongsea
Copy link

Hi @dlqqq #378 here you go :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request project:learn-ask /learn and /ask commands, discoverability
Projects
None yet
Development

No branches or pull requests

3 participants