Documentation
¶
Index ¶
- type PGVectorOption
- func WithDatabaseName(databaseName string) PGVectorOption
- func WithDatabasePrefix(databasePrefix string) PGVectorOption
- func WithDatabaseSchema(databaseSchema string) PGVectorOption
- func WithEmbeddingVectorDimensions(dimensions uint32) PGVectorOption
- func WithPartitionsEnabled(enabled bool) PGVectorOption
- type PGVectorStorage
- func (s *PGVectorStorage) DeleteFile(ctx context.Context, source storage.SourceUUID, file storage.FileUUID) error
- func (s *PGVectorStorage) DeleteSource(ctx context.Context, sourceUUID storage.SourceUUID) error
- func (s *PGVectorStorage) FinishFileProcessing(ctx context.Context, source storage.SourceUUID, file storage.FileUUID, ...) error
- func (s *PGVectorStorage) GetOrCreateFile(ctx context.Context, sourceUUID storage.SourceUUID, path string, eTag string, ...) (*storage.File, bool, error)
- func (s *PGVectorStorage) GetOrCreateSource(ctx context.Context, sourceUUID storage.SourceUUID) (*storage.DataSource, error)
- func (s *PGVectorStorage) Install(ctx context.Context) error
- func (s *PGVectorStorage) PutEmbedding(ctx context.Context, source storage.SourceUUID, file storage.FileUUID, ...) error
- func (s *PGVectorStorage) SearchSimilarEmbedddings(ctx context.Context, embeddingVector []float32, sources []storage.SourceUUID, ...) ([]storage.Embedding, error)
- func (s *PGVectorStorage) UnInstall(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PGVectorOption ¶
type PGVectorOption func(s *PGVectorStorage)
func WithDatabaseName ¶
func WithDatabaseName(databaseName string) PGVectorOption
func WithDatabasePrefix ¶
func WithDatabasePrefix(databasePrefix string) PGVectorOption
func WithDatabaseSchema ¶
func WithDatabaseSchema(databaseSchema string) PGVectorOption
func WithEmbeddingVectorDimensions ¶
func WithEmbeddingVectorDimensions(dimensions uint32) PGVectorOption
func WithPartitionsEnabled ¶
func WithPartitionsEnabled(enabled bool) PGVectorOption
type PGVectorStorage ¶
type PGVectorStorage struct {
// contains filtered or unexported fields
}
func NewPGVectorStorage ¶
func NewPGVectorStorage(db *sql.DB, options ...PGVectorOption) PGVectorStorage
func (*PGVectorStorage) DeleteFile ¶
func (s *PGVectorStorage) DeleteFile(ctx context.Context, source storage.SourceUUID, file storage.FileUUID) error
func (*PGVectorStorage) DeleteSource ¶
func (s *PGVectorStorage) DeleteSource(ctx context.Context, sourceUUID storage.SourceUUID) error
func (*PGVectorStorage) FinishFileProcessing ¶
func (*PGVectorStorage) GetOrCreateFile ¶
func (s *PGVectorStorage) GetOrCreateFile(ctx context.Context, sourceUUID storage.SourceUUID, path string, eTag string, processorVersion storage.ProcessorVersion) (*storage.File, bool, error)
func (*PGVectorStorage) GetOrCreateSource ¶
func (s *PGVectorStorage) GetOrCreateSource(ctx context.Context, sourceUUID storage.SourceUUID) (*storage.DataSource, error)
func (*PGVectorStorage) Install ¶
func (s *PGVectorStorage) Install(ctx context.Context) error
Make sure that all the tables are created inside PGVector and its ready to work. You can run this safelly several times.
func (*PGVectorStorage) PutEmbedding ¶
func (s *PGVectorStorage) PutEmbedding(ctx context.Context, source storage.SourceUUID, file storage.FileUUID, chunk string, embeddingVector []float32) error
func (*PGVectorStorage) SearchSimilarEmbedddings ¶
func (s *PGVectorStorage) SearchSimilarEmbedddings(ctx context.Context, embeddingVector []float32, sources []storage.SourceUUID, limit uint32) ([]storage.Embedding, error)
Click to show internal directories.
Click to hide internal directories.