Documentation
¶
Overview ¶
Package gemini adapts Google's Gemini generateContent API to agent.Model. It translates the provider-neutral []agent.Message/Part model to Gemini "contents" (text, inlineData/fileData images, functionCall, functionResponse), declares tools as functionDeclarations, opens the SSE stream (streamGenerateContent?alt=sse), and normalizes Gemini's response chunks into agent's Event taxonomy. Zero external deps: net/http + stdlib, exactly like the anthropic and openai adapters (the repo enforces a lean core via architecture_test.go, so google.golang.org/genai is deliberately not imported).
Gemini sends COMPLETE functionCall objects (name + args object), not the streamed argument fragments Anthropic/OpenAI send. So one functionCall part becomes a single ToolCallDelta carrying the whole args object as ArgsFragment; the agent core's finalize() json.Valid gate still holds because a complete args object is valid JSON.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is a Google Gemini generateContent API adapter implementing agent.Model.