qdrant

package
v0.0.0-...-2e32b89 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VECTOR_SIZE     = 1536 // ada002
	VECTOR_DISTANCE = "Cosine"
	BATCH_SIZE      = 500
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Match

type Match struct {
	ID      int               `json:"id"`
	Score   float32           `json:"score"`
	Payload map[string]string `json:"payload"`
	Version int               `json:"version"`
}

type NamespaceConfig

type NamespaceConfig struct {
	Vectors struct {
		Size     int    `json:"size"`
		Distance string `json:"distance"`
	} `json:"vectors"`
}

type Point

type Point struct {
	ID      int               `json:"id"`
	Vector  []float32         `json:"vector"`
	Payload map[string]string `json:"payload,omitempty"`
}

type Qdrant

type Qdrant struct {
	Endpoint string
	// contains filtered or unexported fields
}

func New

func New(endpoint string) (*Qdrant, error)

func (*Qdrant) CreateNamespace

func (q *Qdrant) CreateNamespace(uuid string) error

func (*Qdrant) NamespaceExists

func (q *Qdrant) NamespaceExists(uuid string) (bool, error)

func (*Qdrant) Retrieve

func (q *Qdrant) Retrieve(questionEmbedding []float32, topK int, uuid string) ([]vectordb.QueryMatch, error)

func (*Qdrant) UpsertEmbeddings

func (q *Qdrant) UpsertEmbeddings(embeddings [][]float32, chunks []chunk.Chunk, uuid string) error

type SearchResult

type SearchResult struct {
	Result []Match `json:"result"`
	Status string  `json:"status"`
	Time   float64 `json:"time"`
}

Jump to

Keyboard shortcuts

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