We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2325476 commit f114c1eCopy full SHA for f114c1e
2 files changed
.github/workflows/ci.yml
@@ -25,6 +25,8 @@ jobs:
25
pip install pytest httpx
26
27
- name: Run Backend Tests
28
+ env:
29
+ GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
30
run: |
31
cd backend
32
pytest tests/ --disable-warnings
backend/services/gemini_service.py
@@ -10,7 +10,12 @@
10
11
class GeminiService:
12
def __init__(self):
13
- self.client = genai.Client(api_key=os.getenv("GEMINI_API_KEY"))
+ api_key = os.getenv("GEMINI_API_KEY")
14
+ if not api_key:
15
+ print("WARNING: GEMINI_API_KEY not found in environment. AI services will be unavailable.")
16
+ self.client = None
17
+ else:
18
+ self.client = genai.Client(api_key=api_key)
19
self.model_name = "gemini-2.0-flash"
20
21
async def generate_text(self, prompt: str) -> str:
0 commit comments