Relay done but not working

This commit is contained in:
JustSong
2023-04-23 18:24:11 +08:00
parent 9fc375c604
commit 852af57c03
12 changed files with 225 additions and 70 deletions

15
router/relay-router.go Normal file
View File

@@ -0,0 +1,15 @@
package router
import (
"github.com/gin-gonic/gin"
"one-api/controller"
"one-api/middleware"
)
func SetRelayRouter(router *gin.Engine) {
relayRouter := router.Group("/v1")
relayRouter.Use(middleware.GlobalAPIRateLimit(), middleware.TokenAuth(), middleware.Distribute())
{
relayRouter.POST("/chat/completions", controller.Relay)
}
}