Spaces:
Paused
Paused
Download src/proxy/routes.ts from mangelaav/oai-proxy-develop: direct link, hf CLI and curl.
- Browser
- Download file 622 Bytes
-
https://huggingface.co/spaces/mangelaav/oai-proxy-develop/resolve/main/src/proxy/routes.ts
- Command line
-
hf download hf://spaces/mangelaav/oai-proxy-develop/src/proxy/routes.ts
-
curl -L -o routes.ts https://huggingface.co/spaces/mangelaav/oai-proxy-develop/resolve/main/src/proxy/routes.ts
622 Bytes
| /* Accepts incoming requests at either the /kobold or /openai routes and then | |
| routes them to the appropriate handler to be forwarded to the OpenAI API. | |
| Incoming OpenAI requests are more or less 1:1 with the OpenAI API, but only a | |
| subset of the API is supported. Kobold requests must be transformed into | |
| equivalent OpenAI requests. */ | |
| import * as express from "express"; | |
| import { auth } from "./auth"; | |
| import { kobold } from "./kobold"; | |
| import { openai } from "./openai"; | |
| const router = express.Router(); | |
| router.use(auth); | |
| router.use("/kobold", kobold); | |
| router.use("/openai", openai); | |
| export { router as proxyRouter }; | |