vectorizer

package
v1.24.7 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultVectorizeClassName     = false
	DefaultPropertyIndexed        = true
	DefaultVectorizePropertyName  = false
	DefaultApiEndpoint            = "us-central1-aiplatform.googleapis.com"
	DefaultModelID                = "textembedding-gecko@001"
	DefaulGenerativeAIApiEndpoint = "generativelanguage.googleapis.com"
	DefaulGenerativeAIModelID     = "embedding-gecko-001"
)

Variables

This section is empty.

Functions

func NewClassSettings added in v1.24.0

func NewClassSettings(cfg moduletools.ClassConfig) *classSettings

Types

type ClassSettings

type ClassSettings interface {
	PropertyIndexed(property string) bool
	VectorizePropertyName(propertyName string) bool
	VectorizeClassName() bool
	ApiEndpoint() string
	ProjectID() string
	ModelID() string
	TitleProperty() string
}

IndexCheck returns whether a property of a class should be indexed

type Client

type Client interface {
	Vectorize(ctx context.Context, input []string,
		config ent.VectorizationConfig, titlePropertyValue string) (*ent.VectorizationResult, error)
	VectorizeQuery(ctx context.Context, input []string,
		config ent.VectorizationConfig) (*ent.VectorizationResult, error)
}

type Vectorizer

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

func New

func New(client Client) *Vectorizer

func (*Vectorizer) Texts

func (v *Vectorizer) Texts(ctx context.Context, inputs []string,
	cfg moduletools.ClassConfig,
) ([]float32, error)

Jump to

Keyboard shortcuts

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