Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EndpointFromConfig ¶
func EndpointFromConfig(cfg Config) ai.ProviderEndpoint
EndpointFromConfig creates a ProviderEndpoint from Config for testing.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements ai.APIClient for the Google Gemini REST API. It is stateless — base URL, API key, and version come from ProviderEndpoint per-call.
func NewClient ¶
func NewClient(cfg ClientConfig) *Client
NewClient constructs a Google Gemini protocol client.
func Register ¶
func Register(cfg ClientConfig) *Client
Register creates a Client and registers it as an API client.
func (*Client) ClientType ¶
ClientType returns the API client type identifier.
func (*Client) Stream ¶
func (c *Client) Stream(ctx context.Context, endpoint ai.ProviderEndpoint, model ai.Model, llmCtx ai.Context, opts ai.StreamOptions) *ai.EventStream
func (*Client) StreamSimple ¶
func (c *Client) StreamSimple(ctx context.Context, endpoint ai.ProviderEndpoint, model ai.Model, llmCtx ai.Context, opts ai.SimpleStreamOptions) *ai.EventStream
type ClientConfig ¶
ClientConfig controls Google client construction.
type Config ¶
type Config struct {
HTTPClient *http.Client
BaseURL string
APIKey string
Version string // API version, default "v1beta"
}
Config holds test-friendly configuration for constructing a ProviderEndpoint.
type EmbeddingClient ¶
type EmbeddingClient struct {
// contains filtered or unexported fields
}
EmbeddingClient implements ai.EmbeddingAPIClient for the Google Gemini REST API. It is stateless — base URL, API key, and version come from ProviderEndpoint per-call.
func NewEmbeddingClient ¶
func NewEmbeddingClient(cfg ClientConfig) *EmbeddingClient
NewEmbeddingClient constructs a Google embedding client.
func RegisterEmbeddingClient ¶
func RegisterEmbeddingClient(cfg ClientConfig) *EmbeddingClient
RegisterEmbeddingClient creates and registers the Google embedding API client.
func (*EmbeddingClient) ClientType ¶
func (c *EmbeddingClient) ClientType() string
ClientType returns the embedding API client type identifier.
func (*EmbeddingClient) Embed ¶
func (c *EmbeddingClient) Embed(ctx context.Context, endpoint ai.ProviderEndpoint, model ai.EmbeddingModel, req ai.EmbeddingRequest) (*ai.EmbeddingResponse, error)
Embed dispatches embedding requests with shared batch-splitting behavior.