google

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 12 Imported by: 0

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

func (c *Client) ClientType() string

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

type ClientConfig struct {
	HTTPClient *http.Client
}

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

Embed dispatches embedding requests with shared batch-splitting behavior.

Jump to

Keyboard shortcuts

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