mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-10-18 01:16:05 +00:00
fix: add default API version handling and enhance error message checks for Gemini
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"github.com/songquanpeng/one-api/common/helper"
|
"github.com/songquanpeng/one-api/common/helper"
|
||||||
channelhelper "github.com/songquanpeng/one-api/relay/adaptor"
|
channelhelper "github.com/songquanpeng/one-api/relay/adaptor"
|
||||||
"github.com/songquanpeng/one-api/relay/adaptor/openai"
|
"github.com/songquanpeng/one-api/relay/adaptor/openai"
|
||||||
@@ -29,6 +30,8 @@ func (a *Adaptor) GetRequestURL(meta *meta.Meta) (string, error) {
|
|||||||
"gemini-2.0-flash-thinking-exp",
|
"gemini-2.0-flash-thinking-exp",
|
||||||
"gemini-2.0-flash-thinking-exp-01-21":
|
"gemini-2.0-flash-thinking-exp-01-21":
|
||||||
defaultVersion = "v1beta"
|
defaultVersion = "v1beta"
|
||||||
|
default:
|
||||||
|
defaultVersion = "v1beta"
|
||||||
}
|
}
|
||||||
|
|
||||||
version := helper.AssignOrDefault(meta.Config.APIVersion, defaultVersion)
|
version := helper.AssignOrDefault(meta.Config.APIVersion, defaultVersion)
|
||||||
|
Reference in New Issue
Block a user