Documentation
¶
Overview ¶
Package gemini connects to the Gemini API.
Index ¶
- Constants
- type Config
- type Provider
- func (p *Provider) Capabilities() litellm.Capabilities
- func (p *Provider) Chat(ctx context.Context, req *litellm.Request) (*litellm.Response, error)
- func (p *Provider) ListModels(ctx context.Context) ([]litellm.ModelInfo, error)
- func (p *Provider) Name() string
- func (p *Provider) Stream(ctx context.Context, req *litellm.Request) (litellm.Stream, error)
Constants ¶
View Source
const ( ProviderOptionSafetySettings = "safetySettings" ProviderOptionGenerationConfig = "generationConfig" ProviderOptionTools = "tools" ProviderOptionToolConfig = "toolConfig" ProviderOptionCachedContent = "cachedContent" )
ProviderOptions are native request fields copied into the body. An option naming a generated object or array is merged into or appended to it, e.g. {"topK": 40} under "generationConfig" or [{"googleSearch": {}}] under "tools".
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// APIKey authenticates requests; APIKeyFunc, when set, resolves it per
// request instead.
APIKey string
APIKeyFunc func(context.Context) (string, error)
// BaseURL is the API origin, https://generativelanguage.googleapis.com by
// default.
BaseURL string
// HTTPClient sends requests; nil uses http.DefaultClient. Wrap it with
// retry.NewHTTPClient to retry.
HTTPClient litellm.HTTPClient
UserAgent string
// Headers are set after the defaults, so they can override them.
Headers map[string]string
}
Config configures the Gemini API client. An API key is required.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements litellm.Provider, litellm.CapabilityProvider and litellm.ModelLister.
func (*Provider) Capabilities ¶ added in v1.8.1
func (p *Provider) Capabilities() litellm.Capabilities
Capabilities reports the static protocol facts.
func (*Provider) ListModels ¶
ListModels lists the models available to the API key.
Click to show internal directories.
Click to hide internal directories.