qdrant

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonParams

type CommonParams struct {
	CollectionName string
	PointID        uint64
	PointUUID      string
	Selector       *pb.PointsSelector
}

func (*CommonParams) GetPbPointID

func (p *CommonParams) GetPbPointID() (*pb.PointId, error)

func (*CommonParams) GetPbPointIDs

func (p *CommonParams) GetPbPointIDs() ([]*pb.PointId, error)

func (*CommonParams) GetPbSelector

func (p *CommonParams) GetPbSelector() (*pb.PointsSelector, error)

type Config

type Config struct {
	Addr   string
	APIKey string
}

type CreateCollectionIndexItem

type CreateCollectionIndexItem struct {
	Name string
	Type string
}

type CreateCollectionParams

type CreateCollectionParams struct {
	CollectionName string
	VectorSize     uint64
	Indexes        []CreateCollectionIndexItem
}

type DeletePointsParams

type DeletePointsParams struct {
	CommonParams
}

type GetPointsParams

type GetPointsParams struct {
	CommonParams
}

type QdrantClient

type QdrantClient struct {
	Addr   string
	APIKey string
	ColCli pb.CollectionsClient
	Conn   *grpc.ClientConn
}

func New

func New(cfg Config) *QdrantClient

func (*QdrantClient) Check

func (c *QdrantClient) Check() (string, error)

func (*QdrantClient) Close

func (c *QdrantClient) Close()

func (*QdrantClient) CreateCollection

func (c *QdrantClient) CreateCollection(ctx context.Context, params CreateCollectionParams) error

func (*QdrantClient) DeletePoints

func (c *QdrantClient) DeletePoints(ctx context.Context, params DeletePointsParams) error

func (*QdrantClient) GetPoints

func (c *QdrantClient) GetPoints(ctx context.Context, params GetPointsParams) (*QdrantPoint, error)

func (*QdrantClient) SearchPointsWithFilter

func (c *QdrantClient) SearchPointsWithFilter(ctx context.Context, params SearchPointsParams) ([]*QdrantPoint, error)

func (*QdrantClient) UpsertPoints

func (c *QdrantClient) UpsertPoints(ctx context.Context, params UpsertPointsParams) error

type QdrantPoint

type QdrantPoint struct {
	ID      int64                `json:"id"`
	UUID    string               `json:"uuid"`
	Score   float32              `json:"score"`
	Vector  []float32            `json:"vector"`
	Payload map[string]*pb.Value `json:"payload"`
}

func (*QdrantPoint) LoadFromRetrievedPoint

func (qp *QdrantPoint) LoadFromRetrievedPoint(p *pb.RetrievedPoint) error

func (*QdrantPoint) LoadFromScoredPoint

func (qp *QdrantPoint) LoadFromScoredPoint(p *pb.ScoredPoint) error

type SearchPointsParams

type SearchPointsParams struct {
	CollectionName string
	Vector         []float32
	TopK           uint64
	Key            string
	Value          int64
	Offset         uint64
}

type UpsertPointPayloadItem

type UpsertPointPayloadItem struct {
	Type  string
	Value any
}

type UpsertPointsParams

type UpsertPointsParams struct {
	CommonParams
	Vector     []float32
	Payload    map[string]UpsertPointPayloadItem
	WaitUpsert bool
}

Jump to

Keyboard shortcuts

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