Documentation ¶
Index ¶
- func Cosine[T Float](a []T, b []T) T
- type Float
- type VectorDatabase
- func (s *VectorDatabase) Close() error
- func (s *VectorDatabase) CreateIfNotExists(repo string) error
- func (s *VectorDatabase) Delete(ctx context.Context, repo string, ids ...string) error
- func (s *VectorDatabase) DeleteRepo(ctx context.Context, repo string) error
- func (s *VectorDatabase) ListRepos(ctx context.Context) ([]string, error)
- func (s *VectorDatabase) Range(ctx context.Context, repo string, f func(vector *vectordb.Vector)) error
- func (s *VectorDatabase) Search(ctx context.Context, repo string, v []float32, topK int) ([]*vectordb.Match, error)
- func (s *VectorDatabase) Upsert(ctx context.Context, repo string, v *vectordb.Upsert) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type VectorDatabase ¶
type VectorDatabase struct {
// contains filtered or unexported fields
}
VectorDatabase 本地向量数据库 包含3个部分 meta、chunks、repo meta存储version等源信息 chunks 存储md5->chunk的映射 repo 存储的库包含的文档id和向量
func NewVectorSearch ¶
func NewVectorSearch(path string) (*VectorDatabase, error)
func (*VectorDatabase) Close ¶
func (s *VectorDatabase) Close() error
func (*VectorDatabase) CreateIfNotExists ¶
func (s *VectorDatabase) CreateIfNotExists(repo string) error
func (*VectorDatabase) DeleteRepo ¶
func (s *VectorDatabase) DeleteRepo(ctx context.Context, repo string) error
func (*VectorDatabase) ListRepos ¶
func (s *VectorDatabase) ListRepos(ctx context.Context) ([]string, error)
Click to show internal directories.
Click to hide internal directories.