Commit 6add81d4 by IcedTangerine Committed by GitHub

Merge pull request #1111 from feitianbubu/fxm-ali-fetch-models-url

fix: ali FetchUpstreamModels url
parents 7c34c010 bee6c661
...@@ -119,8 +119,11 @@ func FetchUpstreamModels(c *gin.Context) { ...@@ -119,8 +119,11 @@ func FetchUpstreamModels(c *gin.Context) {
baseURL = channel.GetBaseURL() baseURL = channel.GetBaseURL()
} }
url := fmt.Sprintf("%s/v1/models", baseURL) 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) 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)) body, err := GetResponseBody("GET", url, channel, GetAuthHeader(channel.Key))
if err != nil { if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment