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: 🎸 sources #1591

Merged
merged 1 commit into from
Nov 6, 2023
Merged

feat: 🎸 sources #1591

merged 1 commit into from
Nov 6, 2023

Conversation

StanGirard
Copy link
Collaborator

added sources in front and backend

image

added sources in front and backend
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 11:08am
quivr-strapi ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2023 11:08am
quivrapp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2023 11:08am

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

github-actions bot commented Nov 6, 2023

Risk Level 2 - /home/runner/work/quivr/quivr/frontend/app/chat/[chatId]/components/ChatDialogueArea/components/ChatDialogue/components/QADisplay/components/MessageRow/components/SourcesButton.tsx

The code is generally well-written and follows good practices. However, there are a few areas that could be improved for better performance and readability.

  1. Use of index as key in map function: Using the index as a key in the map function is not recommended as it can lead to unexpected behavior if the items in the list are re-ordered, added, or removed. It would be better to use a unique identifier for each source if one is available.
{sources.split(', ').map((source, index) => (
  <li key={source} className=\"truncate\">{source.trim()}</li>
))}
  1. Use of inline styles: Inline styles are generally discouraged as they can make the code harder to read and maintain. It would be better to use CSS classes and define the styles in a separate CSS file.
<div className=\"absolute z-50 min-w-max p-2 bg-white shadow-lg rounded-md border border-gray-200 position-popup\">

In the CSS file:

.position-popup {
  top: `${popupPosition.top}px`;
  left: `${popupPosition.left}px`;
}

Remember to update the state and the CSS file whenever the popupPosition changes.


Risk Level 3 - /home/runner/work/quivr/quivr/backend/llm/qa_base.py

  1. The openai_api_key and user_openai_api_key are being used in plain text which is a security risk. Consider using environment variables or a secure method to store these keys.

  2. The else statement in the _determine_api_key function is not necessary. If the if condition is not met, the function will automatically return the openai_api_key. This can improve readability.

  3. The try/except blocks in the generate_stream function are catching all exceptions. It's generally a good practice to catch specific exceptions to avoid hiding bugs.

  4. The generate_stream function is quite long and complex. Consider breaking it down into smaller, more manageable functions.

Example code:

    def _determine_api_key(self, openai_api_key, user_openai_api_key):
        \"\"\"If user provided an API key, use it.\"\"\"
        if user_openai_api_key is not None:
            return user_openai_api_key
        return openai_api_key

🔑🎨🔍


Powered by Code Review GPT

@StanGirard StanGirard merged commit 192610d into main Nov 6, 2023
StanGirard added a commit that referenced this pull request Nov 6, 2023
🤖 I have created a release *beep* *boop*
---


## 0.0.106 (2023-11-06)

## What's Changed
* feat: 🎸 sources by @StanGirard in
#1591


**Full Changelog**:
v0.0.105...v0.0.106

---
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.106 (2023-11-06)

## What's Changed
* feat: 🎸 sources by @StanGirard in
QuivrHQ/quivr#1591


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

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

1 participant