mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-14 20:23:46 +08:00
🎨 结构中继控制器
This commit is contained in:
@@ -19,17 +19,18 @@ func SetRelayRouter(router *gin.Engine) {
|
||||
relayV1Router := router.Group("/v1")
|
||||
relayV1Router.Use(middleware.TokenAuth(), middleware.Distribute())
|
||||
{
|
||||
relayV1Router.POST("/completions", controller.Relay)
|
||||
relayV1Router.POST("/chat/completions", controller.Relay)
|
||||
relayV1Router.POST("/edits", controller.Relay)
|
||||
relayV1Router.POST("/images/generations", controller.Relay)
|
||||
relayV1Router.POST("/images/edits", controller.Relay)
|
||||
relayV1Router.POST("/images/variations", controller.Relay)
|
||||
relayV1Router.POST("/embeddings", controller.Relay)
|
||||
relayV1Router.POST("/engines/:model/embeddings", controller.Relay)
|
||||
relayV1Router.POST("/audio/transcriptions", controller.Relay)
|
||||
relayV1Router.POST("/audio/translations", controller.Relay)
|
||||
relayV1Router.POST("/audio/speech", controller.Relay)
|
||||
relayV1Router.POST("/completions", controller.RelayCompletions)
|
||||
relayV1Router.POST("/chat/completions", controller.RelayChat)
|
||||
// relayV1Router.POST("/edits", controller.Relay)
|
||||
relayV1Router.POST("/images/generations", controller.RelayImageGenerations)
|
||||
relayV1Router.POST("/images/edits", controller.RelayImageEdits)
|
||||
relayV1Router.POST("/images/variations", controller.RelayImageVariations)
|
||||
relayV1Router.POST("/embeddings", controller.RelayEmbeddings)
|
||||
// relayV1Router.POST("/engines/:model/embeddings", controller.RelayEmbeddings)
|
||||
relayV1Router.POST("/audio/transcriptions", controller.RelayTranscriptions)
|
||||
relayV1Router.POST("/audio/translations", controller.RelayTranslations)
|
||||
relayV1Router.POST("/audio/speech", controller.RelaySpeech)
|
||||
relayV1Router.POST("/moderations", controller.RelayModerations)
|
||||
relayV1Router.GET("/files", controller.RelayNotImplemented)
|
||||
relayV1Router.POST("/files", controller.RelayNotImplemented)
|
||||
relayV1Router.DELETE("/files/:id", controller.RelayNotImplemented)
|
||||
@@ -41,6 +42,5 @@ func SetRelayRouter(router *gin.Engine) {
|
||||
relayV1Router.POST("/fine-tunes/:id/cancel", controller.RelayNotImplemented)
|
||||
relayV1Router.GET("/fine-tunes/:id/events", controller.RelayNotImplemented)
|
||||
relayV1Router.DELETE("/models/:model", controller.RelayNotImplemented)
|
||||
relayV1Router.POST("/moderations", controller.Relay)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user