modules

package
v1.35.3 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: BSD-3-Clause Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClassBasedModuleConfig

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

func NewClassBasedModuleConfig

func NewClassBasedModuleConfig(class *models.Class,
	moduleName, tenant, targetVector string,
	cfg *config.Config,
) *ClassBasedModuleConfig

func NewCrossClassModuleConfig added in v1.20.0

func NewCrossClassModuleConfig(cfg *config.Config) *ClassBasedModuleConfig

func (*ClassBasedModuleConfig) Class

func (cbmc *ClassBasedModuleConfig) Class() map[string]interface{}

func (*ClassBasedModuleConfig) ClassByModuleName

func (cbmc *ClassBasedModuleConfig) ClassByModuleName(moduleName string) map[string]interface{}

func (*ClassBasedModuleConfig) Config added in v1.30.15

func (cbmc *ClassBasedModuleConfig) Config() *config.Config

func (*ClassBasedModuleConfig) PropertiesDataTypes added in v1.27.14

func (cbmc *ClassBasedModuleConfig) PropertiesDataTypes() map[string]schema.DataType

func (*ClassBasedModuleConfig) Property

func (cbmc *ClassBasedModuleConfig) Property(propName string) map[string]interface{}

func (*ClassBasedModuleConfig) TargetVector added in v1.24.0

func (cbmc *ClassBasedModuleConfig) TargetVector() string

func (*ClassBasedModuleConfig) Tenant added in v1.20.0

func (cbmc *ClassBasedModuleConfig) Tenant() string

type Provider

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

func NewProvider

func NewProvider(logger logrus.FieldLogger, cfg config.Config) *Provider

func (*Provider) AggregateArguments

func (p *Provider) AggregateArguments(class *models.Class) map[string]*graphql.ArgumentConfig

AggregateArguments provides GraphQL Aggregate arguments

func (*Provider) BackupBackend

func (p *Provider) BackupBackend(backend string) (modulecapabilities.BackupBackend, error)

func (*Provider) BatchUpdateVector added in v1.25.0

func (p *Provider) BatchUpdateVector(ctx context.Context, class *models.Class, objects []*models.Object,
	findObjectFn modulecapabilities.FindObjectFn,
	logger logrus.FieldLogger,
) (map[int]error, error)

func (*Provider) Close added in v1.32.0

func (p *Provider) Close() error

func (*Provider) CrossClassExtractSearchParams

func (p *Provider) CrossClassExtractSearchParams(arguments map[string]interface{}) map[string]interface{}

CrossClassExtractSearchParams extracts GraphQL arguments from modules without being specific to any one class and it's configuration. This is used in Explore() { } for example

func (*Provider) CrossClassValidateSearchParam

func (p *Provider) CrossClassValidateSearchParam(name string, value interface{}) error

CrossClassValidateSearchParam validates module parameters without being specific to any one class and it's configuration. This is used in Explore() { } for example

func (*Provider) CrossClassVectorFromSearchParam

func (p *Provider) CrossClassVectorFromSearchParam(ctx context.Context,
	param string, params interface{},
	findVectorFn modulecapabilities.FindVectorFn[[]float32],
) ([]float32, string, error)

CrossClassVectorFromSearchParam gets a vector for a given argument without being specific to any one class and it's configuration. This is used in Explore() { } for example

func (*Provider) EnabledBackupBackends added in v1.27.4

func (p *Provider) EnabledBackupBackends() []modulecapabilities.BackupBackend

func (*Provider) ExploreArguments

func (p *Provider) ExploreArguments(schema *models.Schema) map[string]*graphql.ArgumentConfig

ExploreArguments provides GraphQL Explore arguments

func (*Provider) ExtractAdditionalField

func (p *Provider) ExtractAdditionalField(className, name string, params []*ast.Argument) interface{}

ExtractAdditionalField extracts additional properties from given graphql arguments

func (*Provider) ExtractSearchParams

func (p *Provider) ExtractSearchParams(arguments map[string]interface{}, className string) (map[string]interface{}, map[string]*dto.TargetCombination)

ExtractSearchParams extracts GraphQL arguments

func (*Provider) GetAdditionalFields

func (p *Provider) GetAdditionalFields(class *models.Class) map[string]*graphql.Field

GetAdditionalFields provides GraphQL Get additional fields

func (*Provider) GetAll

func (p *Provider) GetAll() []modulecapabilities.Module

func (*Provider) GetAllExclude

func (p *Provider) GetAllExclude(module string) []modulecapabilities.Module

func (*Provider) GetAllWithHTTPHandlers added in v1.32.0

func (p *Provider) GetAllWithHTTPHandlers() []modulecapabilities.ModuleWithHTTPHandlers

func (*Provider) GetArguments

func (p *Provider) GetArguments(class *models.Class) map[string]*graphql.ArgumentConfig

GetArguments provides GraphQL Get arguments

func (*Provider) GetByName

func (p *Provider) GetByName(name string) modulecapabilities.Module

func (*Provider) GetClassificationFn

func (p *Provider) GetClassificationFn(className, name string,
	params modulecapabilities.ClassifyParams,
) (modulecapabilities.ClassifyItemFn, error)

GetClassificationFn returns given module's classification

func (*Provider) GetExploreAdditionalExtend

func (p *Provider) GetExploreAdditionalExtend(ctx context.Context, in []search.Result,
	moduleParams map[string]interface{}, searchVector models.Vector,
	argumentModuleParams map[string]interface{},
) ([]search.Result, error)

GetExploreAdditionalExtend extends graphql api get queries with additional properties

func (*Provider) GetMeta

func (p *Provider) GetMeta() (map[string]interface{}, error)

GetMeta returns meta information about modules

func (*Provider) GetObjectAdditionalExtend

func (p *Provider) GetObjectAdditionalExtend(ctx context.Context,
	in *search.Result, moduleParams map[string]interface{},
) (*search.Result, error)

GetObjectAdditionalExtend extends rest api get queries with additional properties

func (*Provider) GraphQLAdditionalFieldNames

func (p *Provider) GraphQLAdditionalFieldNames() []string

GraphQLAdditionalFieldNames get's all additional field names used in graphql

func (*Provider) HasMultipleVectorizers

func (p *Provider) HasMultipleVectorizers() bool

func (*Provider) Init

func (*Provider) IsGenerative added in v1.25.23

func (p *Provider) IsGenerative(modName string) bool

func (*Provider) IsMultiVector added in v1.29.0

func (p *Provider) IsMultiVector(modName string) bool

func (*Provider) IsReranker added in v1.25.23

func (p *Provider) IsReranker(modName string) bool

func (*Provider) IsTargetVectorMultiVector added in v1.29.0

func (p *Provider) IsTargetVectorMultiVector(className, targetVector string) (bool, error)

func (*Provider) ListExploreAdditionalExtend

func (p *Provider) ListExploreAdditionalExtend(ctx context.Context, in []search.Result, moduleParams map[string]interface{}, argumentModuleParams map[string]interface{}) ([]search.Result, error)

ListExploreAdditionalExtend extends graphql api list queries with additional properties

func (*Provider) ListObjectsAdditionalExtend

func (p *Provider) ListObjectsAdditionalExtend(ctx context.Context,
	in search.Results, moduleParams map[string]interface{},
) (search.Results, error)

ListObjectsAdditionalExtend extends rest api list queries with additional properties

func (*Provider) MigrateVectorizerSettings added in v1.33.12

func (p *Provider) MigrateVectorizerSettings(oldVectorizerConfig, newVectorizerConfig any) bool

MigrateVectorizerSettings compares and migrates module settings if module settings changed, an example would be renaming of baseUrl property setting to baseURL in that case we need to migrate baseURL value to new property name.

func (*Provider) MultiCrossClassVectorFromSearchParam added in v1.28.0

func (p *Provider) MultiCrossClassVectorFromSearchParam(ctx context.Context,
	param string, params interface{},
	findVectorFn modulecapabilities.FindVectorFn[[][]float32],
) ([][]float32, string, error)

MultiCrossClassVectorFromSearchParam gets a multi vector for a given argument without being specific to any one class and it's configuration. This is used in Explore() { } for example

func (*Provider) MultiVectorFromInput added in v1.28.0

func (p *Provider) MultiVectorFromInput(ctx context.Context,
	className, input, targetVector string,
) ([][]float32, error)

func (*Provider) MultiVectorFromSearchParam added in v1.28.0

func (p *Provider) MultiVectorFromSearchParam(ctx context.Context, className, targetVector, tenant, param string, params interface{},
	findVectorFn modulecapabilities.FindVectorFn[[][]float32],
) ([][]float32, error)

MultiVectorFromSearchParam gets a multi vector for a given argument. This is used in Get { Class() } for example

func (*Provider) OffloadBackend added in v1.26.0

func (p *Provider) OffloadBackend(backend string) (modulecapabilities.OffloadCloud, bool)

func (*Provider) ParseClassifierSettings

func (p *Provider) ParseClassifierSettings(name string,
	params *models.Classification,
) error

ParseClassifierSettings parses and adds classifier specific settings

func (*Provider) Register

func (p *Provider) Register(mod modulecapabilities.Module)

func (*Provider) RestApiAdditionalProperties

func (p *Provider) RestApiAdditionalProperties(includeProp string, class *models.Class) map[string]interface{}

RestApiAdditionalProperties get's all rest specific additional properties with their default values

func (*Provider) SetClassDefaults

func (p *Provider) SetClassDefaults(class *models.Class)

SetClassDefaults sets the module-specific defaults for the class itself, but also for each prop

func (*Provider) SetSchemaGetter

func (p *Provider) SetSchemaGetter(sg schemaGetter)

func (*Provider) SetSinglePropertyDefaults

func (p *Provider) SetSinglePropertyDefaults(class *models.Class,
	props ...*models.Property,
)

SetSinglePropertyDefaults can be used when a property is added later, e.g. as part of merging in a ref prop after a class has already been created

func (*Provider) TargetsFromSearchParam added in v1.26.0

func (p *Provider) TargetsFromSearchParam(className string, params interface{}) ([]string, error)

func (*Provider) UpdateVector

func (p *Provider) UpdateVector(ctx context.Context, object *models.Object, class *models.Class,
	findObjectFn modulecapabilities.FindObjectFn,
	logger logrus.FieldLogger,
) error

func (*Provider) UsageEnabled added in v1.32.0

func (p *Provider) UsageEnabled() bool

func (*Provider) UsingRef2Vec

func (p *Provider) UsingRef2Vec(className string) bool

func (*Provider) ValidateClass

func (p *Provider) ValidateClass(ctx context.Context, class *models.Class) error

func (*Provider) ValidateSearchParam

func (p *Provider) ValidateSearchParam(name string, value interface{}, className string) error

ValidateSearchParam validates module parameters

func (*Provider) ValidateVectorizer

func (p *Provider) ValidateVectorizer(moduleName string) error

func (*Provider) VectorFromInput

func (p *Provider) VectorFromInput(ctx context.Context,
	className, input, targetVector string,
) ([]float32, error)

func (*Provider) VectorFromSearchParam

func (p *Provider) VectorFromSearchParam(ctx context.Context, className, targetVector, tenant, param string, params interface{},
	findVectorFn modulecapabilities.FindVectorFn[[]float32],
) ([]float32, error)

VectorFromSearchParam gets a vector for a given argument. This is used in Get { Class() } for example

func (*Provider) VectorizerName

func (p *Provider) VectorizerName(className string) (string, error)

Jump to

Keyboard shortcuts

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