feat(vertex): add --vertex-import-prefix flag for model namespacing
This commit is contained in:
+3
-1
@@ -65,6 +65,7 @@ func main() {
|
|||||||
var antigravityLogin bool
|
var antigravityLogin bool
|
||||||
var projectID string
|
var projectID string
|
||||||
var vertexImport string
|
var vertexImport string
|
||||||
|
var vertexImportPrefix string
|
||||||
var configPath string
|
var configPath string
|
||||||
var password string
|
var password string
|
||||||
|
|
||||||
@@ -81,6 +82,7 @@ func main() {
|
|||||||
flag.StringVar(&projectID, "project_id", "", "Project ID (Gemini only, not required)")
|
flag.StringVar(&projectID, "project_id", "", "Project ID (Gemini only, not required)")
|
||||||
flag.StringVar(&configPath, "config", DefaultConfigPath, "Configure File Path")
|
flag.StringVar(&configPath, "config", DefaultConfigPath, "Configure File Path")
|
||||||
flag.StringVar(&vertexImport, "vertex-import", "", "Import Vertex service account key JSON file")
|
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.StringVar(&password, "password", "", "")
|
||||||
|
|
||||||
flag.CommandLine.Usage = func() {
|
flag.CommandLine.Usage = func() {
|
||||||
@@ -449,7 +451,7 @@ func main() {
|
|||||||
|
|
||||||
if vertexImport != "" {
|
if vertexImport != "" {
|
||||||
// Handle Vertex service account import
|
// Handle Vertex service account import
|
||||||
cmd.DoVertexImport(cfg, vertexImport)
|
cmd.DoVertexImport(cfg, vertexImport, vertexImportPrefix)
|
||||||
} else if login {
|
} else if login {
|
||||||
// Handle Google/Gemini login
|
// Handle Google/Gemini login
|
||||||
cmd.DoLogin(cfg, projectID, options)
|
cmd.DoLogin(cfg, projectID, options)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import (
|
|||||||
// DoVertexImport imports a Google Cloud service account key JSON and persists
|
// 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
|
// it as a "vertex" provider credential. The file content is embedded in the auth
|
||||||
// file to allow portable deployment across stores.
|
// 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 {
|
if cfg == nil {
|
||||||
cfg = &config.Config{}
|
cfg = &config.Config{}
|
||||||
}
|
}
|
||||||
@@ -69,6 +69,7 @@ func DoVertexImport(cfg *config.Config, keyPath string) {
|
|||||||
ProjectID: projectID,
|
ProjectID: projectID,
|
||||||
Email: email,
|
Email: email,
|
||||||
Location: location,
|
Location: location,
|
||||||
|
Prefix: strings.TrimSpace(prefix),
|
||||||
}
|
}
|
||||||
metadata := map[string]any{
|
metadata := map[string]any{
|
||||||
"service_account": sa,
|
"service_account": sa,
|
||||||
|
|||||||
Reference in New Issue
Block a user