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

fix: allow to change model bro brain settings tab #1590

Merged
merged 1 commit into from
Nov 6, 2023

Conversation

mamadoudicko
Copy link
Contributor

@mamadoudicko mamadoudicko commented Nov 6, 2023

Issue: #1550
Probably fix [Bug]: Cant select any other models except gpt3.5-turbo#1294

Screen.Recording.2023-11-06.at.11.44.06.mov

@dosubot dosubot bot added the area: frontend Related to frontend functionality or under the /frontend directory label Nov 6, 2023
Copy link

vercel bot commented Nov 6, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2023 10:46am
quivr-strapi ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2023 10:46am
quivrapp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2023 10:46am

Copy link
Contributor

github-actions bot commented Nov 6, 2023

Risk Level 2 - /home/runner/work/quivr/quivr/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/SettingsTab/components/ModelSelection/ModelSelection.tsx

The code seems to be well written and follows good practices. However, there is a potential issue with the onChange event handler in the register function for the model field. The handleSubmit function is called with false as an argument, which might not be the expected behavior in all cases. Make sure that this is the intended behavior and that it won't cause any unexpected side effects.

register(\"model\", {
  onChange: () => {
    void handleSubmit(false);
  },
})

Risk Level 3 - /home/runner/work/quivr/quivr/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/SettingsTab/hooks/useSettingsTab.ts

  1. The updateFormValues function has a setTimeout with a delay of 50ms. This might cause race conditions if the brain object changes within that time frame. Consider using a different approach to ensure that the model value is set correctly.
setTimeout(() => {
  if (brain.model !== undefined && brain.model !== null) {
    setValue(\"model\", brain.model);
  }
}, 50);
  1. The handleSubmit function has a lot of responsibilities. It checks for changes, validates the brain name and OpenAI key, updates the brain, and handles errors. Consider breaking it down into smaller functions to improve readability and maintainability.

  2. The error handling in the handleSubmit function and setAsDefaultBrainHandler function could be improved. Currently, it just logs the error to the console. Consider providing a more user-friendly error message or handling specific error cases differently.


📝🐞⏱️


Powered by Code Review GPT

@mamadoudicko mamadoudicko merged commit 3eff384 into main Nov 6, 2023
11 checks passed
mamadoudicko pushed a commit that referenced this pull request Nov 7, 2023
🤖 I have created a release *beep* *boop*
---


## 0.0.107 (2023-11-06)

## What's Changed
* fix: allow to change model bro brain settings tab by @mamadoudicko in
#1590
* fix: fix notification banner display when too much items in chat list
by @mamadoudicko in #1593
* docs: add auth modes config by @mamadoudicko in
#1595
* fix: allow users to delete brains by @mamadoudicko in
#1596
* feat: 🎸 source documents by @StanGirard in
#1598


**Full Changelog**:
v0.0.106...v0.0.107

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
coolCatalyst added a commit to coolCatalyst/quivr that referenced this pull request Jun 1, 2024
🤖 I have created a release *beep* *boop*
---


## 0.0.107 (2023-11-06)

## What's Changed
* fix: allow to change model bro brain settings tab by @mamadoudicko in
QuivrHQ/quivr#1590
* fix: fix notification banner display when too much items in chat list
by @mamadoudicko in QuivrHQ/quivr#1593
* docs: add auth modes config by @mamadoudicko in
QuivrHQ/quivr#1595
* fix: allow users to delete brains by @mamadoudicko in
QuivrHQ/quivr#1596
* feat: 🎸 source documents by @StanGirard in
QuivrHQ/quivr#1598


**Full Changelog**:
QuivrHQ/quivr@v0.0.106...v0.0.107

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: frontend Related to frontend functionality or under the /frontend directory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Cant select any other models except gpt3.5-turbo
2 participants