fix: remove version suffix for Azure (close #67)

This commit is contained in:
JustSong 2023-05-15 15:48:18 +08:00
parent bffee4e91d
commit cc3072c4df

View File

@ -117,6 +117,9 @@ func relayHelper(c *gin.Context) error {
task := strings.TrimPrefix(requestURL, "/v1/")
model_ := textRequest.Model
model_ = strings.Replace(model_, ".", "", -1)
// https://github.com/songquanpeng/one-api/issues/67
model_ = strings.TrimSuffix(model_, "-0301")
model_ = strings.TrimSuffix(model_, "-0314")
fullRequestURL = fmt.Sprintf("%s/openai/deployments/%s/%s", baseURL, model_, task)
}
req, err := http.NewRequest(c.Request.Method, fullRequestURL, c.Request.Body)