From 1a58daafbe6693a577496a017124b28644509776 Mon Sep 17 00:00:00 2001 From: Pavel Jbanov Date: Tue, 25 Jun 2024 10:25:44 -0400 Subject: [PATCH] fix: [Go] fixed Google AI API key from env var logic --- go/plugins/googleai/googleai.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/plugins/googleai/googleai.go b/go/plugins/googleai/googleai.go index a07bbea6ba..6c637c2323 100644 --- a/go/plugins/googleai/googleai.go +++ b/go/plugins/googleai/googleai.go @@ -72,7 +72,7 @@ func Init(ctx context.Context, apiKey string) (err error) { }() if apiKey == "" { - apiKey := os.Getenv("GOOGLE_GENAI_API_KEY") + apiKey = os.Getenv("GOOGLE_GENAI_API_KEY") if apiKey == "" { return fmt.Errorf("googleai.Init: Google AI requires setting GOOGLE_GENAI_API_KEY in the environment. You can get an API key at https://ai.google.dev") }