{"id":65648,"library":"google-generative-ai-go","title":"Google Generative AI Go Client","description":"Go client library for Google's Generative AI models, including Gemini.","status":"active","version":"0.20.1","language":"go","source_language":null,"source_url":"https://github.com/google/generative-ai-go","tags":["ai","gemini","google","generative","machine-learning"],"install":[{"cmd":"go get github.com/google/generative-ai-go","lang":"bash","label":"Install github.com/google/generative-ai-go"}],"dependencies":[],"imports":[{"symbol":"generativeai","correct":"github.com/google/generative-ai-go"}],"quickstart":{"code":"package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/google/generative-ai-go/genai\"\n\t\"google.golang.org/api/option\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tclient, err := genai.NewClient(ctx, option.WithAPIKey(\"YOUR_API_KEY\"))\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer client.Close()\n\n\tmodel := client.GenerativeModel(\"gemini-pro\")\n\tresp, err := model.GenerateContent(ctx, genai.Text(\"Hello\"))\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Println(resp.Candidates[0].Content.Parts[0])\n}","lang":"go","description":"Initializes a Gemini client and generates content from a prompt."},"warnings":[{"fix":"Set the GOOGLE_API_KEY environment variable or pass credentials via option.WithAPIKey.","message":"Requires a valid Google Cloud API key or service account credentials.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'ai':3,13,17 'client':5,7 'gemini':16,18 'generat':2,12,20 'go':4,6 'googl':1,10,19 'includ':15 'learn':23 'librari':8 'machin':22 'machine-learn':21 'model':14","created_at":"2026-06-17T17:13:22.198624+00:00","updated_at":"2026-06-17T17:13:22.198624+00:00","problems":[],"ecosystem":"go","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/google/generative-ai-go","github":"https://github.com/google/generative-ai-go","docs":"https://pkg.go.dev/github.com/google/generative-ai-go#section-documentation","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["cloud","utility"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-12-14","install_tag":null}}