diff --git a/controller/relay.go b/controller/relay.go index 863267b4..504ee8ca 100644 --- a/controller/relay.go +++ b/controller/relay.go @@ -201,9 +201,9 @@ func Relay(c *gin.Context) { relayMode = RelayModeEdits } else if strings.HasPrefix(c.Request.URL.Path, "/v1/audio/speech") { relayMode = RelayModeAudioSpeech - } else if strings.HasPrefix(c.Request.URL.Path, "/v1/audio/transcription") { + } else if strings.HasPrefix(c.Request.URL.Path, "/v1/audio/transcriptions") { relayMode = RelayModeAudioTranscription - } else if strings.HasPrefix(c.Request.URL.Path, "/v1/audio/translation") { + } else if strings.HasPrefix(c.Request.URL.Path, "/v1/audio/translations") { relayMode = RelayModeAudioTranslation } var err *OpenAIErrorWithStatusCode diff --git a/middleware/distributor.go b/middleware/distributor.go index c4ddc3a0..7106e839 100644 --- a/middleware/distributor.go +++ b/middleware/distributor.go @@ -40,7 +40,10 @@ func Distribute() func(c *gin.Context) { } else { // Select a channel for the user var modelRequest ModelRequest - err := common.UnmarshalBodyReusable(c, &modelRequest) + var err error + if !strings.HasPrefix(c.Request.URL.Path, "/v1/audio/transcriptions") && !strings.HasPrefix(c.Request.URL.Path, "/v1/audio/translations") { + err = common.UnmarshalBodyReusable(c, &modelRequest) + } if err != nil { abortWithMessage(c, http.StatusBadRequest, "无效的请求") return