Documentation
¶
Overview ¶
Package gemini implements llm.Generator with Google's official Gemini SDK.
It targets the Gemini Developer API. Vertex AI configuration is intentionally outside this package's current surface. Assistant messages may contain opaque ProviderData that preserves Gemini thought signatures and part ordering; callers should pass that data back unchanged with conversation history.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an immutable Gemini Developer API client. It is safe for concurrent use when its configured HTTP client is safe for concurrent use.
type Config ¶
type Config struct {
Provider string
Model string
Capabilities []llm.Capability
APIKey string
BaseURL string
APIVersion string
HTTPClient *http.Client
Headers http.Header
}
Config configures a Gemini Developer API client. Model and APIKey are required. Provider identifies the service in ModelInfo and errors; it defaults to "gemini". BaseURL and APIVersion default to Google's public Gemini endpoint and v1beta API.
Capabilities opts the configured model into optional protocol features; generation is always enabled, while streaming, tools, JSON mode, vision, and audio input must be listed explicitly. A non-nil HTTPClient and custom Headers are used as supplied, without being mutated by Client. A nil HTTPClient uses http.DefaultClient, which has no overall request timeout; callers should use context deadlines or configure a client timeout.