Closed samarth-na closed 10 months ago
client, err := genai.NewClient(ctx, option.WithAPIKey(os.Getenv("AIzaSyB1Nx3jxDqWOflvh---JnyEndKx3kWYwefbvw")))
This line tries to read an env var with the name of your API key, which is probably not what you intended.
If you want to hardcode the key into your code, just pass it to WithAPIKey
(without os.Getenv
)
Or alternatively use the quickstart code exactly, but set an API_KEY
env var with your key as value.
I've copied the code directly from the quicstart-guide for golang
this is identical with the one one shown i guide throws this error
but this runs fine if I try this in python
i don't know why is this happening if there was some prereqvisits is should have been mentioned in the quick-start guide if anyone can give an solution please help