25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 

23 satır
483 B

  1. package vertex
  2. import "github.com/QuantumNous/new-api/common"
  3. func GetModelRegion(other string, localModelName string) string {
  4. // if other is json string
  5. if common.IsJsonObject(other) {
  6. m, err := common.StrToMap(other)
  7. if err != nil {
  8. return other // return original if parsing fails
  9. }
  10. if m[localModelName] != nil {
  11. return m[localModelName].(string)
  12. } else {
  13. if v, ok := m["default"]; ok {
  14. return v.(string)
  15. }
  16. return "global"
  17. }
  18. }
  19. return other
  20. }