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 (*Provider) StreamCompletion ¶
func (provider *Provider) StreamCompletion( ctx context.Context, request zeroruntime.CompletionRequest, ) (<-chan zeroruntime.StreamEvent, error)
StreamCompletion sends one streaming Gemini GenerateContent request.
Click to show internal directories.
Click to hide internal directories.