Documentation
¶
Overview ¶
ABOUTME: Google Gemini API adapter implementing the ProviderAdapter interface. ABOUTME: Handles HTTP communication, SSE stream parsing, and request/response lifecycle.
ABOUTME: Request/response translation between the unified llm types and Google Gemini API format. ABOUTME: Handles systemInstruction extraction, model role mapping, synthetic tool call IDs, and finish reasons.
ABOUTME: Translates Gemini usageMetadata into the unified llm.Usage shape. ABOUTME: Thinking sits outside the candidate count; cached content sits inside the prompt count.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter implements llm.ProviderAdapter for the Google Gemini API.
type Option ¶
type Option func(*Adapter)
Option configures an Adapter.
func WithBaseURL ¶
WithBaseURL overrides the default Gemini API base URL.
func WithHTTPClient ¶
WithHTTPClient provides a custom http.Client.
func WithStreamIdleTimeout ¶ added in v0.64.0
WithStreamIdleTimeout overrides the stream-idle deadline: the maximum time a streaming SSE socket may go byte-silent before it is cancelled and surfaced as a retryable error (#575). A non-positive value disables the guard.