Skip to content

Commit

Permalink
fix: Open AI API key was not being picked up from settings but from t…
Browse files Browse the repository at this point in the history
…he environment only.
  • Loading branch information
anirbanbasu committed Jun 5, 2024
1 parent aa8f5b9 commit 0263ada
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion utils/state_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,11 +341,14 @@ def update_llm_settings(callback_data: Any = None):
global_settings__llm_provider_notice.value = "Cohere is being used as the language model provider. Ensure that you have set the Cohere API key correctly from the Settings page."
case constants.LLM_PROVIDER_OPENAI:
Settings.llm = OpenAI(
api_key=global_settings__openai_api_key.value,
model=global_settings__openai_model.value,
temperature=global_settings__llm_temperature.value,
system_prompt=global_settings__llm_system_message.value,
)
Settings.embed_model = OpenAIEmbedding()
Settings.embed_model = OpenAIEmbedding(
api_key=global_settings__openai_api_key.value,
)
global_settings__llm_provider_notice.value = "Open AI is being used as the language model provider. Ensure that you have set the Open AI API key correctly from the Settings page."
case constants.LLM_PROVIDER_LLAMAFILE:
Settings.llm = Llamafile(
Expand Down

0 comments on commit 0263ada

Please sign in to comment.