From 5abaed9d08dc8a26ff4f07dd9c8c2353482a874c Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Mon, 1 Jan 2024 22:33:01 +0530 Subject: [PATCH] Use user chosen OpenAI model to extract DB search questions from query Previously Khoj was selecting the first OpenAI model configured on server and not the OpenAI model configured by the user for themselves --- src/khoj/routers/api.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/khoj/routers/api.py b/src/khoj/routers/api.py index 7b4ed311..9ba2559c 100644 --- a/src/khoj/routers/api.py +++ b/src/khoj/routers/api.py @@ -865,9 +865,8 @@ async def extract_references_and_questions( ) elif conversation_config and conversation_config.model_type == ChatModelOptions.ModelType.OPENAI: openai_chat_config = await ConversationAdapters.get_openai_chat_config() - openai_chat = await ConversationAdapters.get_openai_chat() api_key = openai_chat_config.api_key - chat_model = openai_chat.chat_model + chat_model = conversation_config.chat_model inferred_queries = extract_questions( defiltered_query, model=chat_model, api_key=api_key, conversation_log=meta_log )