Browse Source

fix: ali FetchUpstreamModels url

skynono 7 tháng trước cách đây
mục cha
commit
96ab4177ca
1 tập tin đã thay đổi với 4 bổ sung1 xóa
  1. 4 1
      controller/channel.go

+ 4 - 1
controller/channel.go

@@ -119,8 +119,11 @@ func FetchUpstreamModels(c *gin.Context) {
 		baseURL = channel.GetBaseURL()
 	}
 	url := fmt.Sprintf("%s/v1/models", baseURL)
-	if channel.Type == common.ChannelTypeGemini {
+	switch channel.Type {
+	case common.ChannelTypeGemini:
 		url = fmt.Sprintf("%s/v1beta/openai/models", baseURL)
+	case common.ChannelTypeAli:
+		url = fmt.Sprintf("%s/compatible-mode/v1/models", baseURL)
 	}
 	body, err := GetResponseBody("GET", url, channel, GetAuthHeader(channel.Key))
 	if err != nil {