mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-12-18 10:37:11 +00:00
Fix undefined variable exception during openai provider setup on init
Resolves #1001
This commit is contained in:
parent
e43341fdcc
commit
33a5efaf4b
1 changed files with 4 additions and 2 deletions
|
@ -56,8 +56,10 @@ def initialization(interactive: bool = True):
|
|||
valid_default_models = [model for model in default_openai_chat_models if model in default_chat_models]
|
||||
other_available_models = [model for model in default_chat_models if model not in valid_default_models]
|
||||
default_chat_models = valid_default_models + other_available_models
|
||||
except Exception:
|
||||
logger.warning(f"⚠️ Failed to fetch {provider} chat models. Fallback to default models. Error: {e}")
|
||||
except Exception as e:
|
||||
logger.warning(
|
||||
f"⚠️ Failed to fetch {provider} chat models. Fallback to default models. Error: {str(e)}"
|
||||
)
|
||||
|
||||
# Set up OpenAI's online chat models
|
||||
openai_configured, openai_provider = _setup_chat_model_provider(
|
||||
|
|
Loading…
Reference in a new issue