Skip to content

Commit

Permalink
typing
Browse files Browse the repository at this point in the history
  • Loading branch information
MadcowD committed Aug 7, 2024
1 parent 630d5f8 commit 9843ea0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ell/models/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ def register_openai_models(client: openai.Client):
]
for model_id, owned_by in model_data:
config.register_model(model_id, client)


default_client = None
try:
default_client = openai.Client()
except openai.OpenAIError as e:
# TODO: Provide warning here.
# TODO: Dont set default lcient if this is the case
import os
default_client = openai.Client(api_key=os.environ.get("OPENAI_API_KEY", ""))
register_openai_models(default_client)
Expand Down

0 comments on commit 9843ea0

Please sign in to comment.