fix: fix vertex provider

This commit is contained in:
Kujtim Hoxha
2025-07-31 13:29:11 +02:00
parent 28b67f95ac
commit d2f7bb7cfe
2 changed files with 7 additions and 8 deletions

View File

@@ -168,8 +168,8 @@ func (c *Config) configureProviders(env env.Env, resolver VariableResolver, know
}
continue
}
prepared.ExtraParams["project"] = env.Get("GOOGLE_CLOUD_PROJECT")
prepared.ExtraParams["location"] = env.Get("GOOGLE_CLOUD_LOCATION")
prepared.ExtraParams["project"] = env.Get("VERTEXAI_PROJECT")
prepared.ExtraParams["location"] = env.Get("VERTEXAI_LOCATION")
case catwalk.InferenceProviderAzure:
endpoint, err := resolver.ResolveValue(p.APIEndpoint)
if err != nil || endpoint == "" {
@@ -470,10 +470,9 @@ func loadFromReaders(readers []io.Reader) (*Config, error) {
}
func hasVertexCredentials(env env.Env) bool {
useVertex := env.Get("GOOGLE_GENAI_USE_VERTEXAI") == "true"
hasProject := env.Get("GOOGLE_CLOUD_PROJECT") != ""
hasLocation := env.Get("GOOGLE_CLOUD_LOCATION") != ""
return useVertex && hasProject && hasLocation
hasProject := env.Get("VERTEXAI_PROJECT") != ""
hasLocation := env.Get("VERTEXAI_LOCATION") != ""
return hasProject && hasLocation
}
func hasAWSCredentials(env env.Env) bool {

View File

@@ -10,8 +10,8 @@ import (
type VertexAIClient ProviderClient
func newVertexAIClient(opts providerClientOptions) VertexAIClient {
project := opts.extraHeaders["project"]
location := opts.extraHeaders["location"]
project := opts.extraParams["project"]
location := opts.extraParams["location"]
client, err := genai.NewClient(context.Background(), &genai.ClientConfig{
Project: project,
Location: location,