Skip to content

Commit

Permalink
settings: set openai_api_key default to None
Browse files Browse the repository at this point in the history
It's more Pythonic than using a string "undefined".
  • Loading branch information
stintel committed Jan 17, 2024
1 parent 116c518 commit 09f6f54
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/internal/wac.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def init_wac(app):


# OpenAI
if settings.openai_api_key != "undefined":
if settings.openai_api_key is not None:
log.info(f"Initializing OpenAI Client")
import openai
openai_client = openai.OpenAI(
Expand Down
2 changes: 1 addition & 1 deletion app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class Settings(BaseSettings):
command_not_found: str = "Sorry, I can't find that command"
openai_api_key: str = "undefined"
openai_api_key: str = None
openai_base_url: str = "https://api.endpoints.anyscale.com/v1"
openai_model: str = "meta-llama/Llama-2-70b-chat-hf"
openai_system_prompt: str = "Keep your answers as short as possible."
Expand Down

0 comments on commit 09f6f54

Please sign in to comment.