Calcifer0323 commited on
Commit
7c31226
·
1 Parent(s): deafd1f

add: root endpoint / for HuggingFace Space homepage

Browse files
Files changed (1) hide show
  1. main.py +34 -0
main.py CHANGED
@@ -297,6 +297,40 @@ class WeightedMatchResponse(BaseModel):
297
 
298
  # --- Endpoints ---
299
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
300
  @app.get("/health", response_model=HealthResponse)
301
  async def health_check():
302
  """Проверка здоровья сервиса."""
 
297
 
298
  # --- Endpoints ---
299
 
300
+ @app.get("/")
301
+ async def root():
302
+ """
303
+ Корневая страница API.
304
+
305
+ Показывает информацию о сервисе и ссылки на документацию.
306
+ """
307
+ return {
308
+ "service": "Matching Embedding Service",
309
+ "version": "1.0.0",
310
+ "status": "running",
311
+ "model": MODEL_NAME,
312
+ "docs": "/docs",
313
+ "redoc": "/redoc",
314
+ "health": "/health",
315
+ "endpoints": {
316
+ "embedding": {
317
+ "single": "POST /embed",
318
+ "batch": "POST /embed-batch"
319
+ },
320
+ "matching": {
321
+ "by_text": "POST /match-text",
322
+ "by_vector": "POST /match",
323
+ "weighted": "POST /match-weighted"
324
+ },
325
+ "management": {
326
+ "register": "POST /register",
327
+ "bulk_index": "POST /index/bulk",
328
+ "stats": "GET /store/stats"
329
+ }
330
+ }
331
+ }
332
+
333
+
334
  @app.get("/health", response_model=HealthResponse)
335
  async def health_check():
336
  """Проверка здоровья сервиса."""