From b5c01efb780b122dc4cf2f25bb2bd279c6058259 Mon Sep 17 00:00:00 2001 From: Stan Girard Date: Fri, 6 Oct 2023 20:32:23 +0200 Subject: [PATCH 1/2] 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) From d2fcb737b746aae0f116df7f37100b09629f943a Mon Sep 17 00:00:00 2001 From: "Stanislav \"Stan\" Bogdanov" Date: Fri, 6 Oct 2023 13:32:49 -0500 Subject: [PATCH 2/2] FIX tables.sql - missing ; breaks SQL queries. (#1348) # Description A missing ; in the CREATE query for onboarding tables breaks the script execution on Supabase. ## Checklist before requesting a review Please delete options that are not relevant. - [x ] My code follows the style guidelines of this project - [ x] I have performed a self-review of my code - [ x] Any dependent changes have been merged ## Screenshots (if appropriate): --- scripts/tables.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/tables.sql b/scripts/tables.sql index 33225442510e..210a4972dcb6 100644 --- a/scripts/tables.sql +++ b/scripts/tables.sql @@ -264,7 +264,7 @@ CREATE TABLE IF NOT EXISTS onboardings ( onboarding_b2 BOOLEAN NOT NULL DEFAULT true, onboarding_b3 BOOLEAN NOT NULL DEFAULT true, PRIMARY KEY (user_id) -) +); insert into storage.buckets (id, name)