Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultVectorizeClassName = false DefaultPropertyIndexed = true DefaultVectorizePropertyName = false DefaultApiEndpoint = "us-central1-aiplatform.googleapis.com" DefaultModel = "gemini-embedding-001" DefaultAIStudioEndpoint = "generativelanguage.googleapis.com" DefaulAIStudioModel = "gemini-embedding-001" DefaultTaskType = "RETRIEVAL_QUERY" )
Variables ¶
View Source
var DefaultDimensions int64 = 768
default dimensions are set to 768 bc of being backward compatible with earlier models textembedding-gecko@001 and embedding-001 that were default ones
Functions ¶
func NewClassSettings ¶
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) Object ¶
func (v *Vectorizer) Object(ctx context.Context, object *models.Object, cfg moduletools.ClassConfig, ) ([]float32, models.AdditionalProperties, error)
func (*Vectorizer) Texts ¶
func (v *Vectorizer) Texts(ctx context.Context, inputs []string, cfg moduletools.ClassConfig, ) ([]float32, error)
Click to show internal directories.
Click to hide internal directories.