Owadokun Tosin Tobi commited on
Commit
8b3ff2e
·
unverified ·
1 Parent(s): 90c670b

Create client.py

Browse files
Files changed (1) hide show
  1. utils/client.py +15 -0
utils/client.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import nest_asyncio
3
+ from dotenv import load_dotenv
4
+
5
+ # Fix for nested event loops (Crucial for PydanticAI in some envs)
6
+ nest_asyncio.apply()
7
+
8
+ # Load Env
9
+ load_dotenv()
10
+
11
+ def get_api_key():
12
+ key = os.getenv("GEMINI_API_KEY")
13
+ if not key:
14
+ raise ValueError("❌ Missing GEMINI_API_KEY. Add it to .env or Secrets.")
15
+ return key