Documentation
¶
Index ¶
- type Match
- type Upsert
- type Vector
- func (*Vector) Descriptor() ([]byte, []int)
- func (m *Vector) GetID() string
- func (m *Vector) GetMD5() []byte
- func (m *Vector) GetMeta() map[string]string
- func (m *Vector) GetValues() []float32
- func (*Vector) ProtoMessage()
- func (m *Vector) Reset()
- func (m *Vector) String() string
- func (m *Vector) XXX_DiscardUnknown()
- func (m *Vector) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Vector) XXX_Merge(src proto.Message)
- func (m *Vector) XXX_Size() int
- func (m *Vector) XXX_Unmarshal(b []byte) error
- type VectorDB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Vector ¶
type Vector struct {
ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
Values []float32 `protobuf:"fixed32,2,rep,packed,name=Values,proto3" json:"Values,omitempty"`
MD5 []byte `protobuf:"bytes,3,opt,name=MD5,proto3" json:"MD5,omitempty"`
Meta map[string]string `` /* 149-byte string literal not displayed */
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
Vector 向量
func (*Vector) Descriptor ¶
func (*Vector) ProtoMessage ¶
func (*Vector) ProtoMessage()
func (*Vector) XXX_DiscardUnknown ¶
func (m *Vector) XXX_DiscardUnknown()
func (*Vector) XXX_Marshal ¶
func (*Vector) XXX_Unmarshal ¶
type VectorDB ¶
type VectorDB interface {
// ListRepos list repos
ListRepos(ctx context.Context) ([]string, error)
// DeleteRepo delete repo
DeleteRepo(ctx context.Context, repos string) error
// Upsert 插入or更新
Upsert(ctx context.Context, repo string, v *Upsert) error
// Delete 删除
Delete(ctx context.Context, repo string, id ...string) error
// Range 遍历所有
Range(ctx context.Context, repo string, f func(*Vector)) error
// Search 搜索向量相似度最高的topk
Search(ctx context.Context, repo string, v []float32, topK int) ([]*Match, error)
}
VectorDB 向量数据库
Click to show internal directories.
Click to hide internal directories.