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 config and plugin UI/UX rework #3050

Merged
merged 10 commits into from
May 7, 2023
Merged

Chat config and plugin UI/UX rework #3050

merged 10 commits into from
May 7, 2023

Conversation

notmd
Copy link
Collaborator

@notmd notmd commented May 5, 2023

  • Rework chat cache format, now store the preset name instead the preset config.
  • Rework chat config hydration logic, in order to sync cache correctly I only render 1 ChatConfigForm only to avoid conditional race. Also the ChatConfigForm now have local states, we can't sync the local state if we render 2 form. I think we should apply this to the ChatListBase as well
  • Clean up the PluginChoose UI/UX
  • Now only send enabled plugins to the inference only, so the inference can remove the enabled check.
  • close In the chat interface, switching to "custom" should default-set the parameters of the previously selected preset #2859

@notmd notmd changed the title Chat config rework Chat config annd plugin UI/UX rework May 6, 2023
@notmd notmd changed the title Chat config annd plugin UI/UX rework Chat config and plugin UI/UX rework May 6, 2023
model_config_name: string;
selectedPresetName: string;
custom_preset_config: SamplingParameters;
custom_presets: Array<{ name: string; config: SamplingParameters }>;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be used in the next PR when I implement #3035


const CHAT_CONFIG_KEY = "CHAT_CONFIG";
const CHAT_CONFIG_KEY = "CHAT_CONFIG_V2";
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I bump the cache key here

@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es5",
"target": "ESNext",
Copy link
Collaborator Author

@notmd notmd May 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This allow to use new feature, Next doesn't use tsconfig to compile code, so there is no runtime change

@notmd notmd marked this pull request as ready for review May 6, 2023 20:34
Copy link
Collaborator

@AbdBarho AbdBarho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this big refactor ♥.

Unfortunately, there are so many changes I don't believe I can review and give good feedback, so I will just approve.

Please refrain from doing PRs with 1000 line changes in the future. Probably every item on the list could be done in a different PR.

@AbdBarho AbdBarho mentioned this pull request May 7, 2023
@notmd
Copy link
Collaborator Author

notmd commented May 7, 2023

Ah sorry the big PR, I also plan to separate the plugin UI/UI to a different PR, but the change needs to make it work correctly with the new cache pretty overlap with the UI , so I include it in this PR too. Will try to make the up coming Prs much smaller

@github-actions
Copy link

github-actions bot commented May 7, 2023

pre-commit failed.
Please run pre-commit run --all-files locally and commit the changes.
Find more information in the repository's CONTRIBUTING.md

@notmd notmd enabled auto-merge (squash) May 7, 2023 15:54
@notmd notmd merged commit 220bc11 into main May 7, 2023
@notmd notmd deleted the chat_config_rework branch May 7, 2023 15:57
notmd pushed a commit that referenced this pull request May 7, 2023
Also removed outdated `initialChats` since we fetch everything client
side now.

Desktop:


![image](https://user-images.githubusercontent.com/24505302/236681802-9d41d8bf-c86e-401b-8d75-f871d51b2cf1.png)

Mobile:


![image](https://user-images.githubusercontent.com/24505302/236682359-cb799a3f-1771-494e-a83d-8c961b8547ea.png)


Currently only enabled in development since some features are still
missing.

Blocked by #3050
draganjovanovich added a commit that referenced this pull request May 8, 2023
This PR addresses the following fixes and modifications:
- Some plugin url-s are with text/json content_type so downloading and
parsing fails. This is now fixed with content_type check + using
response.text() + json.loads
- Some plugins openapi specifications don't have operation-id so tool
name becomes "", I now added a fallback to endpoint.path if that is the
case.
- Some plugins do not have the full openapi spec URL specified in their
description, so parsing of it fails. This is now fixed with the
detection of such cases and than merging plugins config url + openapi
spec path.
- If users add a bunch of plugins, there was no height or scrolling
inside of a PluginChooser dropdown, this is fixed now. (will leave this
out as #3050 already solves this)

---------

Co-authored-by: Oliver <olivergestanley@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants