From b5c01efb780b122dc4cf2f25bb2bd279c6058259 Mon Sep 17 00:00:00 2001 From: Stan Girard Date: Fri, 6 Oct 2023 20:32:23 +0200 Subject: [PATCH] fix(question): fixed with user_settings (#1349) # 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. - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my code - [ ] I have commented hard-to-understand areas - [ ] I have ideally added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged ## Screenshots (if appropriate): --- backend/routes/chat_routes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/routes/chat_routes.py b/backend/routes/chat_routes.py index 7430422ec7d6..4f2970a5a960 100644 --- a/backend/routes/chat_routes.py +++ b/backend/routes/chat_routes.py @@ -209,7 +209,7 @@ async def create_question_handler( openai_api_key=current_user.openai_api_key, ) userSettings = userDailyUsage.get_user_settings() - is_model_ok = (brain_details or chat_question).model in userSettings.models # type: ignore + is_model_ok = (brain_details or chat_question).model in userSettings.get("models", ["gpt-3.5-turbo"]) # type: ignore if not current_user.openai_api_key and brain_id: brain_details = get_brain_details(brain_id)