PRIYANSHUDHAKED commited on
Commit
a3a7320
·
verified ·
1 Parent(s): e8d9cf6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -18,7 +18,11 @@ app = FastAPI()
18
  logging.basicConfig(level=logging.INFO, format='%(asctime)s %(levelname)s: %(message)s')
19
 
20
  load_dotenv()
21
- genai.configure(api_key=os.getenv("AIzaSyD0GxR2J1JxGic807Cc89Jq6MB4aDJYgDc"))
 
 
 
 
22
 
23
  def get_pdf_text(pdf_docs):
24
  text = ""
 
18
  logging.basicConfig(level=logging.INFO, format='%(asctime)s %(levelname)s: %(message)s')
19
 
20
  load_dotenv()
21
+ # Configure genai with the API key
22
+ api_key = os.getenv("AIzaSyD0GxR2J1JxGic807Cc89Jq6MB4aDJYgDc")
23
+ if not api_key:
24
+ raise EnvironmentError("Google API Key not found in environment variables.")
25
+ genai.configure(api_key=api_key)
26
 
27
  def get_pdf_text(pdf_docs):
28
  text = ""