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(prompt): added instructions in standalone question & a bit more things #826

Merged
merged 4 commits into from
Aug 2, 2023

Conversation

StanGirard
Copy link
Collaborator

No description provided.

@vercel
Copy link

vercel bot commented Aug 2, 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 Aug 2, 2023 8:30am
quivrapp 🔄 Building (Inspect) Visit Preview Aug 2, 2023 8:30am

@StanGirard StanGirard merged commit c217979 into main Aug 2, 2023
5 of 7 checks passed
@github-actions
Copy link
Contributor

github-actions bot commented Aug 2, 2023

LOGAF Level 2 - /home/runner/work/quivr/quivr/backend/core/llm/qa_base.py

1. Exposed API Key: The supabase_service_key is exposed in the supabase_client property. It's a security risk to expose API keys in the code. Consider using environment variables to store these keys.

2. Code Readability: The code could be more readable if you group related class attributes together and separate them with a blank line.

3. Code Functionality: The generate_stream method seems to be doing a lot of things. Consider breaking it down into smaller, more manageable methods.

4. Code Performance: The generate_answer method retrieves the chat history from the database every time it's called. If the chat history is large, this could lead to performance issues. Consider caching the chat history if possible.


LOGAF Level 2 - /home/runner/work/quivr/quivr/backend/core/llm/base.py

1. Exposed API Key: The openai_api_key and user_openai_api_key are exposed in the class BaseBrainPicking. It's a security risk to expose API keys in the code. Consider using environment variables to store these keys.

2. Code Readability: The code could be more readable if you group related class attributes together and separate them with a blank line.

3. Code Functionality: The method _determine_streaming doesn't seem to do anything other than return the streaming parameter. If the method is not doing any additional processing, it might be unnecessary.

4. Code Performance: The method _determine_callback_array creates a new AsyncIteratorCallbackHandler every time it's called. If this method is called frequently, it could lead to performance issues. Consider reusing the AsyncIteratorCallbackHandler if possible.


LOGAF Level 2 - /home/runner/work/quivr/quivr/backend/core/models/databases/supabase/brains.py

1. Code Duplication: There is a lot of code duplication in the methods get_brain_for_user, get_brain_details, and get_brain_by_id. You can create a helper method to reduce this duplication. For example:

    def _get_brain(self, brain_id, user_id=None):
        query = (
            self.db.from_("brains")
            .select("id:brain_id, name, *")
            .filter("brain_id", "eq", brain_id)
        )
        if user_id:
            query = query.filter("user_id", "eq", user_id)
        response = query.execute()
        return response

Then you can use this helper method in get_brain_for_user, get_brain_details, and get_brain_by_id.

2. Error Handling: There is no error handling in the code. It's important to handle potential errors that might occur during database operations. For example, you can use try-except blocks to catch and handle exceptions.

3. Code Readability: The code could be more readable with some comments explaining what each method does. Although some methods have docstrings, not all of them do. Adding docstrings to all methods would improve the code's readability and maintainability.


🔑📚🚀


Powered by Code Review GPT

StanGirard added a commit that referenced this pull request Sep 12, 2023
…things (#826)

* fix(backend): temperature signature

* feat(qa): fixed temperature question generator and added doc

* feat(prompt): added instructions to standalone question

* fix(brains-rights): fixed function missing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants