- Replace all encoding/json direct calls with common.Marshal/Unmarshal/DecodeJson per Rule 1 - Fix Dify nil pointer dereference on remote image upload (relay-dify.go) - Fix Claude relay file content type detection for text/* and PDF (relay-claude.go) - Fix unsafe type assertions in Claude relay and Vertex GetModelRegion - Fix StreamScanner unconditionally resetting pre-existing StreamStatus - Add inferMimeTypeFromFilename() for proper MIME type handling in DTO - Fix Mac build script hardcoded DMG version (now reads from tauri.conf.json) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
22 lines
462 B
Go
22 lines
462 B
Go
package vertex
|
|
|
|
import "github.com/heicode/manager/common"
|
|
|
|
func GetModelRegion(other string, localModelName string) string {
|
|
// if other is json string
|
|
if common.IsJsonObject(other) {
|
|
m, err := common.StrToMap(other)
|
|
if err != nil {
|
|
return other // return original if parsing fails
|
|
}
|
|
if val, ok := m[localModelName].(string); ok {
|
|
return val
|
|
}
|
|
if val, ok := m["default"].(string); ok {
|
|
return val
|
|
}
|
|
return "global"
|
|
}
|
|
return other
|
|
}
|