balloonmann commited on
Commit
d2e4b6d
·
1 Parent(s): 6ce6a79

fix: add root endpoint so base URL returns welcome JSON instead of 404

Browse files
Files changed (2) hide show
  1. financial_audit_env/server/app.py +31 -0
  2. server/app.py +31 -0
financial_audit_env/server/app.py CHANGED
@@ -151,6 +151,37 @@ class LeaderboardEntry(BaseModel):
151
  # Standard endpoints
152
  # ---------------------------------------------------------------------------
153
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  @app.get("/health")
155
  async def health_check():
156
  """Health check endpoint — required for HF Space deployment."""
 
151
  # Standard endpoints
152
  # ---------------------------------------------------------------------------
153
 
154
+ @app.get("/")
155
+ async def root():
156
+ """Root endpoint — welcome page with API docs link."""
157
+ return {
158
+ "name": "Financial Audit Environment",
159
+ "version": "2.0.0",
160
+ "description": (
161
+ "An OpenEnv-compatible RL environment for financial auditing tasks. "
162
+ "Agents audit synthetic financial documents to find planted errors."
163
+ ),
164
+ "tasks": ["expense_audit", "invoice_match", "gst_reconciliation", "fraud_detection"],
165
+ "endpoints": {
166
+ "docs": "/docs",
167
+ "health": "/health",
168
+ "tasks": "/tasks",
169
+ "reset": "POST /reset",
170
+ "step": "POST /step",
171
+ "grader": "/grader",
172
+ "leaderboard": "/leaderboard",
173
+ "metrics": "/metrics",
174
+ },
175
+ "quickstart": (
176
+ "1. POST /reset with {\"task_id\": \"expense_audit\", \"seed\": 42}\n"
177
+ "2. Read the documents in the observation\n"
178
+ "3. POST /step with your findings\n"
179
+ "4. GET /grader to see your score"
180
+ ),
181
+ "github": "https://github.com/balloonmann/financial-audit-env",
182
+ }
183
+
184
+
185
  @app.get("/health")
186
  async def health_check():
187
  """Health check endpoint — required for HF Space deployment."""
server/app.py CHANGED
@@ -151,6 +151,37 @@ class LeaderboardEntry(BaseModel):
151
  # Standard endpoints
152
  # ---------------------------------------------------------------------------
153
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  @app.get("/health")
155
  async def health_check():
156
  """Health check endpoint — required for HF Space deployment."""
 
151
  # Standard endpoints
152
  # ---------------------------------------------------------------------------
153
 
154
+ @app.get("/")
155
+ async def root():
156
+ """Root endpoint — welcome page with API docs link."""
157
+ return {
158
+ "name": "Financial Audit Environment",
159
+ "version": "2.0.0",
160
+ "description": (
161
+ "An OpenEnv-compatible RL environment for financial auditing tasks. "
162
+ "Agents audit synthetic financial documents to find planted errors."
163
+ ),
164
+ "tasks": ["expense_audit", "invoice_match", "gst_reconciliation", "fraud_detection"],
165
+ "endpoints": {
166
+ "docs": "/docs",
167
+ "health": "/health",
168
+ "tasks": "/tasks",
169
+ "reset": "POST /reset",
170
+ "step": "POST /step",
171
+ "grader": "/grader",
172
+ "leaderboard": "/leaderboard",
173
+ "metrics": "/metrics",
174
+ },
175
+ "quickstart": (
176
+ "1. POST /reset with {\"task_id\": \"expense_audit\", \"seed\": 42}\n"
177
+ "2. Read the documents in the observation\n"
178
+ "3. POST /step with your findings\n"
179
+ "4. GET /grader to see your score"
180
+ ),
181
+ "github": "https://github.com/balloonmann/financial-audit-env",
182
+ }
183
+
184
+
185
  @app.get("/health")
186
  async def health_check():
187
  """Health check endpoint — required for HF Space deployment."""