https://github.com/fredsa/hello-gemini-api.git
Sample app showing how to access Gemini using the Gemini API.
go version
gcloud CLI, see https://cloud.google.com/sdk/docs/install.git clone git@github.com:fredsa/hello-gemini-api.git
cd hello-gemini-api
github.com/google/generative-ai-go/genai
package.
go get github.com/google/generative-ai-go/genai
main.go to use this API key.const apiKey = "your-api-key" // Keep safe.
go run main.go
The output should look something like this
>> Hello, who are you?
I am a large language model, trained by Google.