Documentation
¶
Overview ¶
Command example shows the public API of the core/llm/gemini package: build a reusable Client, bind a structured-output type with New, and call Generate to get a fully decoded value plus token usage and finish reason.
It needs a real Gemini key, so it reads two env vars and is a no-op without them. Run it from the core module with:
export GEMINI_API_KEY=... # your key export GEMINI_MODEL=gemini-3 # any model id (never hard-coded) go run ./llm/gemini/example
Cloud-credential recipe (#854 auth matrix — Gemini on Vertex AI):
hc, _ := llmauth.NewGoogleDefaultHTTPClient(ctx) // ADC; or NewGoogleServiceAccountHTTPClient
c := gemini.NewClient("", model, // empty key: transport owns auth
gemini.WithVertexAI(project, location),
gemini.WithHTTPClient(hc))
Click to show internal directories.
Click to hide internal directories.