From 09a85bc93953a322c743f357c6b0c05a582bc8ae Mon Sep 17 00:00:00 2001 From: zaanposni Date: Mon, 22 Jan 2024 20:33:13 +0100 Subject: [PATCH] . --- src/dataimport/informationopenaianalyze.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/dataimport/informationopenaianalyze.py b/src/dataimport/informationopenaianalyze.py index f04faad..4aa3cfc 100644 --- a/src/dataimport/informationopenaianalyze.py +++ b/src/dataimport/informationopenaianalyze.py @@ -5,14 +5,16 @@ from uuid import uuid4 from datetime import datetime, timedelta -from dotenv import load_dotenv from rich.console import Console from databases import Database from openai import OpenAI from dateutil.parser import parse -load_dotenv() +if not os.getenv("OPENAI_API_KEY"): + print("OPENAI_API_KEY not set", style="bold red") + exit(1) + console = Console() client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))