gemini

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package gemini implements the Gemini Embedding 2 backend.

Supports text, image, and native video embedding via the official Google GenAI SDK. Model: gemini-embedding-2-preview (768 dimensions, MRL-capable).

Index

Constants

View Source
const (
	DefaultModel      = "gemini-embedding-2-preview"
	DefaultDimensions = 768
	DefaultRPM        = 55
)

Variables

This section is empty.

Functions

func ModelInfos added in v0.16.0

func ModelInfos() []engine.ModelInfo

ModelInfos returns i18n metadata for Gemini embedding models.

Types

type Config

type Config struct {
	APIKey     string
	Model      string
	Dimensions int
	RPM        int
	HTTPClient *http.Client
}

Config configures the Gemini embedding engine.

type Engine

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

Engine implements embed.EmbedEngine for Gemini Embedding 2.

func New

func New(cfg Config) (*Engine, error)

New creates a Gemini embedding engine.

func (*Engine) Dimensions

func (e *Engine) Dimensions() int

func (*Engine) Embed

func (e *Engine) Embed(ctx context.Context, req embed.Request) (embed.Result, error)

Embed produces a vector for text, image, or video content.

func (*Engine) EmbedBatch

func (e *Engine) EmbedBatch(ctx context.Context, reqs []embed.Request) ([]embed.Result, error)

EmbedBatch embeds multiple requests sequentially (Gemini has no batch API).

func (*Engine) EmbedCapabilities

func (e *Engine) EmbedCapabilities() embed.Capability

EmbedCapabilities implements embed.Describer.

Jump to

Keyboard shortcuts

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