Skip to content

Commit

Permalink
chore: wrap openai client initialization
Browse files Browse the repository at this point in the history
Signed-off-by: Francesco Fuggitti <francesco.fuggitti@gmail.com>
  • Loading branch information
francescofuggitti committed Feb 15, 2024
1 parent d404007 commit ae0c243
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nl2ltl/engines/gpt/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
from nl2ltl.engines.gpt.output import GPTOutput, parse_gpt_output, parse_gpt_result
from nl2ltl.filters.base import Filter

client = OpenAI()
try:
client = OpenAI()
except Exception:
client = None

engine_root = ENGINE_ROOT
DATA_DIR = engine_root / "data"
PROMPT_PATH = engine_root / DATA_DIR / "prompt.json"
Expand Down

0 comments on commit ae0c243

Please sign in to comment.