Просмотр исходного кода

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

JustSong 2 лет назад
Родитель
Сommit
cc3072c4df
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      controller/relay.go

+ 3 - 0
controller/relay.go

@@ -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)