feat: add Proxy channel type and relay mode

Add the Proxy channel type and relay mode to support proxying requests to custom upstream services.
This commit is contained in:
Laisky.Cai
2024-07-21 03:28:22 +00:00
parent 2a892c1937
commit d4703dfd97
17 changed files with 292 additions and 106 deletions

View File

@@ -19,6 +19,7 @@ func SetRelayRouter(router *gin.Engine) {
relayV1Router := router.Group("/v1")
relayV1Router.Use(middleware.RelayPanicRecover(), middleware.TokenAuth(), middleware.Distribute())
{
relayV1Router.Any("/oneapi/proxy/:channelid/*target", controller.Relay)
relayV1Router.POST("/completions", controller.Relay)
relayV1Router.POST("/chat/completions", controller.Relay)
relayV1Router.POST("/edits", controller.Relay)