fix(adaptor): correct VertexKeyType condition in SetupRequestHeader
This commit is contained in:
@@ -160,7 +160,6 @@ func (a *Adaptor) GetRequestURL(info *relaycommon.RelayInfo) (string, error) {
|
|||||||
if strings.HasPrefix(info.UpstreamModelName, "imagen") {
|
if strings.HasPrefix(info.UpstreamModelName, "imagen") {
|
||||||
suffix = "predict"
|
suffix = "predict"
|
||||||
}
|
}
|
||||||
|
|
||||||
return a.getRequestUrl(info, info.UpstreamModelName, suffix)
|
return a.getRequestUrl(info, info.UpstreamModelName, suffix)
|
||||||
} else if a.RequestMode == RequestModeClaude {
|
} else if a.RequestMode == RequestModeClaude {
|
||||||
if info.IsStream {
|
if info.IsStream {
|
||||||
@@ -181,7 +180,7 @@ func (a *Adaptor) GetRequestURL(info *relaycommon.RelayInfo) (string, error) {
|
|||||||
|
|
||||||
func (a *Adaptor) SetupRequestHeader(c *gin.Context, req *http.Header, info *relaycommon.RelayInfo) error {
|
func (a *Adaptor) SetupRequestHeader(c *gin.Context, req *http.Header, info *relaycommon.RelayInfo) error {
|
||||||
channel.SetupApiRequestHeader(info, c, req)
|
channel.SetupApiRequestHeader(info, c, req)
|
||||||
if info.ChannelOtherSettings.VertexKeyType == "json" {
|
if info.ChannelOtherSettings.VertexKeyType != dto.VertexKeyTypeAPIKey {
|
||||||
accessToken, err := getAccessToken(a, info)
|
accessToken, err := getAccessToken(a, info)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
Reference in New Issue
Block a user