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

Chat settings UI #141

Merged
merged 10 commits into from
May 4, 2023
Merged

Chat settings UI #141

merged 10 commits into from
May 4, 2023

Conversation

dlqqq
Copy link
Member

@dlqqq dlqqq commented May 3, 2023

Description

Screen.Recording.2023-05-03.at.4.26.47.PM.mov

Implement basic chat settings UI that allows users to switch language models, embedding models, and add API keys. Other changes:

  • Model config is now created automatically on initialization if one doesn't exist
  • Prefer upper-case environment variables in the config file

Screenshots

Screen Shot 2023-05-03 at 11 50 14 AM

This UI also handles loading and error states for the initial fetch. The loading state is an animated spinner, though this isn't captured well via screenshot.

Screen Shot 2023-05-02 at 2 34 21 PM

Screen Shot 2023-05-02 at 2 38 23 PM

@dlqqq dlqqq added the enhancement New feature or request label May 3, 2023
@3coins
Copy link
Collaborator

3coins commented May 3, 2023

@dlqqq
Thanks for working on this. It works great, makes it really simple to switch models 🚀 .

Here are a few observations:

  1. I started with no config, and did not see any error or initial screen prompting me to add these settings before using the chat ui. As I used the chat, I got this error.
    Screen Shot 2023-05-03 at 12 03 39 PM
    We should rather start with the settings panel, if there is no config entered, with a message at the top that these values are required for chat usage.

  2. The save link does not have any indication when you click to save the values, we should show a message and return back to chat, once the values are saved. Minor: We could use a button rather than a link for the save action, and align it to the right.

  3. The list component for the model selection is too long, can we limit the height of the popup?

  4. Minor: Use a different settings icon, this one conflicts with the gear icon in the right panel.

@dlqqq
Copy link
Member Author

dlqqq commented May 3, 2023

@3coins Thank you for the poignant feedback! I addressed all your points with the exception of the settings icon; I think we'll want some input from a UXD before changing it.

@3coins
Copy link
Collaborator

3coins commented May 4, 2023

@dlqqq
Thanks for making all the changes, the demo looks great 👍.
I corrected the hint string for the chat input, and made a slight change in the welcome message. Rather than asking users to find the settings icon, I added a button in the message to take them there. Please feel free to update if this doesn't look ok and merge.
Screenshot 2023-05-03 at 7 17 17 PM

@dlqqq
Copy link
Member Author

dlqqq commented May 4, 2023

That looks great, thank you!

@dlqqq dlqqq merged commit 520b45e into jupyterlab:model-config May 4, 2023
@dlqqq dlqqq deleted the config-ui branch May 4, 2023 15:34
This was referenced May 4, 2023
dlqqq added a commit that referenced this pull request May 5, 2023
* Refactored provider load, decompose logic, aded model provider list api

* Renamed model

* Sorted the provider names

* WIP: Embedding providers

* Added embeddings provider api

* Added missing import

* Moved providers to ray actor, added config actor

* Ability to load llm and embeddings from config

* Moved llm creation to specific actors

* Added apis for fetching, updating config. Fixed config update, error handling

* Updated as per PR feedback

* Fixes issue with cohere embeddings, api keys not working

* Added an error check when embedding change causes read error

* Delete and re-index docs when embedding model changes (#137)

* Added an error check when embedding change causes read error

* Refactored provider load, decompose logic, aded model provider list api

* Re-indexes dirs when embeddings change, learn list command

* Fixed typo, simplified adding metadata

* Moved index dir, metadata path to constants

* Chat settings UI (#141)

* remove unused div

* automatically create config if not present

* allow all-caps envvars in config

* implement basic chat settings UI

* hide API key text inputs

* limit popup size, show success banner

* show welcome message if no LM is selected

* fix buggy UI with no selected LM/EM

* exclude legacy OpenAI chat provider used in magics

* Added a button with welcome message

---------

Co-authored-by: Jain <[email protected]>

* Various chat chain enhancements and fixes (#144)

* fix /clear command

* use model IDs to compare LLMs instead

* specify stop sequence in chat chain

* add empty AI message, improve system prompt

* add RTD configuration

---------

Co-authored-by: Piyush Jain <[email protected]>
Co-authored-by: Jain <[email protected]>
dbelgrod pushed a commit to dbelgrod/jupyter-ai that referenced this pull request Jun 10, 2024
* Refactored provider load, decompose logic, aded model provider list api

* Renamed model

* Sorted the provider names

* WIP: Embedding providers

* Added embeddings provider api

* Added missing import

* Moved providers to ray actor, added config actor

* Ability to load llm and embeddings from config

* Moved llm creation to specific actors

* Added apis for fetching, updating config. Fixed config update, error handling

* Updated as per PR feedback

* Fixes issue with cohere embeddings, api keys not working

* Added an error check when embedding change causes read error

* Delete and re-index docs when embedding model changes (jupyterlab#137)

* Added an error check when embedding change causes read error

* Refactored provider load, decompose logic, aded model provider list api

* Re-indexes dirs when embeddings change, learn list command

* Fixed typo, simplified adding metadata

* Moved index dir, metadata path to constants

* Chat settings UI (jupyterlab#141)

* remove unused div

* automatically create config if not present

* allow all-caps envvars in config

* implement basic chat settings UI

* hide API key text inputs

* limit popup size, show success banner

* show welcome message if no LM is selected

* fix buggy UI with no selected LM/EM

* exclude legacy OpenAI chat provider used in magics

* Added a button with welcome message

---------

Co-authored-by: Jain <[email protected]>

* Various chat chain enhancements and fixes (jupyterlab#144)

* fix /clear command

* use model IDs to compare LLMs instead

* specify stop sequence in chat chain

* add empty AI message, improve system prompt

* add RTD configuration

---------

Co-authored-by: Piyush Jain <[email protected]>
Co-authored-by: Jain <[email protected]>
Marchlak pushed a commit to Marchlak/jupyter-ai that referenced this pull request Oct 28, 2024
* Refactored provider load, decompose logic, aded model provider list api

* Renamed model

* Sorted the provider names

* WIP: Embedding providers

* Added embeddings provider api

* Added missing import

* Moved providers to ray actor, added config actor

* Ability to load llm and embeddings from config

* Moved llm creation to specific actors

* Added apis for fetching, updating config. Fixed config update, error handling

* Updated as per PR feedback

* Fixes issue with cohere embeddings, api keys not working

* Added an error check when embedding change causes read error

* Delete and re-index docs when embedding model changes (jupyterlab#137)

* Added an error check when embedding change causes read error

* Refactored provider load, decompose logic, aded model provider list api

* Re-indexes dirs when embeddings change, learn list command

* Fixed typo, simplified adding metadata

* Moved index dir, metadata path to constants

* Chat settings UI (jupyterlab#141)

* remove unused div

* automatically create config if not present

* allow all-caps envvars in config

* implement basic chat settings UI

* hide API key text inputs

* limit popup size, show success banner

* show welcome message if no LM is selected

* fix buggy UI with no selected LM/EM

* exclude legacy OpenAI chat provider used in magics

* Added a button with welcome message

---------

Co-authored-by: Jain <[email protected]>

* Various chat chain enhancements and fixes (jupyterlab#144)

* fix /clear command

* use model IDs to compare LLMs instead

* specify stop sequence in chat chain

* add empty AI message, improve system prompt

* add RTD configuration

---------

Co-authored-by: Piyush Jain <[email protected]>
Co-authored-by: Jain <[email protected]>
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

Successfully merging this pull request may close these issues.

2 participants