From d867dca310d7b9424057c6f5949f81d680ce96c8 Mon Sep 17 00:00:00 2001 From: Debanjum Date: Sat, 17 May 2025 02:29:29 -0700 Subject: [PATCH] Fix send_message_to_model_wrapper by using sync is_user_subscribed check Calling an async function from a sync function wouldn't work. --- src/khoj/routers/helpers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/khoj/routers/helpers.py b/src/khoj/routers/helpers.py index 1b2831bd..a290c85b 100644 --- a/src/khoj/routers/helpers.py +++ b/src/khoj/routers/helpers.py @@ -50,6 +50,7 @@ from khoj.database.adapters import ( get_user_name, get_user_notion_config, get_user_subscription_state, + is_user_subscribed, run_with_process_lock, ) from khoj.database.models import ( @@ -1264,7 +1265,7 @@ def send_message_to_model_wrapper_sync( if chat_model is None: raise HTTPException(status_code=500, detail="Contact the server administrator to set a default chat model.") - subscribed = ais_user_subscribed(user) if user else False + subscribed = is_user_subscribed(user) if user else False max_tokens = ( chat_model.subscribed_max_prompt_size if subscribed and chat_model.subscribed_max_prompt_size