🌐
GitHub
github.com › googleapis › go-genai
GitHub - googleapis/go-genai: Google Gen AI Go SDK provides an interface for developers to integrate Google's generative models into their Go applications. · GitHub
May 22, 2026 - parts := []*genai.Part{ {Text: ... []*genai.Content{{Parts: parts}}, nil) Add the SDK to your module with go get google.golang.org/genai....
Starred by 1.1K users
Forked by 152 users
Languages   Go
🌐
Go Packages
pkg.go.dev › google.golang.org › genai
genai package - google.golang.org/genai - Go Packages
3 weeks ago - parts := []*genai.Part{ {Text: ...eContent(ctx, "gemini-2.5-flash", []*genai.Content{{Parts: parts}}, nil) Add the SDK to your module with go get google.golang.org/genai....
🌐
GitHub
github.com › google › generative-ai-go
GitHub - google/generative-ai-go: Go SDK for Google Generative AI · GitHub
Go SDK for Google Generative AI. Contribute to google/generative-ai-go development by creating an account on GitHub.
Starred by 856 users
Forked by 101 users
Languages   Go 98.7% | Shell 1.3%
🌐
Google AI
ai.google.dev › gemini api › gemini api libraries
Gemini API libraries | Google AI for Developers
April 28, 2026 - Download and get started with the Gemini API Libraries + SDKs
🌐
Go Packages
pkg.go.dev › github.com › google › generative-ai-go › genai
genai package - github.com/google/generative-ai-go/genai - Go Packages
May 2, 2025 - package main import ( "context" "fmt" "log" "os" "path/filepath" "github.com/google/generative-ai-go/genai" "github.com/google/generative-ai-go/genai/internal/testhelpers" "google.golang.org/api/option" ) var testDataDir = filepath.Join(testhelpers.ModuleRootDir(), "genai", "testdata") func main() { ctx := context.Background() client, err := genai.NewClient(ctx, option.WithAPIKey(os.Getenv("GEMINI_API_KEY"))) if err != nil { log.Fatal(err) } defer client.Close() file, err := client.UploadFileFromPath(ctx, filepath.Join(testDataDir, "a11.txt"), nil) if err != nil { log.Fatal(err) } defer client
🌐
Google AI
ai.google.dev › gemini api › migrate to the google genai sdk
Migrate to the Google GenAI SDK | Gemini API | Google AI for Developers
April 28, 2026 - npm install @google/genai · go get google.golang.org/genai · The old SDK implicitly handled the API client behind the scenes using a variety of ad hoc methods. This made it hard to manage the client and credentials.
🌐
Google
docs.cloud.google.com › gemini enterprise agent platform › google gen ai sdk
Google Gen AI SDK | Gemini Enterprise Agent Platform | Google Cloud Documentation
go-genai on GitHub · go get google.golang.org/genai · Set environment variables to use the Gen AI SDK with Vertex AI: # Replace the `GOOGLE_CLOUD_PROJECT` and `GOOGLE_CLOUD_LOCATION` values # with appropriate values for your project. export ...
🌐
Go Packages
pkg.go.dev › cloud.google.com › go › vertexai › genai
genai package - cloud.google.com/go/vertexai/genai - Go Packages
April 9, 2026 - New users are encouraged to use the Google GenAI Go SDK available at google.golang.org/genai
🌐
Go Packages
pkg.go.dev › cloud.google.com › go › vertexai
vertexai package - cloud.google.com/go/vertexai - Go Packages
April 9, 2026 - New users are encouraged to use the Google GenAI Go SDK available at google.golang.org/genai.
Find elsewhere
🌐
GitHub
github.com › google › generative-ai-go › blob › main › genai › example_test.go
generative-ai-go/genai/example_test.go at main · google/generative-ai-go
Go SDK for Google Generative AI. Contribute to google/generative-ai-go development by creating an account on GitHub.
Author   google
🌐
Go Packages
pkg.go.dev › github.com › zzxwill › generative-ai-go › genai
genai package - github.com/zzxwill/generative-ai-go/genai - Go Packages
package main import ( "context" "fmt" "log" "os" "github.com/google/generative-ai-go/genai" "google.golang.org/api/option" ) func main() { ctx := context.Background() client, err := genai.NewClient(ctx, option.WithAPIKey(os.Getenv("GEMINI_API_KEY"))) if err != nil { log.Fatal(err) } defer client.Close() model := client.GenerativeModel("gemini-1.0-pro") cs := model.StartChat() cs.History = []*genai.Content{ &genai.Content{ Parts: []genai.Part{ genai.Text("Hello, I have 2 dogs in my house."), }, Role: "user", }, &genai.Content{ Parts: []genai.Part{ genai.Text("Great to meet you.
🌐
Go Packages
pkg.go.dev › google.golang.org › genai › tokenizer
tokenizer package - google.golang.org/genai/tokenizer - Go Packages
Package tokenizer provides local token counting for Gemini models. This tokenizer downloads its model from the web, but otherwise doesn't require an API call for every [CountTokens] invocation. ... func (tok *LocalTokenizer) ComputeTokens(contents []*genai.Content) (*genai.ComputeTokensResult, error)
🌐
GitHub
github.com › google › generative-ai-go › releases
Releases · google/generative-ai-go
Go SDK for Google Generative AI. Contribute to google/generative-ai-go development by creating an account on GitHub.
Author   google
🌐
Google
docs.cloud.google.com › gemini enterprise agent platform › google gen ai libraries
Google Gen AI libraries | Gemini Enterprise Agent Platform | Google Cloud Documentation
1 week ago - pip install google-genai · Install our Go library by running: go get google.golang.org/genai · Install our JavaScript/TypeScript library by running: npm install @google/genai · The new JavaScript and TypeScript library is available in preview, ...
🌐
GitHub
github.com › googleapis › google-cloud-go › blob › main › vertexai › genai › client.go
google-cloud-go/vertexai/genai/client.go at main · googleapis/google-cloud-go
// go install golang.org/x/exp/protoveneer/cmd/protoveneer@latest · · //go:generate protoveneer -license license.txt config.yaml ../../aiplatform/apiv1beta1/aiplatformpb · · package genai · · import ( "context" "fmt" "io" "log" "os" "strings" · aiplatform "cloud.google.com/go/aiplatform/apiv1beta1" pb "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb" "cloud.google.com/go/vertexai/internal" "google.golang.org/api/iterator" "google.golang.org/api/option" "google.golang.org/genai" ) ·
Author   googleapis
🌐
Go Packages
pkg.go.dev › github.com › google › generative-ai-go
generative-ai-go module - github.com/google/generative-ai-go - Go Packages
May 2, 2025 - Please be advised that this repository is now considered legacy. For the latest features, performance improvements, and active development, we strongly recommend migrating to the official Google Generative AI SDK for Go.