gemini

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 12 Imported by: 0

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