Merge branch 'features/multi-user-support-khoj' of github.com:khoj-ai/khoj into features/multi-user-support-khoj

This commit is contained in:
sabaimran 2023-11-02 14:56:01 -07:00
commit fe860aaf83

View file

@ -102,9 +102,18 @@ def migrate_server_pg(args):
model_type=ChatModelOptions.ModelType.OFFLINE, model_type=ChatModelOptions.ModelType.OFFLINE,
) )
if "openai" in raw_config["processor"]["conversation"]: if (
"openai" in raw_config["processor"]["conversation"]
and raw_config["processor"]["conversation"]["openai"]
):
openai = raw_config["processor"]["conversation"]["openai"] openai = raw_config["processor"]["conversation"]["openai"]
if openai.get("api-key") is None:
logger.error("OpenAI API Key is not set. Will not be migrating OpenAI config.")
else:
if openai.get("chat-model") is None:
openai["chat-model"] = "gpt-3.5-turbo"
OpenAIProcessorConversationConfig.objects.create( OpenAIProcessorConversationConfig.objects.create(
api_key=openai.get("api-key"), api_key=openai.get("api-key"),
) )