modulecapabilities

package
v1.38.20 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdditionalGenerativeProperties added in v1.26.0

type AdditionalGenerativeProperties interface {
	AdditionalGenerativeProperties() map[string]GenerativeProperty
}

AdditionalGenerativeProperties groups whole interface methods needed for adding the capability of additional generative properties

type AdditionalProperties

type AdditionalProperties interface {
	AdditionalProperties() map[string]AdditionalProperty
}

AdditionalProperties groups whole interface methods needed for adding the capability of additional properties

type AdditionalProperty

type AdditionalProperty struct {
	RestNames              []string
	DefaultValue           any
	GraphQLNames           []string
	GraphQLFieldFunction   GraphQLFieldFn
	GraphQLExtractFunction ExtractAdditionalFn
	SearchFunctions        AdditionalSearch
}

AdditionalProperty defines all the needed settings / methods to be set in order to add the additional property to Weaviate

type AdditionalPropertyFn

type AdditionalPropertyFn = func(ctx context.Context,
	in []search.Result, params any, limit *int,
	argumentModuleParams map[string]any, cfg moduletools.ClassConfig) ([]search.Result, error)

AdditionalPropertyFn defines interface for additional property functions performing given logic

type AdditionalPropertyWithSearchVector

type AdditionalPropertyWithSearchVector[T dto.Embedding] interface {
	SetSearchVector(vector T)
}

AdditionalPropertyWithSearchVector defines additional property params with the ability to pass search vector

type AdditionalSearch

type AdditionalSearch struct {
	ObjectGet   AdditionalPropertyFn
	ObjectList  AdditionalPropertyFn
	ExploreGet  AdditionalPropertyFn
	ExploreList AdditionalPropertyFn
}

AdditionalSearch defines on which type of query a given additional logic can be performed

type AggregateArgumentsFn

type AggregateArgumentsFn = func(classname string) *graphql.ArgumentConfig

AggregateArgumentsFn generates aggregate graphql config for a given classname

type BackendUseCase added in v1.37.0

type BackendUseCase int

BackendUseCase distinguishes callers so a module can return a differently-configured backend for backup vs export.

const (
	BackendUseCaseBackup BackendUseCase = iota
	BackendUseCaseExport
)

type BackupBackend

type BackupBackend interface {
	// IsExternal returns whether the storage is an external storage (e.g. gcs, s3)
	IsExternal() bool
	// Name returns backend's name
	Name() string
	// HomeDir is the base storage location of all backup files, which can be a bucket, a directory, etc.
	HomeDir(backupID, overrideBucket, overridePath string) string

	// GetObject giving backupID and key
	GetObject(ctx context.Context, backupID, key, overrideBucket, overridePath string) ([]byte, error)
	// AllBackups returns the top level metadata for all attempted backups
	AllBackups(ctx context.Context) ([]*backup.DistributedBackupDescriptor, error)

	// SourceDataPath is data path of all source files
	SourceDataPath() string

	// PutObject writes bytes to the object with key `key`
	// bucketName and bucketPath override the initialised bucketName and bucketPath
	PutObject(ctx context.Context, backupID, key, overrideBucket, overridePath string, byes []byte) error

	// Initialize initializes backup provider and make sure that app have access rights to write into the object store.
	Initialize(ctx context.Context, backupID, overrideBucket, overridePath string) error

	// Write writes the content of the reader to the object with key
	// bucketName and bucketPath override the initialised bucketName and bucketPath
	// Allows restores from a different bucket to the designated backup bucket
	Write(ctx context.Context, backupID, key, overrideBucket, overridePath string, r backup.ReadCloserWithError) (int64, error)
	Read(ctx context.Context, backupID, key, overrideBucket, overridePath string, w io.WriteCloser) (int64, error)
}

type ClassConfigurator

type ClassConfigurator interface {
	// ClassDefaults provides the defaults for a per-class module config. The
	// module provider will merge the props into the user-specified config with
	// the user-provided values taking precedence
	ClassConfigDefaults() map[string]any

	// PropertyConfigDefaults provides the defaults for a per-property module
	// config. The module provider will merge the props into the user-specified
	// config with the user-provided values taking precedence. The property's
	// dataType MAY be taken into consideration when deciding defaults.
	// dataType is not guaranteed to be non-nil, it might be nil in the case a
	// user specified an invalid dataType, as some validation only occurs after
	// defaults are set.
	PropertyConfigDefaults(dataType *schema.DataType) map[string]any

	// ValidateClass MAY validate anything about the class, except the config of
	// another module. The specified ClassConfig can be used to easily retrieve
	// the config specific for the module. For example, a module could iterate
	// over class.Properties and call classConfig.Property(prop.Name) to validate
	// the per-property config. A module MUST NOT extract another module's config
	// from class.ModuleConfig["other-modules-name"].
	ValidateClass(ctx context.Context, class *models.Class,
		classConfig moduletools.ClassConfig) error
}

ClassConfigurator is an optional capability interface which a module MAY implement. If it is implemented, all methods will be called when the user adds or updates a class which has the module set as the vectorizer

type ClassificationProvider

type ClassificationProvider interface {
	Classifiers() []Classifier
}

type Classifier

type Classifier interface {
	Name() string
	ClassifyFn(params ClassifyParams) (ClassifyItemFn, error)
	ParseClassifierSettings(params *models.Classification) error
}

type ClassifyItemFn

type ClassifyItemFn func(item search.Result, itemIndex int,
	params models.Classification, filters Filters, writer Writer) error

type ClassifyParams

type ClassifyParams struct {
	GetClass          func(string) *models.Class
	Params            models.Classification
	Filters           Filters
	UnclassifiedItems []search.Result
	VectorRepo        VectorClassSearchRepo
}

type Client

type Client interface {
	Vectorizers() map[string]VectorizerClient
}

type Dependency

type Dependency[T dto.Embedding] interface {
	ModuleName() string
	Argument() string
	GraphQLArgument() GraphQLArgument
	VectorSearch() VectorForParams[T]
}

type DependencySearcher

type DependencySearcher[T dto.Embedding] interface {
	VectorSearches() map[string]map[string]VectorForParams[T]
}

DependencySearcher defines all of the available searches loaded as a dependency for this time it's limited to modules providing []float32 embeddings

type ExploreArgumentsFn

type ExploreArgumentsFn = func() *graphql.ArgumentConfig

ExploreArgumentsFn generates explore graphql config

type ExportBackendProvider added in v1.37.0

type ExportBackendProvider interface {
	ExportBackend() BackupBackend
}

ExportBackendProvider is optionally implemented by backup modules that provide a separate BackupBackend for export operations (e.g., with different STS credentials for cross-account access).

type ExtractAdditionalFn

type ExtractAdditionalFn = func(param []*ast.Argument, class *models.Class) any

ExtractAdditionalFn extracts parameters from graphql queries

type ExtractFn

type ExtractFn = func(param map[string]any) (any, *dto.TargetCombination, error)

ExtractFn extracts graphql params to given struct implementation

type ExtractRequestParamsFn added in v1.26.0

type ExtractRequestParamsFn = func(field *ast.ObjectField) any

ExtractRequestParamsFn extracts specific generative API parameters from graphql queries

type Filters

type Filters interface {
	Source() *filters.LocalFilter
	Target() *filters.LocalFilter
	TrainingSet() *filters.LocalFilter
}

type FindObjectFn

type FindObjectFn = func(ctx context.Context, class string, id strfmt.UUID,
	props search.SelectProperties, adds additional.Properties, tenant string) (*search.Result, error)

type FindVectorFn

type FindVectorFn[T dto.Embedding] = func(ctx context.Context,
	className string, id strfmt.UUID, tenant, targetVector string) (T, string, error)

FindVectorFn method for getting a vector of given object by its ID

type GenerateDebugInformation added in v1.26.0

type GenerateDebugInformation struct {
	Prompt string
}

GenerateDebugInformation exposes debug information

type GenerateProperties added in v1.27.14

type GenerateProperties struct {
	Text map[string]string
	Blob map[string]*string
}

GenerateProperties defines the properties to be supplied as part of the generative request. They must be differentiated at this point due to the different ways third-parties handle them.

type GenerateResponse added in v1.26.0

type GenerateResponse struct {
	Result *string
	Params map[string]any
	Debug  *GenerateDebugInformation
}

GenerateResponse defines generative response. Params files hold module specific response parameters

type GenerativeClient added in v1.26.0

type GenerativeClient interface {
	GenerateSingleResult(ctx context.Context,
		properties *GenerateProperties, prompt string, requestParams any, debug bool, cfg moduletools.ClassConfig,
	) (*GenerateResponse, error)
	GenerateAllResults(ctx context.Context,
		properties []*GenerateProperties, task string, requestParams any, debug bool, cfg moduletools.ClassConfig,
	) (*GenerateResponse, error)
}

GenerativeClient defines generative client

type GenerativeProperty added in v1.26.0

type GenerativeProperty struct {
	Client                       GenerativeClient
	RequestParamsFunction        GraphQLInputFieldFn
	ResponseParamsFunction       GraphQLFieldFn
	ExtractRequestParamsFunction ExtractRequestParamsFn
}

GenerativeProperty defines all needed additional request / response parameters only client setting is manadatory as we can have generative modules that don't expose any additional request / response params.

type GetArgumentsFn

type GetArgumentsFn = func(classname string) *graphql.ArgumentConfig

GetArgumentsFn generates get graphql config for a given classname

type GraphQLArgument

type GraphQLArgument struct {
	GetArgumentsFunction       GetArgumentsFn
	AggregateArgumentsFunction AggregateArgumentsFn
	ExploreArgumentsFunction   ExploreArgumentsFn
	ExtractFunction            ExtractFn
	ValidateFunction           ValidateFn
}

GraphQLArgument defines all the needed settings / methods to add a module specific graphql argument

type GraphQLArguments

type GraphQLArguments interface {
	Arguments() map[string]GraphQLArgument
}

GraphQLArguments defines the capabilities of modules to add their arguments to graphql API

type GraphQLFieldFn

type GraphQLFieldFn = func(classname string) *graphql.Field

GraphQLFieldFn generates graphql field based on classname

type GraphQLInputFieldFn added in v1.26.0

type GraphQLInputFieldFn = func(classname string) *graphql.InputObjectFieldConfig

GraphQLFieldFn generates graphql input fields

type InputVectorizer

type InputVectorizer[T dto.Embedding] interface {
	VectorizeInput(ctx context.Context, input string,
		cfg moduletools.ClassConfig) (T, error)
}

type MetaProvider

type MetaProvider interface {
	MetaInfo() (map[string]any, error)
}

type MigrateProperties added in v1.33.12

type MigrateProperties interface {
	MigrateProperties() []MigrateProperty
}

MigrateProperties interface enables module settings property names to be migrated from old names to new names.

type MigrateProperty added in v1.33.12

type MigrateProperty struct {
	Name, NewName string
	IsDeleted     bool
}

MigrateProperty defines module settings property name migration. Example #1: { Name: "baseUrl", NewName: "baseURL" } This definition means that if a class config contains a property with an old name, then it's value will be assigned to new name and the old name will be removed for class's config. Example #2: { Name: "baseURL" } This definition means that a new property with name baseURL was added to configuration and we need to add it to config Example #3: { Name: "baseURL", IsDeleted: true } This definition means that a property with name baseURL was deleted from default configuration and we need to remove it

type MockBackupBackend added in v1.28.13

type MockBackupBackend struct {
	mock.Mock
}

MockBackupBackend is an autogenerated mock type for the BackupBackend type

func NewMockBackupBackend added in v1.28.13

func NewMockBackupBackend(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockBackupBackend

NewMockBackupBackend creates a new instance of MockBackupBackend. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockBackupBackend) AllBackups added in v1.28.13

AllBackups provides a mock function with given fields: ctx

func (*MockBackupBackend) EXPECT added in v1.28.13

func (*MockBackupBackend) GetObject added in v1.28.13

func (_m *MockBackupBackend) GetObject(ctx context.Context, backupID string, key string, overrideBucket string, overridePath string) ([]byte, error)

GetObject provides a mock function with given fields: ctx, backupID, key, overrideBucket, overridePath

func (*MockBackupBackend) HomeDir added in v1.28.13

func (_m *MockBackupBackend) HomeDir(backupID string, overrideBucket string, overridePath string) string

HomeDir provides a mock function with given fields: backupID, overrideBucket, overridePath

func (*MockBackupBackend) Initialize added in v1.28.13

func (_m *MockBackupBackend) Initialize(ctx context.Context, backupID string, overrideBucket string, overridePath string) error

Initialize provides a mock function with given fields: ctx, backupID, overrideBucket, overridePath

func (*MockBackupBackend) IsExternal added in v1.28.13

func (_m *MockBackupBackend) IsExternal() bool

IsExternal provides a mock function with no fields

func (*MockBackupBackend) Name added in v1.28.13

func (_m *MockBackupBackend) Name() string

Name provides a mock function with no fields

func (*MockBackupBackend) PutObject added in v1.28.13

func (_m *MockBackupBackend) PutObject(ctx context.Context, backupID string, key string, overrideBucket string, overridePath string, byes []byte) error

PutObject provides a mock function with given fields: ctx, backupID, key, overrideBucket, overridePath, byes

func (*MockBackupBackend) Read added in v1.28.13

func (_m *MockBackupBackend) Read(ctx context.Context, backupID string, key string, overrideBucket string, overridePath string, w io.WriteCloser) (int64, error)

Read provides a mock function with given fields: ctx, backupID, key, overrideBucket, overridePath, w

func (*MockBackupBackend) SourceDataPath added in v1.28.13

func (_m *MockBackupBackend) SourceDataPath() string

SourceDataPath provides a mock function with no fields

func (*MockBackupBackend) Write added in v1.28.13

func (_m *MockBackupBackend) Write(ctx context.Context, backupID string, key string, overrideBucket string, overridePath string, r backup.ReadCloserWithError) (int64, error)

Write provides a mock function with given fields: ctx, backupID, key, overrideBucket, overridePath, r

type MockBackupBackend_AllBackups_Call added in v1.28.13

type MockBackupBackend_AllBackups_Call struct {
	*mock.Call
}

MockBackupBackend_AllBackups_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AllBackups'

func (*MockBackupBackend_AllBackups_Call) Return added in v1.28.13

func (*MockBackupBackend_AllBackups_Call) Run added in v1.28.13

func (*MockBackupBackend_AllBackups_Call) RunAndReturn added in v1.28.13

type MockBackupBackend_Expecter added in v1.28.13

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

func (*MockBackupBackend_Expecter) AllBackups added in v1.28.13

func (_e *MockBackupBackend_Expecter) AllBackups(ctx interface{}) *MockBackupBackend_AllBackups_Call

AllBackups is a helper method to define mock.On call

  • ctx context.Context

func (*MockBackupBackend_Expecter) GetObject added in v1.28.13

func (_e *MockBackupBackend_Expecter) GetObject(ctx interface{}, backupID interface{}, key interface{}, overrideBucket interface{}, overridePath interface{}) *MockBackupBackend_GetObject_Call

GetObject is a helper method to define mock.On call

  • ctx context.Context
  • backupID string
  • key string
  • overrideBucket string
  • overridePath string

func (*MockBackupBackend_Expecter) HomeDir added in v1.28.13

func (_e *MockBackupBackend_Expecter) HomeDir(backupID interface{}, overrideBucket interface{}, overridePath interface{}) *MockBackupBackend_HomeDir_Call

HomeDir is a helper method to define mock.On call

  • backupID string
  • overrideBucket string
  • overridePath string

func (*MockBackupBackend_Expecter) Initialize added in v1.28.13

func (_e *MockBackupBackend_Expecter) Initialize(ctx interface{}, backupID interface{}, overrideBucket interface{}, overridePath interface{}) *MockBackupBackend_Initialize_Call

Initialize is a helper method to define mock.On call

  • ctx context.Context
  • backupID string
  • overrideBucket string
  • overridePath string

func (*MockBackupBackend_Expecter) IsExternal added in v1.28.13

IsExternal is a helper method to define mock.On call

func (*MockBackupBackend_Expecter) Name added in v1.28.13

Name is a helper method to define mock.On call

func (*MockBackupBackend_Expecter) PutObject added in v1.28.13

func (_e *MockBackupBackend_Expecter) PutObject(ctx interface{}, backupID interface{}, key interface{}, overrideBucket interface{}, overridePath interface{}, byes interface{}) *MockBackupBackend_PutObject_Call

PutObject is a helper method to define mock.On call

  • ctx context.Context
  • backupID string
  • key string
  • overrideBucket string
  • overridePath string
  • byes []byte

func (*MockBackupBackend_Expecter) Read added in v1.28.13

func (_e *MockBackupBackend_Expecter) Read(ctx interface{}, backupID interface{}, key interface{}, overrideBucket interface{}, overridePath interface{}, w interface{}) *MockBackupBackend_Read_Call

Read is a helper method to define mock.On call

  • ctx context.Context
  • backupID string
  • key string
  • overrideBucket string
  • overridePath string
  • w io.WriteCloser

func (*MockBackupBackend_Expecter) SourceDataPath added in v1.28.13

SourceDataPath is a helper method to define mock.On call

func (*MockBackupBackend_Expecter) Write added in v1.28.13

func (_e *MockBackupBackend_Expecter) Write(ctx interface{}, backupID interface{}, key interface{}, overrideBucket interface{}, overridePath interface{}, r interface{}) *MockBackupBackend_Write_Call

Write is a helper method to define mock.On call

  • ctx context.Context
  • backupID string
  • key string
  • overrideBucket string
  • overridePath string
  • r backup.ReadCloserWithError

type MockBackupBackend_GetObject_Call added in v1.28.13

type MockBackupBackend_GetObject_Call struct {
	*mock.Call
}

MockBackupBackend_GetObject_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetObject'

func (*MockBackupBackend_GetObject_Call) Return added in v1.28.13

func (*MockBackupBackend_GetObject_Call) Run added in v1.28.13

func (_c *MockBackupBackend_GetObject_Call) Run(run func(ctx context.Context, backupID string, key string, overrideBucket string, overridePath string)) *MockBackupBackend_GetObject_Call

func (*MockBackupBackend_GetObject_Call) RunAndReturn added in v1.28.13

type MockBackupBackend_HomeDir_Call added in v1.28.13

type MockBackupBackend_HomeDir_Call struct {
	*mock.Call
}

MockBackupBackend_HomeDir_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HomeDir'

func (*MockBackupBackend_HomeDir_Call) Return added in v1.28.13

func (*MockBackupBackend_HomeDir_Call) Run added in v1.28.13

func (_c *MockBackupBackend_HomeDir_Call) Run(run func(backupID string, overrideBucket string, overridePath string)) *MockBackupBackend_HomeDir_Call

func (*MockBackupBackend_HomeDir_Call) RunAndReturn added in v1.28.13

type MockBackupBackend_Initialize_Call added in v1.28.13

type MockBackupBackend_Initialize_Call struct {
	*mock.Call
}

MockBackupBackend_Initialize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Initialize'

func (*MockBackupBackend_Initialize_Call) Return added in v1.28.13

func (*MockBackupBackend_Initialize_Call) Run added in v1.28.13

func (_c *MockBackupBackend_Initialize_Call) Run(run func(ctx context.Context, backupID string, overrideBucket string, overridePath string)) *MockBackupBackend_Initialize_Call

func (*MockBackupBackend_Initialize_Call) RunAndReturn added in v1.28.13

type MockBackupBackend_IsExternal_Call added in v1.28.13

type MockBackupBackend_IsExternal_Call struct {
	*mock.Call
}

MockBackupBackend_IsExternal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsExternal'

func (*MockBackupBackend_IsExternal_Call) Return added in v1.28.13

func (*MockBackupBackend_IsExternal_Call) Run added in v1.28.13

func (*MockBackupBackend_IsExternal_Call) RunAndReturn added in v1.28.13

type MockBackupBackend_Name_Call added in v1.28.13

type MockBackupBackend_Name_Call struct {
	*mock.Call
}

MockBackupBackend_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name'

func (*MockBackupBackend_Name_Call) Return added in v1.28.13

func (*MockBackupBackend_Name_Call) Run added in v1.28.13

func (*MockBackupBackend_Name_Call) RunAndReturn added in v1.28.13

func (_c *MockBackupBackend_Name_Call) RunAndReturn(run func() string) *MockBackupBackend_Name_Call

type MockBackupBackend_PutObject_Call added in v1.28.13

type MockBackupBackend_PutObject_Call struct {
	*mock.Call
}

MockBackupBackend_PutObject_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PutObject'

func (*MockBackupBackend_PutObject_Call) Return added in v1.28.13

func (*MockBackupBackend_PutObject_Call) Run added in v1.28.13

func (_c *MockBackupBackend_PutObject_Call) Run(run func(ctx context.Context, backupID string, key string, overrideBucket string, overridePath string, byes []byte)) *MockBackupBackend_PutObject_Call

func (*MockBackupBackend_PutObject_Call) RunAndReturn added in v1.28.13

type MockBackupBackend_Read_Call added in v1.28.13

type MockBackupBackend_Read_Call struct {
	*mock.Call
}

MockBackupBackend_Read_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Read'

func (*MockBackupBackend_Read_Call) Return added in v1.28.13

func (*MockBackupBackend_Read_Call) Run added in v1.28.13

func (_c *MockBackupBackend_Read_Call) Run(run func(ctx context.Context, backupID string, key string, overrideBucket string, overridePath string, w io.WriteCloser)) *MockBackupBackend_Read_Call

func (*MockBackupBackend_Read_Call) RunAndReturn added in v1.28.13

type MockBackupBackend_SourceDataPath_Call added in v1.28.13

type MockBackupBackend_SourceDataPath_Call struct {
	*mock.Call
}

MockBackupBackend_SourceDataPath_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SourceDataPath'

func (*MockBackupBackend_SourceDataPath_Call) Return added in v1.28.13

func (*MockBackupBackend_SourceDataPath_Call) Run added in v1.28.13

func (*MockBackupBackend_SourceDataPath_Call) RunAndReturn added in v1.28.13

type MockBackupBackend_Write_Call added in v1.28.13

type MockBackupBackend_Write_Call struct {
	*mock.Call
}

MockBackupBackend_Write_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Write'

func (*MockBackupBackend_Write_Call) Return added in v1.28.13

func (*MockBackupBackend_Write_Call) Run added in v1.28.13

func (_c *MockBackupBackend_Write_Call) Run(run func(ctx context.Context, backupID string, key string, overrideBucket string, overridePath string, r backup.ReadCloserWithError)) *MockBackupBackend_Write_Call

func (*MockBackupBackend_Write_Call) RunAndReturn added in v1.28.13

type Module

type Module interface {
	Name() string
	Init(ctx context.Context, params moduletools.ModuleInitParams) error
	Type() ModuleType
}

type ModuleDependency

type ModuleDependency interface {
	Module
	InitDependency(modules []Module) error
}

type ModuleExtension

type ModuleExtension interface {
	Module
	InitExtension(modules []Module) error
}

type ModuleHasAltNames

type ModuleHasAltNames interface {
	AltNames() []string
}

type ModuleType

type ModuleType string
const (
	Offload             ModuleType = "Offload"
	Backup              ModuleType = "Backup"
	Extension           ModuleType = "Extension"
	Img2Vec             ModuleType = "Img2Vec"
	Multi2Vec           ModuleType = "Multi2Vec"
	Multi2Multivec      ModuleType = "Multi2Multivec"
	Ref2Vec             ModuleType = "Ref2Vec"
	Text2ManyVec        ModuleType = "Text2ManyVec"
	Text2Multivec       ModuleType = "Text2Multivec"
	Text2TextGenerative ModuleType = "Text2TextGenerative"
	Text2TextSummarize  ModuleType = "Text2TextSummarize"
	Text2TextReranker   ModuleType = "Text2TextReranker"
	Text2TextNER        ModuleType = "Text2TextNER"
	Text2TextQnA        ModuleType = "Text2TextQnA"
	Text2Vec            ModuleType = "Text2Vec"
	Usage               ModuleType = "Usage"
)

type ModuleWithClose added in v1.32.0

type ModuleWithClose interface {
	Module
	Close() error
}

ModuleWithClose is an optional capability interface for modules that need to be closed

type ModuleWithUsageService added in v1.32.0

type ModuleWithUsageService interface {
	Module
	Logger() logrus.FieldLogger
	SetUsageService(usageService any) // Using interface{} to avoid circular dependency
}

ModuleWithUsageService is an optional capability interface for modules that need a usage service

type MutableSettings

type MutableSettings interface {
	MutableSettings(current, updated moduletools.ClassConfig) bool
}

MutableSettings is an optional capability: a module implementing it may allow settings changes on an existing collection, otherwise every change is rejected. It runs on Raft apply on every node, so the result must depend only on current and updated, which hold just this module's settings.

type NearParam

type NearParam interface {
	GetCertainty() float64
	GetDistance() float64
	GetTargetVectors() []string
	SimilarityMetricProvided() bool
}

NearParam defines params with certainty information

type OffloadCloud added in v1.26.0

type OffloadCloud interface {
	// VerifyBucket verify if the offload bucket is created
	VerifyBucket(ctx context.Context) error
	// Upload uploads the content of a shard assigned to specific node to
	// cloud provider (S3, Azure Blob storage, Google cloud storage)
	// {cloud_provider}://{configured_bucket}/{className}/{shardName}/{nodeName}/{shard content}
	Upload(ctx context.Context, className, shardName, nodeName string) error
	// Download downloads the content of a shard to desired node from
	// cloud provider (S3, Azure Blob storage, Google cloud storage)
	// {dataPath}/{className}/{shardName}/{content}
	Download(ctx context.Context, className, shardName, nodeName string) error
	// Delete deletes content of a shard assigned to specific node in
	// cloud provider (S3, Azure Blob storage, Google cloud storage)
	// Careful: if shardName and nodeName is passed empty it will delete all class frozen shards in cloud storage
	// {cloud_provider}://{configured_bucket}/{className}/{shardName}/{nodeName}/{shard content}
	Delete(ctx context.Context, className, shardName, nodeName string) error
}

type ReferenceVectorizer

type ReferenceVectorizer[T dto.Embedding] interface {
	// VectorizeObject should mutate the object which is passed in as a pointer-type
	// by extending it with the desired vector, which is calculated by the module
	VectorizeObject(ctx context.Context, object *models.Object,
		cfg moduletools.ClassConfig, findObjectFn FindObjectFn) (T, error)
}

ReferenceVectorizer is implemented by ref2vec modules, which calculate a target object's vector based only on the vectors of its references. If the object has no references, the object will have a nil vector

type Searcher

type Searcher[T dto.Embedding] interface {
	VectorSearches() map[string]VectorForParams[T]
}

Searcher defines all methods for all searchers for getting a vector from a given raw searcher content

type TextTransform

type TextTransform interface {
	Transform(in []string) ([]string, error)
}

TextTransform performs text transformation operation

type TextTransformers

type TextTransformers interface {
	TextTransformers() map[string]TextTransform
}

TextTransformers defines all text transformers for given arguments

type ValidateFn

type ValidateFn = func(param any) error

ValidateFn validates a given module param

type VectorClassSearchParams

type VectorClassSearchParams struct {
	Filters    *filters.LocalFilter
	Pagination *filters.Pagination
	ClassName  string
	Properties []string
}

type VectorClassSearchRepo

type VectorClassSearchRepo interface {
	VectorClassSearch(ctx context.Context, params VectorClassSearchParams) ([]search.Result, error)
}

type VectorForParams

type VectorForParams[T dto.Embedding] = func(ctx context.Context, params any,
	className string, findVectorFn FindVectorFn[T], cfg moduletools.ClassConfig) (T, error)

VectorForParams defines method for passing a raw searcher content to the module and exchanging it for a vector. Warning: Argument "cfg" (moduletools.ClassConfig) is not guaranteed to be non-nil. Implementations have to provide a nil check before using it. It is generally present on class-based action, but is not present on Cross-Class requests, such as Explore {}

type Vectorizer

type Vectorizer[T dto.Embedding] interface {
	// VectorizeObject takes an object and returns a vector and - if applicable - any meta
	// information as part of _additional properties
	VectorizeObject(ctx context.Context, obj *models.Object,
		cfg moduletools.ClassConfig) (T, models.AdditionalProperties, error)
	// VectorizableProperties returns which properties the vectorizer looks at.
	// If the vectorizer is capable of vectorizing all text properties, the first bool is true.
	// Any additional "media"-properties are explicitly mentioned in the []string return
	VectorizableProperties(cfg moduletools.ClassConfig) (bool, []string, error)
	VectorizeBatch(ctx context.Context, objs []*models.Object, skipObject []bool, cfg moduletools.ClassConfig) ([]T, []models.AdditionalProperties, map[int]error)
}

type VectorizerClient

type VectorizerClient interface {
	MultiVectorForWord(ctx context.Context,
		words []string) ([][]float32, error)
	VectorOnlyForCorpi(ctx context.Context, corpi []string,
		overrides map[string]string) ([]float32, error)
}

type Writer

type Writer interface {
	Start()
	Store(item search.Result) error
	Stop() WriterResults
}

type WriterResults

type WriterResults interface {
	SuccessCount() int64
	ErrorCount() int64
	Err() error
}

Jump to

Keyboard shortcuts

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