relay-vertex.go 330 B

12345678910111213141516
  1. package vertex
  2. import "one-api/common"
  3. func GetModelRegion(other string, localModelName string) string {
  4. // if other is json string
  5. if common.IsJsonStr(other) {
  6. m := common.StrToMap(other)
  7. if m[localModelName] != nil {
  8. return m[localModelName].(string)
  9. } else {
  10. return m["default"].(string)
  11. }
  12. }
  13. return other
  14. }