Documentation
¶
Overview ¶
Package gemini implements chat.Client for Gemini on top of the official google.golang.org/genai SDK.
Index ¶
Constants ¶
const ( ModelGemini3_5Flash = "gemini-3.5-flash" ModelGemini3_1ProPreview = "gemini-3.1-pro-preview" ModelGemini2_5Flash = "gemini-2.5-flash" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIKeyProvider ¶
APIKeyProvider resolves the API key dynamically, for short-lived tokens.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps the genai SDK.
type Config ¶
type Config struct {
APIKey string
APIKeyProvider APIKeyProvider
// Vertex means the API key belongs to Vertex AI (express mode) and requests go to the Vertex endpoint;
// by default the Gemini API (generativelanguage.googleapis.com) is used.
// Full Vertex access based on project, region and credentials is not provided yet.
Vertex bool
BaseURL string
Model string
MaxInputTokens int
MaxOutputTokens int
Timeout time.Duration
Headers map[string]string
HTTPClient *http.Client
// ImageGeneration means the model can generate images (such as the gemini-*-image models):
// requests ask for both TEXT and IMAGE output, and generated images in history are replayed as is.
ImageGeneration bool
// HTTPHooks are debugging hooks at the raw HTTP layer.
HTTPHooks chat.HTTPHooks
}
Config configures the Gemini Client.