Documentation
¶
Overview ¶
Package gemini is a reference client emulator for the Google Gemini generateContent API, built on google.golang.org/genai.
Unlike openai-go and anthropic-sdk-go, the genai client's generateContent and streamGenerateContent paths issue a single HTTP round-trip per call (no built-in exponential retry on 429 for these RPCs). Credential tests can rely on one upstream hit when using refbackend ForcedHTTPStatus 429; see server tests in internal/refbackend/gemini.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps genai.Client for scriptable generateContent calls.
func (*Client) GenerateContent ¶
func (c *Client) GenerateContent(ctx context.Context, model string, contents []*genai.Content, config *genai.GenerateContentConfig) (*genai.GenerateContentResponse, error)
GenerateContent calls the non-streaming generateContent RPC.
func (*Client) GenerateContentStream ¶
func (c *Client) GenerateContentStream(ctx context.Context, model string, contents []*genai.Content, config *genai.GenerateContentConfig) iter.Seq2[*genai.GenerateContentResponse, error]
GenerateContentStream calls streamGenerateContent (?alt=sse).