gemini

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	APIKey          string
	BaseURL         string
	Model           string
	MaxTokens       int
	AuthHeader      string
	AuthScheme      string
	AuthHeaderValue string
	CustomHeaders   map[string]string
	HTTPClient      *http.Client
	UserAgent       string
	// OAuthResolver, when set, supplies an OAuth bearer credential per request and
	// is retried once with a forced token refresh after an upstream 401 (matching
	// the OpenAI and Anthropic providers). Nil falls back to plain API-key auth.
	OAuthResolver providerio.TokenResolver
	// StreamIdleTimeout aborts the stream if no data arrives for this long.
	// When unset, Zero uses providerio.ResolveStreamIdleTimeout — the
	// ZERO_STREAM_IDLE_TIMEOUT override or providerio.DefaultStreamIdleTimeout.
	StreamIdleTimeout time.Duration
}

Options configures a Gemini streamGenerateContent provider.

type Provider

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

Provider streams completions from the Gemini API.

func New

func New(options Options) (*Provider, error)

New creates a Gemini provider.

func (*Provider) StreamCompletion

func (provider *Provider) StreamCompletion(
	ctx context.Context,
	request zeroruntime.CompletionRequest,
) (<-chan zeroruntime.StreamEvent, error)

StreamCompletion sends one streaming Gemini GenerateContent request.

Jump to

Keyboard shortcuts

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