refactor: refactor config part

This commit is contained in:
JustSong
2024-01-21 23:18:32 +08:00
parent b373882814
commit 42569c83c0
53 changed files with 745 additions and 708 deletions

View File

@@ -9,6 +9,7 @@ import (
"io"
"net/http"
"one-api/common"
"one-api/common/helper"
"one-api/relay/channel/aiproxy"
"one-api/relay/channel/ali"
"one-api/relay/channel/anthropic"
@@ -66,7 +67,7 @@ func GetRequestURL(requestURL string, apiType int, relayMode int, meta *util.Rel
case constant.APITypePaLM:
fullRequestURL = fmt.Sprintf("%s/v1beta2/models/chat-bison-001:generateMessage", meta.BaseURL)
case constant.APITypeGemini:
version := common.AssignOrDefault(meta.APIVersion, "v1")
version := helper.AssignOrDefault(meta.APIVersion, "v1")
action := "generateContent"
if textRequest.Stream {
action = "streamGenerateContent"