Skip to content

Commit

Permalink
Fix undefined variable exception during openai provider setup on init
Browse files Browse the repository at this point in the history
Resolves #1001
  • Loading branch information
debanjum committed Dec 11, 2024
1 parent e43341f commit 33a5efa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/khoj/utils/initialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ def _create_chat_configuration():
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(
Expand Down

0 comments on commit 33a5efa

Please sign in to comment.