🌐
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: "What's this image about?"}, {InlineData: &genai.Blob{Data: imageBytes, MIMEType: "image/jpeg"}}, } result, err := client.Models.GenerateContent(ctx, "gemini-2.5-flash", []*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 › 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" "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.5-flash") cs := model.StartChat() cs.History = []*genai.Content{ { Parts: []genai.Part{ genai.Text("Hello, I have 2 dogs in my house."), }, Role: "user", }, { Parts: []genai.Part{ genai.Text("Great to meet you.
🌐
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%
🌐
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
"github.com/google/generative-ai-go/genai/internal/testhelpers" "google.golang.org/api/googleapi" "google.golang.org/api/iterator" "google.golang.org/api/option" ) · var testDataDir = filepath.Join(testhelpers.ModuleRootDir(), "genai", ...
Author   google
🌐
Go Packages
pkg.go.dev › google.golang.org › genai
genai package - google.golang.org/genai - Go Packages
3 weeks ago - github.com/googleapis/go-genai · Open Source Insights · The Google Gen AI Go SDK provides an interface for developers to integrate Google's generative models into their Go applications. It supports the Gemini Developer API and Gemini Enterprise Agent Platform APIs.
🌐
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/iterator" "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() send := func(msg string) *genai.GenerateContentResponse { fmt.Printf("== Me: %s\n== Model:\n", msg) res, err := cs.SendMessage(ctx, genai.Text(msg)) if err != nil { log.Fatal(err) } return
🌐
GitHub
github.com › google › generative-ai-go › releases
Releases · google/generative-ai-go
build(deps): bump google.golang.org/grpc from 1.64.0 to 1.64.1 in the go_modules group by @dependabot in #165 · genai: move source of truth of example_test and add code generator by @eliben in #164
Author   google
🌐
GitHub
github.com › kavinaravind › go-genai
GitHub - kavinaravind/go-genai: A simple chatbot that uses the Go SDK for Google Generative AI · GitHub
A simple chatbot that uses the Go SDK for Google Generative AI. chatbot.mp4 · These instructions will get you up and running on your local machine for development purposes. Go (currently running: go version go1.22.4 darwin/arm64) Make (currently running: GNU Make 3.81) git clone https://github.com/kavinaravind/go-genai.git cd go-genai make build ·
Author   kavinaravind
🌐
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
Find elsewhere
🌐
Go Packages
pkg.go.dev › github.com › firebase › genkit › go
go module - github.com/firebase/genkit/go - Go Packages
May 6, 2026 - import "google.golang.org/genai" // Simple: just the model name response, _ := genkit.Generate(ctx, g, ai.WithModelName("googleai/gemini-flash-latest"), ai.WithPrompt("Hello!"), ) // Advanced: model name + provider-specific configuration response, _ := genkit.Generate(ctx, g, ai.WithModel(googlegenai.ModelRef("googleai/gemini-flash-latest", &genai.GenerateContentConfig{ Temperature: genai.Ptr(float32(0.7)), MaxOutputTokens: genai.Ptr(int32(1000)), TopP: genai.Ptr(float32(0.9)), })), ai.WithPrompt("Hello!"), ) Use the Genkit CLI to run your app with tracing and a local development UI: curl -sL cli.genkit.dev | bash genkit start -- go run main.go ·
🌐
DEV Community
dev.to › pradumnasaraf › building-an-ai-powered-cli-with-golang-and-google-gemini-45a1
Building an AI-Powered CLI with Golang and Google Gemini - DEV Community
August 27, 2024 - package cmd import ( "context" "fmt" "log" "os" "github.com/google/generative-ai-go/genai" "github.com/spf13/cobra" "google.golang.org/api/option" ) // searchCmd represents the search command var searchCmd = &cobra.Command{ Use: "search", Short: "A brief description of your command", // Added the getResponse() function Run: func(cmd *cobra.Command, args []string) { getResponse() }, } func init() { rootCmd.AddCommand(searchCmd) } func getResponse() { 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.5-flash") resp, err := model.GenerateContent(ctx, genai.Text("Write a story about a AI and magic")) if err != nil { log.Fatal(err) } fmt.Println(resp.Candidates[0].Content.Parts[0]) }
🌐
GitHub
github.com › google › generative-ai-go › blob › main › genai › chat.go
generative-ai-go/genai/chat.go at main · google/generative-ai-go
package genai · · import ( "context" ) · // A ChatSession provides interactive chat. type ChatSession struct { m *GenerativeModel · History []*Content · } · // StartChat starts a chat session. func (m *GenerativeModel) StartChat() *ChatSession { return &ChatSession{m: m} } ·
Author   google
🌐
GitHub
github.com › googleapis › go-genai › releases
Releases · googleapis/go-genai
Google Gen AI Go SDK provides an interface for developers to integrate Google's generative models into their Go applications. - Releases · googleapis/go-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 - With Gemini 2.0, we took the chance to create a single unified SDK for all developers who want to use Google's GenAI models (Gemini, Veo, Imagen, etc).
🌐
Google
google.github.io › adk-docs › get-started › go
Go - Agent Development Kit (ADK)
package main import ( "context" "log" "os" "google.golang.org/adk/agent" "google.golang.org/adk/agent/llmagent" "google.golang.org/adk/cmd/launcher" "google.golang.org/adk/cmd/launcher/full" "google.golang.org/adk/model/gemini" "google.golang.org/adk/tool" "google.golang.org/adk/tool/geminitool" "google.golang.org/genai" ) func main() { ctx := context.Background() model, err := gemini.NewModel(ctx, "gemini-flash-latest", &genai.ClientConfig{ APIKey: os.Getenv("GOOGLE_API_KEY"), }) if err != nil { log.Fatalf("Failed to create model: %v", err) } timeAgent, err := llmagent.New(llmagent.Config{ Na
🌐
GitHub
github.com › topics › genai-go
genai-go · GitHub Topics · GitHub
Build AI applications in Go with a unified SDK for text generation, structured output, tool integration, and agent management. agent firebase sdk google-cloud gpt llm chatgpt langchain azureopenai gemini-ai genkit genkit-plugin firebase-genkit ...
🌐
GitHub
github.com › aws-samples › building-genai-applications-with-golang
GitHub - aws-samples/building-genai-applications-with-golang: This sample code show how to build generative AI applications on AWS using Amazon Bedrock and Golang programming. · GitHub
# syntax=docker/dockerfile:1 # Build the application from source FROM golang:1.21.5 AS build-stage WORKDIR /app COPY go.mod go.sum ./ RUN go mod download COPY *.go ./ COPY bedrock ./bedrock RUN CGO_ENABLED=0 GOOS=linux go build -o /genaiapp # Run the tests in the container FROM build-stage AS run-test-stage # Deploy the application binary into a lean image FROM gcr.io/distroless/base-debian11 AS build-release-stage WORKDIR / COPY --from=build-stage /genai-go-app /genaiapp COPY static ./static EXPOSE 3000 USER nonroot:nonroot ENTRYPOINT ["/genaiapp"]
Author   aws-samples
🌐
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 - import ( "github.com/google/generative-ai-go/genai" "github.com/google/generative-ai-go/genai/fileman" // For files "google.golang.org/api/option" ) client, err := genai.NewClient(ctx, option.WithAPIKey("GEMINI_API_KEY")) fileClient, err := fileman.NewClient(ctx, option.WithAPIKey("GEMINI_...
🌐
Google
docs.cloud.google.com › gemini enterprise agent platform › google gen ai sdk
Google Gen AI SDK | Gemini Enterprise Agent Platform | Google Cloud Documentation
The Google Gen AI SDK for Go is available on go.dev and GitHub: ... # Replace the `GOOGLE_CLOUD_PROJECT` and `GOOGLE_CLOUD_LOCATION` values # with appropriate values for your project. export GOOGLE_CLOUD_PROJECT=GOOGLE_CLOUD_PROJECT export GOOGLE_CLOUD_LOCATION=global export GOOGLE_GENAI_USE_ENTERPRISE=True · import ( "context" "fmt" "io" "google.golang.org/genai" ) // generateWithText shows how to generate text using a text prompt.
🌐
GitHub
github.com › topics › genai
genai · GitHub Topics · GitHub
go golang ai artificial-intelligence openai language-model llm generative-ai anthropic genai ... cli commandline terminal command-line gemini cli-app google-ai gemini-client chatai aichat generative-ai genai genai-chatbot genai-chatbot-api google-gemini gemini-ai google-gemini-ai