Documentation
¶
Index ¶
- Constants
- func IsModelSupported(model string) bool
- func Metadata() provider.Metadata
- func Models() []string
- func New(cfg config.ProviderConfig) (provider.Provider, error)
- type Client
- func (c *Client) ContextWindow(model string) int
- func (c *Client) DefaultModel() string
- func (c *Client) EstimateTokens(s string) int
- func (c *Client) Name() string
- func (c *Client) Pricing(model string) provider.Pricing
- func (c *Client) Review(ctx context.Context, req provider.Request) (provider.Response, error)
- func (c *Client) TestConnection(ctx context.Context) error
Constants ¶
const ( Name = "gemini" // ModelPro31 is a preview model: the public pricing page lists the Pro // tier only as gemini-3.1-pro-preview. Update to the stable ID once // Google promotes it out of preview. ModelPro31 = "gemini-3.1-pro-preview" // ModelFlash35 is deprecated (2026-10-08): Google auto-routes it to // gemini-3.6-flash. Kept so existing configs keep their pricing row. ModelFlash35 = "gemini-3.5-flash" ModelFlashLite31 = "gemini-3.1-flash-lite" ModelFlash38 = "gemini-3.8-flash" ModelFlashLite35 = "gemini-3.5-flash-lite" // Gemini 4 family (GA 2026-11). Google does not label it Pro/Flash/Lite: // carbon is the strongest reasoning model, neon sits between hydrogen // and carbon (the upgrade target for gemini-3.1-pro-preview), and // hydrogen is the fast, cost-efficient Flash-class successor. There is // no Gemini 4 Lite; the Lite tier stays gemini-3.5-flash-lite. ModelCarbon4 = "gemini-4-carbon" ModelNeon4 = "gemini-4-neon" ModelHydrogen4 = "gemini-4-hydrogen" DefaultModel = ModelFlash38 )
Variables ¶
This section is empty.
Functions ¶
func IsModelSupported ¶
func Metadata ¶ added in v1.17.0
Metadata describes gemini without needing a credential, so documentation can list every model, context window and price for a reader who has never configured this provider. See ADR-0039.
Every field is derived from this package's own tables — supportedModels for the set and its order, contextWindowFor and pricingFor for the numbers — so adding a model there surfaces it here automatically. A hand-written literal would just relocate the duplication.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}