feat: 支持vertex ai渠道多个部署地区

This commit is contained in:
CalciumIon
2024-08-28 18:43:40 +08:00
parent c41820541d
commit e60f200192
6 changed files with 75 additions and 17 deletions

View File

@@ -0,0 +1,16 @@
package vertex
import "one-api/common"
func GetModelRegion(other string, localModelName string) string {
// if other is json string
if common.IsJsonStr(other) {
m := common.StrToMap(other)
if m[localModelName] != nil {
return m[localModelName].(string)
} else {
return m["default"].(string)
}
}
return other
}