google

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Enable

func Enable(apiKey, modelName, actionName string) sdk.ClientOption

Enable returns a ClientOption that wires the Google provider. usage: client.New(..., google.Enable("key", "gemini-pro", "my_action"))

func Factory

func Factory(opts map[string]any) (sdk.ClientOption, error)

Factory implements the sdk.ProviderFactory interface for Config-driven loading.

func Init

func Init(ctx context.Context, globalG *genkit.Genkit, apiKey string, modelName string, logger core.Logger) (string, error)

Init sets up the Google provider using a Proxy Pattern. It isolates the Google plugin in a local instance and registers a proxy in the global registry. logger receives a warning whenever the proxied request's GenerationConfig is dropped (see the workaround below) so the loss of Temperature/MaxOutputTokens is observable rather than silent.

func InitWithConfig added in v0.5.0

func InitWithConfig(ctx context.Context, globalG *genkit.Genkit, cfg Config, logger core.Logger) (string, error)

InitWithConfig sets up the Google provider with full configuration including Vertex AI multi-region support.

Types

type Config added in v0.5.0

type Config struct {
	APIKey     string
	ModelName  string
	Project    string // Vertex AI project (enables Vertex mode)
	Location   string // Vertex AI region (e.g. "us-central1", "us", "eu", "global")
	APIVersion string // Vertex AI API version override (e.g. "v1", "v1beta")
}

Config holds configuration for the Google AI provider.

type GoogleEmbedder

type GoogleEmbedder struct {
	// contains filtered or unexported fields
}

func NewEmbedder

func NewEmbedder(ctx context.Context, apiKey string, modelName string) (*GoogleEmbedder, error)

NewEmbedder creates a new embedder using Google GenAI. Default model: "embedding-001" or "text-embedding-004"

func (*GoogleEmbedder) Dimension

func (e *GoogleEmbedder) Dimension() int

func (*GoogleEmbedder) Embed

func (e *GoogleEmbedder) Embed(ctx context.Context, text string) ([]float32, error)

func (*GoogleEmbedder) EmbedBatch

func (e *GoogleEmbedder) EmbedBatch(ctx context.Context, texts []string) ([][]float32, error)

Jump to

Keyboard shortcuts

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