-
-
Notifications
You must be signed in to change notification settings - Fork 353
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
Config V2 #353
Config V2 #353
Conversation
100e7fb
to
603ea16
Compare
I see that this is a draft but given no description/references I just wanted to ask if the intention is to address #313 too, or if I shall open a PR to implement it. If you are open to PRs, I suspect it makes sense to wait until this one is merged to avoid conflicts/rewrite. Is there a rough timeline for this? |
7c08996
to
d40f215
Compare
@krassowski Thanks for following up about #313! This PR doesn't address #313, but that can be implemented immediately after this PR is merged. I just marked this PR ready for review, so this should be in by the end of the week. If you'd like, we can assign #313 to you if you'd like to own the issue after this PR is merged. For context, I was violently ill the last week, so this PR had taken much longer than I had initially hoped. Thankfully, I feel better now, so any changes to the config should be unblocked very shortly. 😁 |
Thank you for getting back to me. I hope you feel good now! I assigned myself and will start working on it on top of this PR. |
If we're making a developer API available for config, should it go into a new Developers section of the Jupyter AI docs? |
* config manager initial draft * implement basic client for new config manager * implement JL4 unit testing (do not backport) * implement chat settings save * implement client API key deletion * greatly improve error banner handling in settings * implement API key edit and delete in settings UI * ensure API keys are not empty * reduce top and side padding in settings UI * pre-commit * fix integer field type error from rebase * fix api key edit/delete react bugs * improve UI error formatting * implement last_read check on settings form * fix local model ID not showing * remove outdated comment * ensure no empty field dictionaries in config * fix minor typo
* config manager initial draft * implement basic client for new config manager * implement JL4 unit testing (do not backport) * implement chat settings save * implement client API key deletion * greatly improve error banner handling in settings * implement API key edit and delete in settings UI * ensure API keys are not empty * reduce top and side padding in settings UI * pre-commit * fix integer field type error from rebase * fix api key edit/delete react bugs * improve UI error formatting * implement last_read check on settings form * fix local model ID not showing * remove outdated comment * ensure no empty field dictionaries in config * fix minor typo
Description
This is a significant refactor of how Jupyter AI handles user configuration. Our previous approach was implemented mainly in the interest of time. This new config implementation should be significantly more robust, with fewer edge-cases. In addition, the developer APIs should also be much more readable.
Demo
Screen.Recording.2023-09-04.at.5.57.16.PM.mov
Backend changes
ConfigManager
class (CM) has been completely rewritten from scratch.mtime
info to cache disk reads of the config file.ConfigManager.update_config()
is used to create and update user config, including API keys. In addition, this method now accepts a partial object, rather than requiring a full copy of the user config from the client.ConfigManager.delete_api_key(key_name: str)
is a new method used to delete API keys. There is now a corresponding REST API exposing this method.ConfigManager
is now traitlets-configurable, with 3 traits:config_path
: path to the user's config fileschema_path
: path to the user's schema file, i.e. the JSON schema that is used to validate the config file. If this does not exist, CM will automatically copy our default schema to this path.indentation_depth
: how many spaces to use to format the config file. Defaults to 4.Frontend changes
components/mui-extras
) to add some quality-of-life to the Settings form.Follow-up issues