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

feat(onboarding): add suggested questions answer #1390

Merged
merged 6 commits into from
Oct 12, 2023
Merged

Conversation

mamadoudicko
Copy link
Contributor

@mamadoudicko mamadoudicko commented Oct 11, 2023

Screen.Recording.2023-10-11.at.17.50.15.mp4

#1389

@mamadoudicko mamadoudicko temporarily deployed to preview October 11, 2023 13:47 — with GitHub Actions Inactive
@dosubot dosubot bot added the area: frontend Related to frontend functionality or under the /frontend directory label Oct 11, 2023
@vercel
Copy link

vercel bot commented Oct 11, 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 Oct 11, 2023 4:14pm
quivr-strapi ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 11, 2023 4:14pm
quivrapp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 11, 2023 4:14pm

@github-actions
Copy link
Contributor

github-actions bot commented Oct 11, 2023

Risk Level 2 - /home/runner/work/quivr/quivr/backend/models/databases/supabase/chats.py

The changes in this file involve the addition of a new method add_question_and_answer to the Chats class. This method inserts a new record into the chat_history table. However, there is a potential issue with error handling. If the insert operation fails for any reason, the method will return None without any indication of what went wrong. Consider raising an exception or returning an error message in case of failure. For example:

if len(response) == 0:
    raise Exception('Failed to add question and answer')

This will make it easier to debug issues in the future.


Risk Level 2 - /home/runner/work/quivr/quivr/backend/repository/chat/add_question_and_answer.py

This file introduces a new function add_question_and_answer that calls the method of the same name on a supabase_db object. The function is straightforward and doesn't introduce any apparent bugs or performance issues. However, similar to the previous file, there is a lack of error handling. If the add_question_and_answer method on the supabase_db object fails, the function will return None without any indication of what went wrong. Consider adding error handling as suggested in the previous feedback.


Risk Level 3 - /home/runner/work/quivr/quivr/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/OnboardingQuestions/components/OnboardingQuestion/hooks/useOnboardingQuestion.ts

  1. The useOnboardingQuestion hook has a lot of side effects and state changes. Consider breaking it down into smaller, more manageable hooks.
  2. The addQuestionAndAnswerToChat function is defined inside a hook and it's async but it's not being awaited when called inside useEffect. This could lead to unexpected behavior.
  3. The handleSuggestionClick function is async but it's not being awaited when called. This could lead to unexpected behavior.

Example code snippet for point 2:

useEffect(() => {
    if (!isDone) {
      return;
    }
    (async () => {
      await addQuestionAndAnswerToChat();
    })();
}, [isDone]);

🐛🔧⚠️


Powered by Code Review GPT

Copy link
Contributor

@gozineb gozineb left a comment

Choose a reason for hiding this comment

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

Nice, just need to change the logic to create a chat when clicking on one of the messages

@mamadoudicko mamadoudicko merged commit ea227df into main Oct 12, 2023
11 of 12 checks passed
gozineb pushed a commit that referenced this pull request Oct 12, 2023
🤖 I have created a release *beep* *boop*
---


## 0.0.91 (2023-10-12)

## What's Changed
* feat: track onboarding events by @mamadoudicko in
#1388
* fix(user identity): User identity dict has no attribute user_id and
open_api_key by @HamzaKhalidDhillon in
#1351
* feat: new homepage header by @matthieujacq in
#1382
* feat(onboarding): add suggested questions answer by @mamadoudicko in
#1390

## New Contributors
* @HamzaKhalidDhillon made their first contribution in
#1351

**Full Changelog**:
v0.0.90...v0.0.91

---
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.91 (2023-10-12)

## What's Changed
* feat: track onboarding events by @mamadoudicko in
QuivrHQ/quivr#1388
* fix(user identity): User identity dict has no attribute user_id and
open_api_key by @HamzaKhalidDhillon in
QuivrHQ/quivr#1351
* feat: new homepage header by @matthieujacq in
QuivrHQ/quivr#1382
* feat(onboarding): add suggested questions answer by @mamadoudicko in
QuivrHQ/quivr#1390

## New Contributors
* @HamzaKhalidDhillon made their first contribution in
QuivrHQ/quivr#1351

**Full Changelog**:
QuivrHQ/quivr@v0.0.90...v0.0.91

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


## 0.0.91 (2023-10-12)

## What's Changed
* feat: track onboarding events by @mamadoudicko in
QuivrHQ/quivr#1388
* fix(user identity): User identity dict has no attribute user_id and
open_api_key by @HamzaKhalidDhillon in
QuivrHQ/quivr#1351
* feat: new homepage header by @matthieujacq in
QuivrHQ/quivr#1382
* feat(onboarding): add suggested questions answer by @mamadoudicko in
QuivrHQ/quivr#1390

## New Contributors
* @HamzaKhalidDhillon made their first contribution in
QuivrHQ/quivr#1351

**Full Changelog**:
QuivrHQ/quivr@v0.0.90...v0.0.91

---
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.

None yet

2 participants