Spaces:
Running
Running
Hermes Agent commited on
Commit ·
cbfbbf8
1
Parent(s): ee3eab6
fix(gateway): add api_key to custom_providers and register /api/v1 router endpoints
Browse files- gateway/omniroute.py +6 -0
- hermes_config.yaml +1 -0
gateway/omniroute.py
CHANGED
|
@@ -158,6 +158,12 @@ async def omniroute_v1_api(request: Request, path: str = ""):
|
|
| 158 |
target = f"http://127.0.0.1:{OMNIROUTE_PORT}/v1/{path}" if path else f"http://127.0.0.1:{OMNIROUTE_PORT}/v1"
|
| 159 |
return await handle_omniroute_proxy(target, request, default_prefix="/omniroute")
|
| 160 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 161 |
@router.api_route("/v1beta", methods=["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"])
|
| 162 |
@router.api_route("/v1beta/{path:path}", methods=["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"])
|
| 163 |
async def omniroute_v1beta_api(request: Request, path: str = ""):
|
|
|
|
| 158 |
target = f"http://127.0.0.1:{OMNIROUTE_PORT}/v1/{path}" if path else f"http://127.0.0.1:{OMNIROUTE_PORT}/v1"
|
| 159 |
return await handle_omniroute_proxy(target, request, default_prefix="/omniroute")
|
| 160 |
|
| 161 |
+
@router.api_route("/api/v1", methods=["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"])
|
| 162 |
+
@router.api_route("/api/v1/{path:path}", methods=["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"])
|
| 163 |
+
async def omniroute_api_v1_api(request: Request, path: str = ""):
|
| 164 |
+
target = f"http://127.0.0.1:{OMNIROUTE_PORT}/api/v1/{path}" if path else f"http://127.0.0.1:{OMNIROUTE_PORT}/api/v1"
|
| 165 |
+
return await handle_omniroute_proxy(target, request, default_prefix="/omniroute")
|
| 166 |
+
|
| 167 |
@router.api_route("/v1beta", methods=["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"])
|
| 168 |
@router.api_route("/v1beta/{path:path}", methods=["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"])
|
| 169 |
async def omniroute_v1beta_api(request: Request, path: str = ""):
|
hermes_config.yaml
CHANGED
|
@@ -135,3 +135,4 @@ platform_toolsets:
|
|
| 135 |
custom_providers:
|
| 136 |
- name: OmniRoute Gateway
|
| 137 |
base_url: http://127.0.0.1:20128/api/v1
|
|
|
|
|
|
| 135 |
custom_providers:
|
| 136 |
- name: OmniRoute Gateway
|
| 137 |
base_url: http://127.0.0.1:20128/api/v1
|
| 138 |
+
api_key: admin123
|