From 96ab4177ca671506432b0dca9331280e078d0f18 Mon Sep 17 00:00:00 2001 From: skynono <6811626@qq.com> Date: Mon, 26 May 2025 17:22:13 +0800 Subject: [PATCH] fix: ali FetchUpstreamModels url --- controller/channel.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/controller/channel.go b/controller/channel.go index ad85fe24..a31e1f47 100644 --- a/controller/channel.go +++ b/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 {