gemini

package
v1.8.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProviderOptionSafetySettings = "safety_settings"
	ProviderOptionTopK           = "top_k"
	ProviderOptionCandidateCount = "candidate_count"
)

Variables

This section is empty.

Functions

func Factory

func Factory(cfg Config) (litellm.Provider, error)

func NewClient

func NewClient(cfg Config, opts ...litellm.ClientOption) (*litellm.Client, error)

NewClient builds the provider from cfg and wraps it in a ready *litellm.Client. It is a convenience for the common single-provider case. It calls New(cfg) and then litellm.New(provider, opts...).

Types

type Config

type Config struct {
	APIKey     string
	APIKeyFunc func(context.Context) (string, error)
	BaseURL    string
	HTTPClient HTTPClient
	Transport  http.RoundTripper
	Retry      *retry.Policy
}

type HTTPClient

type HTTPClient interface {
	Do(*http.Request) (*http.Response, error)
}

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

func New

func New(cfg Config) (*Provider, error)

func (*Provider) Capabilities added in v1.8.1

func (p *Provider) Capabilities(model string) litellm.Capabilities

func (*Provider) Chat

func (p *Provider) Chat(ctx context.Context, req *litellm.Request) (*litellm.Response, error)

func (*Provider) ListModels

func (p *Provider) ListModels(ctx context.Context) ([]litellm.ModelInfo, error)

func (*Provider) Name

func (p *Provider) Name() string

func (*Provider) Stream

func (p *Provider) Stream(ctx context.Context, req *litellm.Request) (litellm.Stream, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL