google

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

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) (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.

Types

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