feat(vertex): add --vertex-import-prefix flag for model namespacing

This commit is contained in:
dinhkarate
2026-01-29 13:29:55 +07:00
parent fdeef48498
commit 14cb2b95c6
2 changed files with 5 additions and 2 deletions

View File

@@ -65,6 +65,7 @@ func main() {
var antigravityLogin bool
var projectID string
var vertexImport string
var vertexImportPrefix string
var configPath string
var password string
@@ -81,6 +82,7 @@ func main() {
flag.StringVar(&projectID, "project_id", "", "Project ID (Gemini only, not required)")
flag.StringVar(&configPath, "config", DefaultConfigPath, "Configure File Path")
flag.StringVar(&vertexImport, "vertex-import", "", "Import Vertex service account key JSON file")
flag.StringVar(&vertexImportPrefix, "vertex-import-prefix", "", "Prefix for Vertex model namespacing (use with -vertex-import)")
flag.StringVar(&password, "password", "", "")
flag.CommandLine.Usage = func() {
@@ -449,7 +451,7 @@ func main() {
if vertexImport != "" {
// Handle Vertex service account import
cmd.DoVertexImport(cfg, vertexImport)
cmd.DoVertexImport(cfg, vertexImport, vertexImportPrefix)
} else if login {
// Handle Google/Gemini login
cmd.DoLogin(cfg, projectID, options)

View File

@@ -20,7 +20,7 @@ import (
// DoVertexImport imports a Google Cloud service account key JSON and persists
// it as a "vertex" provider credential. The file content is embedded in the auth
// file to allow portable deployment across stores.
func DoVertexImport(cfg *config.Config, keyPath string) {
func DoVertexImport(cfg *config.Config, keyPath string, prefix string) {
if cfg == nil {
cfg = &config.Config{}
}
@@ -69,6 +69,7 @@ func DoVertexImport(cfg *config.Config, keyPath string) {
ProjectID: projectID,
Email: email,
Location: location,
Prefix: strings.TrimSpace(prefix),
}
metadata := map[string]any{
"service_account": sa,