Spaces:
Running on Zero
Running on Zero
Remove categories param from search route
Browse files
app.py
CHANGED
|
@@ -349,11 +349,11 @@ def _patched_create_app(blocks, **kwargs):
|
|
| 349 |
return JSONResponse({**API_SPECS, "runtime": _get_runtime_specs()})
|
| 350 |
|
| 351 |
@fa_app.get("/respite/search")
|
| 352 |
-
def _search(q: str = "",
|
| 353 |
if not q:
|
| 354 |
return JSONResponse({"error": "Missing query parameter 'q'"}, status_code=400)
|
| 355 |
try:
|
| 356 |
-
results = _search_web(q,
|
| 357 |
return JSONResponse(results)
|
| 358 |
except Exception as e:
|
| 359 |
return JSONResponse({"error": str(e)}, status_code=502)
|
|
|
|
| 349 |
return JSONResponse({**API_SPECS, "runtime": _get_runtime_specs()})
|
| 350 |
|
| 351 |
@fa_app.get("/respite/search")
|
| 352 |
+
def _search(q: str = "", max_results: int = 10):
|
| 353 |
if not q:
|
| 354 |
return JSONResponse({"error": "Missing query parameter 'q'"}, status_code=400)
|
| 355 |
try:
|
| 356 |
+
results = _search_web(q, max_results=max_results)
|
| 357 |
return JSONResponse(results)
|
| 358 |
except Exception as e:
|
| 359 |
return JSONResponse({"error": str(e)}, status_code=502)
|