Skip to content

Commit 895221a

Browse files
committed
Bringing it back to working with UV
1 parent 98b9683 commit 895221a

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

server/pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ dependencies = [
5959
"Werkzeug==3.0.6",
6060
"wheel==0.38.1",
6161
"data-gemma",
62+
"datacommons",
63+
"datacommons_client",
6264
]
6365

6466
[tool.uv]

server/routes/factcheck/api.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,11 @@ async def verify_claim():
9292
return jsonify({"error": "Missing 'claim' in request body."}), 400
9393

9494
# Get API Key from header
95+
# Get API Key from header or environment
9596
api_key = request.headers.get('X-Gemini-Api-Key')
97+
if not api_key:
98+
api_key = os.environ.get('GENAI_API_KEY') or os.environ.get('GOOGLE_API_KEY')
99+
96100
if not api_key:
97101
return jsonify({"error": "Missing API Key"}), 401
98102

@@ -134,7 +138,11 @@ async def extract_claims():
134138
return jsonify({"error": "Missing 'text' in request body."}), 400
135139

136140
# Get API Key from header
141+
# Get API Key from header or environment
137142
api_key = request.headers.get('X-Gemini-Api-Key')
143+
if not api_key:
144+
api_key = os.environ.get('GENAI_API_KEY') or os.environ.get('GOOGLE_API_KEY')
145+
138146
if not api_key:
139147
return jsonify({"error": "Missing API Key"}), 401
140148

0 commit comments

Comments
 (0)