-
-
Notifications
You must be signed in to change notification settings - Fork 334
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
Autocomplete frontend fixes #583
Autocomplete frontend fixes #583
Conversation
@krassowski I suddenly ran into some issues while developing my branch. I'm not sure that it's due to any code change from my end however, since none of my Specifically, I'm seeing this error in the console, which occurs before When I try bumping the version of Just wanted to check in to see if you knew a quick fix for this. No pressure though; I can figure this out myself tomorrow. |
What version do you see in help menu -> about? |
I've pushed the work that I've gotten done so far. Given that I still don't have an explanation for why I'm unable to build this branch now, I admit that it may just be an error with my recent code changes, and that the warnings may be unrelated. I have to take a quick break to patch the Cohere provider and then cut a patch release. Will be back tomorrow. 👋 |
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.
I pulled your changes and was able to build both ff197cf and cfa8144 (after installing langchain-community dependency) without an issue. The former worked well, but cfa8144 introduces a bug because you are attempting to load the settings for @jupyterlab/completer-extension:inline-completer
too early, which results in:
jupyterlab/completer-extension:inline-completer has no transformers yet
error.
As for your build issue, I suspect that you either:
- have some stale artefacts in
packages/jupyter-ai/jupyter_ai/labextension/static/
- have a broken state in
node_modules
(e.g. due to interrupted install or such).
Force-removing them followed by clean install and build will likely help, but if not I would then recommend trying in a new clean environment.
@krassowski I was actually able to build the branch as of the latest commit yesterday, but I misspoke because I was really tired that afternoon. My comment was in reference to the console warnings I am still seeing but now appear to be unrelated. I replied to your explanation above for why this branch is failing at runtime, let's continue the discussion there. 🤗 |
This PR is ready for review. Here's a quick demo video of what it looks like. Screen.Recording.2024-01-19.at.10.51.19.AM.mov |
ee7b9cd
to
07827f6
Compare
Once this is merged, I will rebase the |
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.
Some tiny suggestions
Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com>
@krassowski Thanks for the edits! I addressed your comments above. 👍 |
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.
Thank you @dlqqq!
* remove duplicate definition of inline completion provider * rename completion variables, plugins, token to be more accurate * abbreviate JupyterAIInlineProvider => JaiInlineProvider * bump @jupyterlab/completer and typescript * WIP: fix Jupyter AI completion settings * Fix issues with settings population * read from settings directly instead of using a cache * disable Jupyter AI completion by default * improve completion plugin menu items * revert unnecessary edits to package manifest * Update packages/jupyter-ai/src/components/statusbar-item.tsx Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com> * tweak wording --------- Co-authored-by: krassowski <5832902+krassowski@users.noreply.github.com>
* Inline code completions (#465) * Draft inline completions implementation (server side) * Implement inline completion provider (front) * Add default debounce delay and error handling (front) * Add `gpt-3.5-turbo-instruct` because text- models are deprecated. OpenAI specifically recommends using `gpt-3.5-turbo-instruct` in favour of text-davinci, text-ada, etc. See: https://platform.openai.com/docs/deprecations/ * Improve/fix prompt template and add simple post-processing * Handle missing `registerInlineProvider`, handle no model in name * Remove IPython mention to avoid confusing languages * Disable suggestions in markdown, move language logic * Remove unused background and clip path from jupyternaut * Implement toggling the AI completer via statusbar item also adds the icon for provider re-using jupyternaut icon * Implement streaming support * Translate ipython to python for models, remove log * Move `BaseLLMHandler` to `/completions` rename to `LLMHandlerMixin` * Move frontend completions code to `/completions` * Make `IStatusBar` required for now, lint * Simplify inline completion backend (#553) * do not import from pydantic directly * refactor inline completion backend * Autocomplete frontend fixes (#583) * remove duplicate definition of inline completion provider * rename completion variables, plugins, token to be more accurate * abbreviate JupyterAIInlineProvider => JaiInlineProvider * bump @jupyterlab/completer and typescript * WIP: fix Jupyter AI completion settings * Fix issues with settings population * read from settings directly instead of using a cache * disable Jupyter AI completion by default * improve completion plugin menu items * revert unnecessary edits to package manifest * Update packages/jupyter-ai/src/components/statusbar-item.tsx Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com> * tweak wording --------- Co-authored-by: krassowski <5832902+krassowski@users.noreply.github.com> --------- Co-authored-by: David L. Qiu <david@qiu.dev>
? `Disable completions in ${displayName(language)}` | ||
: 'Disable completions in <language> files'; |
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.
Ah, this switch gave me confusion as a user. All other UI elements in JupyterLab use positive mode.
* Inline code completions (jupyterlab#465) * Draft inline completions implementation (server side) * Implement inline completion provider (front) * Add default debounce delay and error handling (front) * Add `gpt-3.5-turbo-instruct` because text- models are deprecated. OpenAI specifically recommends using `gpt-3.5-turbo-instruct` in favour of text-davinci, text-ada, etc. See: https://platform.openai.com/docs/deprecations/ * Improve/fix prompt template and add simple post-processing * Handle missing `registerInlineProvider`, handle no model in name * Remove IPython mention to avoid confusing languages * Disable suggestions in markdown, move language logic * Remove unused background and clip path from jupyternaut * Implement toggling the AI completer via statusbar item also adds the icon for provider re-using jupyternaut icon * Implement streaming support * Translate ipython to python for models, remove log * Move `BaseLLMHandler` to `/completions` rename to `LLMHandlerMixin` * Move frontend completions code to `/completions` * Make `IStatusBar` required for now, lint * Simplify inline completion backend (jupyterlab#553) * do not import from pydantic directly * refactor inline completion backend * Autocomplete frontend fixes (jupyterlab#583) * remove duplicate definition of inline completion provider * rename completion variables, plugins, token to be more accurate * abbreviate JupyterAIInlineProvider => JaiInlineProvider * bump @jupyterlab/completer and typescript * WIP: fix Jupyter AI completion settings * Fix issues with settings population * read from settings directly instead of using a cache * disable Jupyter AI completion by default * improve completion plugin menu items * revert unnecessary edits to package manifest * Update packages/jupyter-ai/src/components/statusbar-item.tsx Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com> * tweak wording --------- Co-authored-by: krassowski <5832902+krassowski@users.noreply.github.com> --------- Co-authored-by: David L. Qiu <david@qiu.dev>
* Inline code completions (jupyterlab#465) * Draft inline completions implementation (server side) * Implement inline completion provider (front) * Add default debounce delay and error handling (front) * Add `gpt-3.5-turbo-instruct` because text- models are deprecated. OpenAI specifically recommends using `gpt-3.5-turbo-instruct` in favour of text-davinci, text-ada, etc. See: https://platform.openai.com/docs/deprecations/ * Improve/fix prompt template and add simple post-processing * Handle missing `registerInlineProvider`, handle no model in name * Remove IPython mention to avoid confusing languages * Disable suggestions in markdown, move language logic * Remove unused background and clip path from jupyternaut * Implement toggling the AI completer via statusbar item also adds the icon for provider re-using jupyternaut icon * Implement streaming support * Translate ipython to python for models, remove log * Move `BaseLLMHandler` to `/completions` rename to `LLMHandlerMixin` * Move frontend completions code to `/completions` * Make `IStatusBar` required for now, lint * Simplify inline completion backend (jupyterlab#553) * do not import from pydantic directly * refactor inline completion backend * Autocomplete frontend fixes (jupyterlab#583) * remove duplicate definition of inline completion provider * rename completion variables, plugins, token to be more accurate * abbreviate JupyterAIInlineProvider => JaiInlineProvider * bump @jupyterlab/completer and typescript * WIP: fix Jupyter AI completion settings * Fix issues with settings population * read from settings directly instead of using a cache * disable Jupyter AI completion by default * improve completion plugin menu items * revert unnecessary edits to package manifest * Update packages/jupyter-ai/src/components/statusbar-item.tsx Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com> * tweak wording --------- Co-authored-by: krassowski <5832902+krassowski@users.noreply.github.com> --------- Co-authored-by: David L. Qiu <david@qiu.dev>
Description
I've structured this branch to be easy to review; reviewers should be able to follow this branch commit-by-commit.
Removes duplicate definition of plugin
Renames a lot of variables to be more similar to their function / type
inlineCompletionProvider
(plugin) =>completionPlugin
jupyternautStatus
(plugin) =>statusItemPlugin
IJupyternautStatus
(token + interface) =>IJaiStatusItem
Fix issue where users are not able to edit settings on a fresh installation