malek-messaoudii
commited on
Commit
·
e411044
1
Parent(s):
91b1985
Update gemini_client.py
Browse files
services/gemini_client.py
CHANGED
|
@@ -1,9 +1,8 @@
|
|
| 1 |
-
from google.genai import Client
|
| 2 |
import os
|
| 3 |
|
| 4 |
-
def get_gemini_client()
|
| 5 |
-
""
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
return Client()
|
|
|
|
| 1 |
+
from google.genai import Client
|
| 2 |
import os
|
| 3 |
|
| 4 |
+
def get_gemini_client():
|
| 5 |
+
api_key = os.getenv("GOOGLE_GENAI_API_KEY") # store it in .env
|
| 6 |
+
if not api_key:
|
| 7 |
+
raise ValueError("Missing GOOGLE_GENAI_API_KEY environment variable")
|
| 8 |
+
return Client(api_key=api_key)
|
|
|