gemini

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: MIT Imports: 21 Imported by: 1 module, 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

Overview

Package gemini integrates the Gemini Developer API text/function subset using official Google GenAI SDK content types and bounded streaming I/O.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrProtocol    = errors.New("gemini: invalid protocol or history")
	ErrIncomplete  = errors.New("gemini: incomplete model response")
	ErrRemote      = errors.New("gemini: provider reported an error")
	ErrLimit       = errors.New("gemini: protocol resource limit exceeded")
	ErrTransport   = errors.New("gemini: transport failed")
	ErrUnsupported = errors.New("gemini: unsupported content or response mode")
)

Functions

This section is empty.

Types

type Client

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

func New

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

New uses no implicit environment credentials, default destinations, background execution, retries or remote conversation state.

func (*Client) Complete

func (c *Client) Complete(ctx context.Context, req agent.ModelRequest, emit func(string) error) (agent.ModelResponse, error)

func (*Client) NativeHistoryFormat

func (c *Client) NativeHistoryFormat() string

type Config

type Config struct {
	BaseURL            string
	Model              string
	APIKey             string
	MaxOutputTokens    int32
	NativeHistoryScope string
	// AllowUnsignedToolCalls opts into older models that do not supply
	// thought signatures. By default the first function part needs one.
	AllowUnsignedToolCalls bool
	HTTPClient             *http.Client
}

Config is explicit. BaseURL includes the API version (e.g. /v1beta). NativeHistoryScope is a non-secret caller label for one trusted model, account and conversation. It is not an ACL or an integrity mechanism.

type HTTPError

type HTTPError struct{ StatusCode int }

func (*HTTPError) Error

func (e *HTTPError) Error() string

Jump to

Keyboard shortcuts

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