Skip to content

Commit

Permalink
fix: [Go] fixed Google AI API key from env var logic (#475)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelgj authored Jun 25, 2024
1 parent 6e38446 commit f72d762
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion go/plugins/googleai/googleai.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down

0 comments on commit f72d762

Please sign in to comment.