gemini

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const Domain = "generativelanguage.googleapis.com"

Variables

This section is empty.

Functions

func RetryAfterFromResponse

func RetryAfterFromResponse(_ *http.Response, responseBody []byte) *time.Duration

RetryAfterFromResponse extracts the server-advised retry delay from a Gemini API error response body (a google.rpc.RetryInfo entry, e.g. "retryDelay": "43s"). It returns nil when the body carries no such hint. It satisfies retry_config.RetryAfterFunc, so callers can wire it into a retry configuration to honour the API's own rate-limit timing instead of relying on back-off alone.

Types

type Client

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

func NewClient

func NewClient(options ...gemini_config.Option) *Client

func (*Client) GenerateContent

GenerateContent generates a model response for the given request. https://ai.google.dev/api/generate-content

Jump to

Keyboard shortcuts

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