gemini

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0, Apache-2.0 Imports: 7 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

View Source
const EmbeddingModelType string = "gemini"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name      string `yaml:"name" validate:"required"`
	Type      string `yaml:"type" validate:"required"`
	Model     string `yaml:"model" validate:"required"`
	ApiKey    string `yaml:"apiKey"`
	Project   string `yaml:"project"`
	Location  string `yaml:"location"`
	Dimension int32  `yaml:"dimension"`
}

func (Config) EmbeddingModelConfigType

func (cfg Config) EmbeddingModelConfigType() string

Returns the embedding model type

func (Config) Initialize

func (cfg Config) Initialize(ctx context.Context) (embeddingmodels.EmbeddingModel, error)

Initialize a Gemini embedding model

type EmbeddingModel

type EmbeddingModel struct {
	Client *genai.Client
	Config
}

func (EmbeddingModel) EmbedParameters

func (m EmbeddingModel) EmbedParameters(ctx context.Context, parameters []string) ([][]float32, error)

func (EmbeddingModel) EmbeddingModelType

func (m EmbeddingModel) EmbeddingModelType() string

Returns the embedding model type

func (EmbeddingModel) ToConfig

Jump to

Keyboard shortcuts

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