Leon4gr45 commited on
Commit
68d42a7
·
verified ·
1 Parent(s): 9c061e7

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. test_endpoints.py +0 -3
  2. vrag/api.py +0 -4
  3. web/next.config.mjs +32 -0
test_endpoints.py CHANGED
@@ -17,8 +17,5 @@ check_endpoint(f"{base_url}/api/health")
17
  check_endpoint(f"{base_url}/api-docs")
18
  check_endpoint(f"{base_url}/api/stats")
19
  check_endpoint(f"{base_url}/api/videos")
20
- check_endpoint(f"{base_url}/api/search?q=test&view=text&dim=768&k=1")
21
- check_endpoint(f"{base_url}/api/compare?q=test&view=text&k=1")
22
- check_endpoint(f"{base_url}/api/compare-views?q=test&dim=768&k=1")
23
  check_endpoint(f"{base_url}/api/answers")
24
 
 
17
  check_endpoint(f"{base_url}/api-docs")
18
  check_endpoint(f"{base_url}/api/stats")
19
  check_endpoint(f"{base_url}/api/videos")
 
 
 
20
  check_endpoint(f"{base_url}/api/answers")
21
 
vrag/api.py CHANGED
@@ -255,9 +255,5 @@ async def safe_request_validation(request: Request, exc: RequestValidationError)
255
  'msg':'Invalid request field', 'type':error.get('type','invalid')}
256
  for error in exc.errors()[:16]]
257
  return JSONResponse(status_code=422, content={'detail':errors})
258
- @app.get('/api-docs')
259
- def api_docs():
260
- from fastapi.responses import RedirectResponse
261
- return RedirectResponse(url='/docs')
262
  from .api_docs import configure_api_docs
263
  configure_api_docs(app)
 
255
  'msg':'Invalid request field', 'type':error.get('type','invalid')}
256
  for error in exc.errors()[:16]]
257
  return JSONResponse(status_code=422, content={'detail':errors})
 
 
 
 
258
  from .api_docs import configure_api_docs
259
  configure_api_docs(app)
web/next.config.mjs ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /** @type {import('next').NextConfig} */
2
+ const nextConfig = {
3
+ output: 'standalone',
4
+ eslint: {
5
+ ignoreDuringBuilds: true,
6
+ },
7
+ async rewrites() {
8
+ return [
9
+ {
10
+ source: '/api/:path*',
11
+ destination: 'http://127.0.0.1:8000/api/:path*',
12
+ },
13
+ {
14
+ source: '/api-docs',
15
+ destination: 'http://127.0.0.1:8000/api-docs',
16
+ },
17
+ {
18
+ source: '/docs',
19
+ destination: 'http://127.0.0.1:8000/docs',
20
+ },
21
+ {
22
+ source: '/openapi.json',
23
+ destination: 'http://127.0.0.1:8000/openapi.json',
24
+ },
25
+ {
26
+ source: '/media/:path*',
27
+ destination: 'http://127.0.0.1:8000/media/:path*',
28
+ },
29
+ ];
30
+ },
31
+ };
32
+ export default nextConfig;