-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
refactor(backend): cleaning dead and unused code #1432
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Risk Level 2 - /home/runner/work/quivr/quivr/backend/routes/brain_routes.py The code changes are generally good, improving readability by adding docstrings to the functions. However, there are a few potential issues:
Risk Level 2 - /home/runner/work/quivr/quivr/backend/routes/chat_routes.py
def get_openai_api_key(current_user, brain_id):
# Retrieve user's OpenAI API key
current_user.openai_api_key = request.headers.get(\"Openai-Api-Key\")
if not current_user.openai_api_key and brain_id:
brain_details = get_brain_details(brain_id)
if brain_details:
current_user.openai_api_key = brain_details.openai_api_key
if not current_user.openai_api_key:
user_identity = get_user_identity(current_user.id)
if user_identity is not None:
current_user.openai_api_key = user_identity.openai_api_key
return current_user.openai_api_key
def get_chat_model(chat_question, brain):
# Retrieve chat model (temperature, max_tokens, model)
if not chat_question.model or not chat_question.temperature or not chat_question.max_tokens:
chat_question.model = chat_question.model or brain.model or \"gpt-3.5-turbo\"
chat_question.temperature = chat_question.temperature or brain.temperature or 0.1
chat_question.max_tokens = chat_question.max_tokens or brain.max_tokens or 256
return chat_question
import logging
logger = logging.getLogger(__name__)
# Replace print statements with logger.info or logger.debug
logger.info(\"streaming\")
def delete_chat_from_db(supabase_db: SupabaseDB, chat_id):
try:
supabase_db.delete_chat_history(chat_id)
except Exception as e:
logger.error(e)
try:
supabase_db.delete_chat(chat_id)
except Exception as e:
logger.error(e) Risk Level 3 - /home/runner/work/quivr/quivr/backend/llm/qa_base.py The 🔒🐌🔍 Powered by Code Review GPT |
🤖 I have created a release *beep* *boop* --- ## 0.0.94 (2023-10-19) ## What's Changed * feat: Homepage demo section by @matthieujacq in #1420 * feat: add security section by @mamadoudicko in #1423 * feat: HomePage new footer by @matthieujacq in #1425 * feat: add testimonials section by @mamadoudicko in #1427 * refactor(backend): cleaning dead and unused code by @StanGirard in #1432 **Full Changelog**: v0.0.93...v0.0.94 --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release *beep* *boop* --- ## 0.0.94 (2023-10-19) ## What's Changed * feat: Homepage demo section by @matthieujacq in QuivrHQ/quivr#1420 * feat: add security section by @mamadoudicko in QuivrHQ/quivr#1423 * feat: HomePage new footer by @matthieujacq in QuivrHQ/quivr#1425 * feat: add testimonials section by @mamadoudicko in QuivrHQ/quivr#1427 * refactor(backend): cleaning dead and unused code by @StanGirard in QuivrHQ/quivr#1432 **Full Changelog**: QuivrHQ/quivr@v0.0.93...v0.0.94 --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release *beep* *boop* --- ## 0.0.94 (2023-10-19) ## What's Changed * feat: Homepage demo section by @matthieujacq in QuivrHQ/quivr#1420 * feat: add security section by @mamadoudicko in QuivrHQ/quivr#1423 * feat: HomePage new footer by @matthieujacq in QuivrHQ/quivr#1425 * feat: add testimonials section by @mamadoudicko in QuivrHQ/quivr#1427 * refactor(backend): cleaning dead and unused code by @StanGirard in QuivrHQ/quivr#1432 **Full Changelog**: QuivrHQ/quivr@v0.0.93...v0.0.94 --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Checklist before requesting a review
Please delete options that are not relevant.
Screenshots (if appropriate):