feat: add Proxy channel type and relay mode (#1678)

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-22 22:51:19 +08:00
committed by GitHub
parent 296ab013b8
commit c936198ac8
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)