mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-09-14 08:13:37 +00:00
fix: 修复 Gemini 风格 /v1/models 列表请求 (#6199)
* fix: support Gemini model listing on v1 route * test: cover Gemini query key model listing
This commit is contained in:
@@ -25,7 +25,7 @@ func SetRelayRouter(router *gin.Engine) {
|
||||
case c.GetHeader("x-api-key") != "" && c.GetHeader("anthropic-version") != "":
|
||||
controller.ListModels(c, constant.ChannelTypeAnthropic)
|
||||
case c.GetHeader("x-goog-api-key") != "" || c.Query("key") != "": // 单独的适配
|
||||
controller.RetrieveModel(c, constant.ChannelTypeGemini)
|
||||
controller.ListModels(c, constant.ChannelTypeGemini)
|
||||
default:
|
||||
controller.ListModels(c, constant.ChannelTypeOpenAI)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user