{"id":19721305,"url":"https://github.com/meinside/gemini-things-go","last_synced_at":"2026-05-15T19:32:09.842Z","repository":{"id":256894180,"uuid":"856667498","full_name":"meinside/gemini-things-go","owner":"meinside","description":"A Golang library for generating things with Gemini APIs","archived":false,"fork":false,"pushed_at":"2026-05-11T08:18:07.000Z","size":484,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-05-11T10:29:00.427Z","etag":null,"topics":["gemini-api","golang","google"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/meinside.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-09-13T01:27:43.000Z","updated_at":"2026-05-11T08:18:12.000Z","dependencies_parsed_at":"2024-09-13T17:16:51.179Z","dependency_job_id":"8acd5ca3-8413-403f-92f2-c257c5777222","html_url":"https://github.com/meinside/gemini-things-go","commit_stats":null,"previous_names":["meinside/gemini-things-go"],"tags_count":194,"template":false,"template_full_name":null,"purl":"pkg:github/meinside/gemini-things-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meinside%2Fgemini-things-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meinside%2Fgemini-things-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meinside%2Fgemini-things-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meinside%2Fgemini-things-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meinside","download_url":"https://codeload.github.com/meinside/gemini-things-go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meinside%2Fgemini-things-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33076167,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gemini-api","golang","google"],"created_at":"2024-11-11T23:13:57.004Z","updated_at":"2026-05-15T19:32:09.837Z","avatar_url":"https://github.com/meinside.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gemini-things-go\n\nA helper library for generating things with [Gemini API](https://github.com/googleapis/go-genai).\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/meinside/gemini-things-go.svg)](https://pkg.go.dev/github.com/meinside/gemini-things-go)\n\n## Usage\n\nSee the code examples in the [generation_test.go](https://github.com/meinside/gemini-things-go/blob/master/generation_test.go) file.\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"time\"\n\n\tgt \"github.com/meinside/gemini-things-go\"\n)\n\nconst (\n\tapiKey = `AIabcdefghijklmnopqrstuvwxyz_ABCDEFG-00000000-00` // Your API key here\n\tmodel  = \"gemini-2.5-flash\"\n\n\tcontentsBuildupTimeoutSeconds = 60\n\tgenerationTimeoutSeconds      = 30\n)\n\nfunc main() {\n\tif client, err := gt.NewClient(\n\t\tapiKey,\n\t\tgt.WithModel(model),     // Specify the model\n\t\tgt.WithMaxRetryCount(5), // Configure a maximum of 5 retries on 5xx server errors\n\t); err == nil {\n\t\tctxContents, cancelContents := context.WithTimeout(context.TODO(), contentsBuildupTimeoutSeconds*time.Second)\n\t\tdefer cancelContents()\n\n\t\t// convert prompts and histories to contents for generation\n\t\tif contents, err := client.PromptsToContents(\n\t\t\tctxContents,\n\t\t\t[]gt.Prompt{\n\t\t\t\tgt.PromptFromText(`What is the answer to life, the universe, and everything?`),\n\t\t\t},\n\t\t\tnil,\n\t\t); err == nil {\n\t\t\tctxGenerate, cancelGenerate := context.WithTimeout(context.TODO(), generationTimeoutSeconds*time.Second)\n\t\t\tdefer cancelGenerate()\n\n\t\t\t// generate with contents\n\t\t\tif res, err := client.Generate(\n\t\t\t\tctxGenerate,\n\t\t\t\tcontents,\n\t\t\t); err == nil {\n\t\t\t\t// do something with the generated response\n\t\t\t\tfmt.Printf(\"response: %+v\\n\", res)\n\t\t\t} else {\n\t\t\t\tpanic(fmt.Errorf(\"failed to generate: %w\", err))\n\t\t\t}\n\t\t} else {\n\t\t\tpanic(fmt.Errorf(\"failed to convert prompts: %w\", err))\n\t\t}\n\t} else {\n\t\tpanic(fmt.Errorf(\"failed to create client: %w\", err))\n\t}\n}\n```\n\n## Test\n\nTest with Gemini API key:\n\n```bash\n$ GEMINI_API_KEY=\"AIabcdefghijklmnopqrstuvwxyz_ABCDEFG-00000000-00\" go test -timeout 0\n\n# for verbose output:\n$ GEMINI_API_KEY=\"AIabcdefghijklmnopqrstuvwxyz_ABCDEFG-00000000-00\" VERBOSE=true go test -timeout 0\n\n# for testing free APIs only\n$ GEMINI_API_KEY=\"AIabcdefghijklmnopqrstuvwxyz_ABCDEFG-00000000-00\" go test -run=\"Free\"\n\n# for testing paid APIs only\n$ GEMINI_API_KEY=\"AIabcdefghijklmnopqrstuvwxyz_ABCDEFG-00000000-00\" go test -run=\"Paid\"\n```\n\nor with Google Cloud credential file (for Vertex AI):\n\n```bash\n$ CREDENTIALS_FILEPATH=\"/path/to/credentials.json\" go test -timeout 0\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeinside%2Fgemini-things-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeinside%2Fgemini-things-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeinside%2Fgemini-things-go/lists"}