Documentation
¶
Index ¶
- type AdditionalGenerativeProperties
- type AdditionalProperties
- type AdditionalProperty
- type AdditionalPropertyFn
- type AdditionalPropertyWithSearchVector
- type AdditionalSearch
- type AggregateArgumentsFn
- type BackendUseCase
- type BackupBackend
- type ClassConfigurator
- type ClassificationProvider
- type Classifier
- type ClassifyItemFn
- type ClassifyParams
- type Client
- type Dependency
- type DependencySearcher
- type ExploreArgumentsFn
- type ExportBackendProvider
- type ExtractAdditionalFn
- type ExtractFn
- type ExtractRequestParamsFn
- type Filters
- type FindObjectFn
- type FindVectorFn
- type GenerateDebugInformation
- type GenerateProperties
- type GenerateResponse
- type GenerativeClient
- type GenerativeProperty
- type GetArgumentsFn
- type GraphQLArgument
- type GraphQLArguments
- type GraphQLFieldFn
- type GraphQLInputFieldFn
- type InputVectorizer
- type MetaProvider
- type MigrateProperties
- type MigrateProperty
- type MockBackupBackend
- func (_m *MockBackupBackend) AllBackups(ctx context.Context) ([]*backup.DistributedBackupDescriptor, error)
- func (_m *MockBackupBackend) EXPECT() *MockBackupBackend_Expecter
- func (_m *MockBackupBackend) GetObject(ctx context.Context, backupID string, key string, overrideBucket string, ...) ([]byte, error)
- func (_m *MockBackupBackend) HomeDir(backupID string, overrideBucket string, overridePath string) string
- func (_m *MockBackupBackend) Initialize(ctx context.Context, backupID string, overrideBucket string, ...) error
- func (_m *MockBackupBackend) IsExternal() bool
- func (_m *MockBackupBackend) Name() string
- func (_m *MockBackupBackend) PutObject(ctx context.Context, backupID string, key string, overrideBucket string, ...) error
- func (_m *MockBackupBackend) Read(ctx context.Context, backupID string, key string, overrideBucket string, ...) (int64, error)
- func (_m *MockBackupBackend) SourceDataPath() string
- func (_m *MockBackupBackend) Write(ctx context.Context, backupID string, key string, overrideBucket string, ...) (int64, error)
- type MockBackupBackend_AllBackups_Call
- func (_c *MockBackupBackend_AllBackups_Call) Return(_a0 []*backup.DistributedBackupDescriptor, _a1 error) *MockBackupBackend_AllBackups_Call
- func (_c *MockBackupBackend_AllBackups_Call) Run(run func(ctx context.Context)) *MockBackupBackend_AllBackups_Call
- func (_c *MockBackupBackend_AllBackups_Call) RunAndReturn(run func(context.Context) ([]*backup.DistributedBackupDescriptor, error)) *MockBackupBackend_AllBackups_Call
- type MockBackupBackend_Expecter
- func (_e *MockBackupBackend_Expecter) AllBackups(ctx interface{}) *MockBackupBackend_AllBackups_Call
- func (_e *MockBackupBackend_Expecter) GetObject(ctx interface{}, backupID interface{}, key interface{}, ...) *MockBackupBackend_GetObject_Call
- func (_e *MockBackupBackend_Expecter) HomeDir(backupID interface{}, overrideBucket interface{}, overridePath interface{}) *MockBackupBackend_HomeDir_Call
- func (_e *MockBackupBackend_Expecter) Initialize(ctx interface{}, backupID interface{}, overrideBucket interface{}, ...) *MockBackupBackend_Initialize_Call
- func (_e *MockBackupBackend_Expecter) IsExternal() *MockBackupBackend_IsExternal_Call
- func (_e *MockBackupBackend_Expecter) Name() *MockBackupBackend_Name_Call
- func (_e *MockBackupBackend_Expecter) PutObject(ctx interface{}, backupID interface{}, key interface{}, ...) *MockBackupBackend_PutObject_Call
- func (_e *MockBackupBackend_Expecter) Read(ctx interface{}, backupID interface{}, key interface{}, ...) *MockBackupBackend_Read_Call
- func (_e *MockBackupBackend_Expecter) SourceDataPath() *MockBackupBackend_SourceDataPath_Call
- func (_e *MockBackupBackend_Expecter) Write(ctx interface{}, backupID interface{}, key interface{}, ...) *MockBackupBackend_Write_Call
- type MockBackupBackend_GetObject_Call
- func (_c *MockBackupBackend_GetObject_Call) Return(_a0 []byte, _a1 error) *MockBackupBackend_GetObject_Call
- func (_c *MockBackupBackend_GetObject_Call) Run(...) *MockBackupBackend_GetObject_Call
- func (_c *MockBackupBackend_GetObject_Call) RunAndReturn(run func(context.Context, string, string, string, string) ([]byte, error)) *MockBackupBackend_GetObject_Call
- type MockBackupBackend_HomeDir_Call
- func (_c *MockBackupBackend_HomeDir_Call) Return(_a0 string) *MockBackupBackend_HomeDir_Call
- func (_c *MockBackupBackend_HomeDir_Call) Run(run func(backupID string, overrideBucket string, overridePath string)) *MockBackupBackend_HomeDir_Call
- func (_c *MockBackupBackend_HomeDir_Call) RunAndReturn(run func(string, string, string) string) *MockBackupBackend_HomeDir_Call
- type MockBackupBackend_Initialize_Call
- func (_c *MockBackupBackend_Initialize_Call) Return(_a0 error) *MockBackupBackend_Initialize_Call
- func (_c *MockBackupBackend_Initialize_Call) Run(run func(ctx context.Context, backupID string, overrideBucket string, ...)) *MockBackupBackend_Initialize_Call
- func (_c *MockBackupBackend_Initialize_Call) RunAndReturn(run func(context.Context, string, string, string) error) *MockBackupBackend_Initialize_Call
- type MockBackupBackend_IsExternal_Call
- func (_c *MockBackupBackend_IsExternal_Call) Return(_a0 bool) *MockBackupBackend_IsExternal_Call
- func (_c *MockBackupBackend_IsExternal_Call) Run(run func()) *MockBackupBackend_IsExternal_Call
- func (_c *MockBackupBackend_IsExternal_Call) RunAndReturn(run func() bool) *MockBackupBackend_IsExternal_Call
- type MockBackupBackend_Name_Call
- type MockBackupBackend_PutObject_Call
- func (_c *MockBackupBackend_PutObject_Call) Return(_a0 error) *MockBackupBackend_PutObject_Call
- func (_c *MockBackupBackend_PutObject_Call) Run(...) *MockBackupBackend_PutObject_Call
- func (_c *MockBackupBackend_PutObject_Call) RunAndReturn(run func(context.Context, string, string, string, string, []byte) error) *MockBackupBackend_PutObject_Call
- type MockBackupBackend_Read_Call
- type MockBackupBackend_SourceDataPath_Call
- func (_c *MockBackupBackend_SourceDataPath_Call) Return(_a0 string) *MockBackupBackend_SourceDataPath_Call
- func (_c *MockBackupBackend_SourceDataPath_Call) Run(run func()) *MockBackupBackend_SourceDataPath_Call
- func (_c *MockBackupBackend_SourceDataPath_Call) RunAndReturn(run func() string) *MockBackupBackend_SourceDataPath_Call
- type MockBackupBackend_Write_Call
- type Module
- type ModuleDependency
- type ModuleExtension
- type ModuleHasAltNames
- type ModuleType
- type ModuleWithClose
- type ModuleWithUsageService
- type MutableSettings
- type NearParam
- type OffloadCloud
- type ReferenceVectorizer
- type Searcher
- type TextTransform
- type TextTransformers
- type ValidateFn
- type VectorClassSearchParams
- type VectorClassSearchRepo
- type VectorForParams
- type Vectorizer
- type VectorizerClient
- type Writer
- type WriterResults
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 ¶
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 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 ¶
ExtractAdditionalFn extracts parameters from graphql queries
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
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 ¶
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 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
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
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
func (_m *MockBackupBackend) AllBackups(ctx context.Context) ([]*backup.DistributedBackupDescriptor, error)
AllBackups provides a mock function with given fields: ctx
func (*MockBackupBackend) EXPECT ¶ added in v1.28.13
func (_m *MockBackupBackend) EXPECT() *MockBackupBackend_Expecter
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
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 (_c *MockBackupBackend_AllBackups_Call) Return(_a0 []*backup.DistributedBackupDescriptor, _a1 error) *MockBackupBackend_AllBackups_Call
func (*MockBackupBackend_AllBackups_Call) Run ¶ added in v1.28.13
func (_c *MockBackupBackend_AllBackups_Call) Run(run func(ctx context.Context)) *MockBackupBackend_AllBackups_Call
func (*MockBackupBackend_AllBackups_Call) RunAndReturn ¶ added in v1.28.13
func (_c *MockBackupBackend_AllBackups_Call) RunAndReturn(run func(context.Context) ([]*backup.DistributedBackupDescriptor, error)) *MockBackupBackend_AllBackups_Call
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
func (_e *MockBackupBackend_Expecter) IsExternal() *MockBackupBackend_IsExternal_Call
IsExternal is a helper method to define mock.On call
func (*MockBackupBackend_Expecter) Name ¶ added in v1.28.13
func (_e *MockBackupBackend_Expecter) Name() *MockBackupBackend_Name_Call
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
func (_e *MockBackupBackend_Expecter) SourceDataPath() *MockBackupBackend_SourceDataPath_Call
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
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 (_c *MockBackupBackend_GetObject_Call) Return(_a0 []byte, _a1 error) *MockBackupBackend_GetObject_Call
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
func (_c *MockBackupBackend_GetObject_Call) RunAndReturn(run func(context.Context, string, string, string, string) ([]byte, error)) *MockBackupBackend_GetObject_Call
type MockBackupBackend_HomeDir_Call ¶ added in v1.28.13
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 (_c *MockBackupBackend_HomeDir_Call) Return(_a0 string) *MockBackupBackend_HomeDir_Call
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
func (_c *MockBackupBackend_HomeDir_Call) RunAndReturn(run func(string, string, string) string) *MockBackupBackend_HomeDir_Call
type MockBackupBackend_Initialize_Call ¶ added in v1.28.13
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 (_c *MockBackupBackend_Initialize_Call) Return(_a0 error) *MockBackupBackend_Initialize_Call
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
func (_c *MockBackupBackend_Initialize_Call) RunAndReturn(run func(context.Context, string, string, string) error) *MockBackupBackend_Initialize_Call
type MockBackupBackend_IsExternal_Call ¶ added in v1.28.13
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 (_c *MockBackupBackend_IsExternal_Call) Return(_a0 bool) *MockBackupBackend_IsExternal_Call
func (*MockBackupBackend_IsExternal_Call) Run ¶ added in v1.28.13
func (_c *MockBackupBackend_IsExternal_Call) Run(run func()) *MockBackupBackend_IsExternal_Call
func (*MockBackupBackend_IsExternal_Call) RunAndReturn ¶ added in v1.28.13
func (_c *MockBackupBackend_IsExternal_Call) RunAndReturn(run func() bool) *MockBackupBackend_IsExternal_Call
type MockBackupBackend_Name_Call ¶ added in v1.28.13
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 (_c *MockBackupBackend_Name_Call) Return(_a0 string) *MockBackupBackend_Name_Call
func (*MockBackupBackend_Name_Call) Run ¶ added in v1.28.13
func (_c *MockBackupBackend_Name_Call) Run(run func()) *MockBackupBackend_Name_Call
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
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 (_c *MockBackupBackend_PutObject_Call) Return(_a0 error) *MockBackupBackend_PutObject_Call
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
func (_c *MockBackupBackend_PutObject_Call) RunAndReturn(run func(context.Context, string, string, string, string, []byte) error) *MockBackupBackend_PutObject_Call
type MockBackupBackend_Read_Call ¶ added in v1.28.13
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 (_c *MockBackupBackend_Read_Call) Return(_a0 int64, _a1 error) *MockBackupBackend_Read_Call
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
func (_c *MockBackupBackend_Read_Call) RunAndReturn(run func(context.Context, string, string, string, string, io.WriteCloser) (int64, error)) *MockBackupBackend_Read_Call
type MockBackupBackend_SourceDataPath_Call ¶ added in v1.28.13
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 (_c *MockBackupBackend_SourceDataPath_Call) Return(_a0 string) *MockBackupBackend_SourceDataPath_Call
func (*MockBackupBackend_SourceDataPath_Call) Run ¶ added in v1.28.13
func (_c *MockBackupBackend_SourceDataPath_Call) Run(run func()) *MockBackupBackend_SourceDataPath_Call
func (*MockBackupBackend_SourceDataPath_Call) RunAndReturn ¶ added in v1.28.13
func (_c *MockBackupBackend_SourceDataPath_Call) RunAndReturn(run func() string) *MockBackupBackend_SourceDataPath_Call
type MockBackupBackend_Write_Call ¶ added in v1.28.13
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 (_c *MockBackupBackend_Write_Call) Return(_a0 int64, _a1 error) *MockBackupBackend_Write_Call
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
func (_c *MockBackupBackend_Write_Call) RunAndReturn(run func(context.Context, string, string, string, string, backup.ReadCloserWithError) (int64, error)) *MockBackupBackend_Write_Call
type Module ¶
type Module interface {
Name() string
Init(ctx context.Context, params moduletools.ModuleInitParams) error
Type() ModuleType
}
type ModuleDependency ¶
type ModuleExtension ¶
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
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 ¶
TextTransform performs text transformation operation
type TextTransformers ¶
type TextTransformers interface {
TextTransformers() map[string]TextTransform
}
TextTransformers defines all text transformers for given arguments
type VectorClassSearchParams ¶
type VectorClassSearchParams struct {
Filters *filters.LocalFilter
Pagination *filters.Pagination
ClassName string
Properties []string
}
type VectorClassSearchRepo ¶
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 Writer ¶
type Writer interface {
Start()
Store(item search.Result) error
Stop() WriterResults
}