qdrantgo

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2023 License: MIT Imports: 5 Imported by: 4

README

Unofficial Go client for Qdrant vector search engine

GoDoc Go Report Card GitHub release

This is Qdrant's unofficial Go client, designed to enable you to use Qdrant's services easily from your own applications.

Qdrant

Qdrant is a vector database that allows you to build high-performance vector search applications.

API support

collections
  • ✅ list
  • ✅ create
  • ✅ collect info
  • ✅ update
  • ✅ delete
  • ❌ update aliases
  • ✅ create index
  • ✅ delete index
  • ❌ cluster info
  • ❌ update cluster setup
  • ❌ list aliases
  • ❌ recover from uploaded snapshot
  • ❌ recover from snapshot
  • ❌ create snapshot
  • ❌ delete snapshot
  • ❌ download snapshot
points
  • ✅ get point
  • ✅ get points
  • ✅ upsert points
  • ✅ delete points
  • ✅ update vectors
  • ✅ delete vectors
  • ❌ set payload
  • ❌ overwrite payload
  • ❌ delete payload
  • ❌ clear payload
  • ❌ scroll payload
  • ✅ search points
  • ❌ search batch points
  • ❌ search point groups
  • ❌ recommend points
  • ❌ recommend batch points
  • ❌ recommend point groups
  • ❌ count points
cluster
  • ❌ cluster status info
  • ❌ tries to recover current peer Raft state
  • ❌ remove peer
  • ❌ collection cluster info
  • ❌ update collection cluster setup
snapshots
  • ❌ recover from uploaded snapshot
  • ❌ recover from snapshot
  • ❌ list collection snapshots
  • ❌ create collection snapshot
  • ❌ delete collection snapshot
  • ❌ download collection snapshot
  • ❌ list storage snapshots
  • ❌ create storage snapshot
  • ❌ delete storage snapshot
  • ❌ download storage snapshot
service
  • ❌ collect telemetry data
  • ❌ collect Prometheus metrics data
  • ❌ set lock options
  • ❌ get lock options

Getting started

Installation

You can load qdrant-go into your project by using:

go get github.com/henomis/qdrant-go
Run Qdrant

You can run Qdrant using Docker:

docker run -p 6333:6333 --name qdrant --rm -v $(pwd)/config.yaml:/qdrant/config/production.yaml qdrant/qdrant

config.yaml file:

service:
  api_key: secret-api-key

Please refer to the official documentation for more information about Qdrant.

Configuration

The only thing you need to start using Qdrant's APIs is the API key. Copy and paste it in the corresponding place in the code, select the API and the parameters you want to use, and that's it.

Usage

Please refer to the examples folder to see how to use the SDK.

Here below a simple usage example:

package main

import (
	"context"
	"fmt"

	qdrantgo "github.com/henomis/qdrant-go"
	"github.com/henomis/qdrant-go/request"
	"github.com/henomis/qdrant-go/response"
)

func main() {

	client := qdrantgo.New("http://localhost:6333", "secret-api-key")

	onDisk := true
	resp := &response.CollectionCreate{}
	err := client.CollectionCreate(
		context.Background(),
		&request.CollectionCreate{
			CollectionName: "test",
			Vectors: request.VectorsParams{
				Size:     4,
				Distance: request.DistanceCosine,
				OnDisk:   &onDisk,
			},
		},
		resp,
	)
	if err != nil {
		panic(err)
	}

	fmt.Printf("resp: %#v\n", resp)

}

Who uses qdrant-go?

  • LinGoose Go framework for building awesome LLM apps

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(endpoint, apiKey string) *Client

func (*Client) CollectionCollectInfo

func (c *Client) CollectionCollectInfo(
	ctx context.Context,
	req *request.CollectionCollectInfo,
	res *response.CollectionCollectInfo,
) error

func (*Client) CollectionCreate

func (c *Client) CollectionCreate(
	ctx context.Context,
	req *request.CollectionCreate,
	res *response.CollectionCreate,
) error

func (*Client) CollectionDelete added in v1.1.0

func (c *Client) CollectionDelete(
	ctx context.Context,
	req *request.CollectionDelete,
	res *response.CollectionDelete,
) error

func (*Client) CollectionList

func (c *Client) CollectionList(
	ctx context.Context,
	req *request.CollectionList,
	res *response.CollectionList,
) error

func (*Client) CollectionUpdate added in v1.1.0

func (c *Client) CollectionUpdate(
	ctx context.Context,
	req *request.CollectionUpdate,
	res *response.CollectionUpdate,
) error

func (*Client) IndexCreate added in v1.1.0

func (c *Client) IndexCreate(
	ctx context.Context,
	req *request.IndexCreate,
	res *response.IndexCreate,
) error

func (*Client) IndexDelete added in v1.1.0

func (c *Client) IndexDelete(
	ctx context.Context,
	req *request.IndexDelete,
	res *response.IndexDelete,
) error

func (*Client) PointGet added in v1.1.0

func (c *Client) PointGet(
	ctx context.Context,
	req *request.PointGet,
	res *response.PointGet,
) error

func (*Client) PointsDelete added in v1.1.0

func (c *Client) PointsDelete(
	ctx context.Context,
	req *request.PointsDelete,
	res *response.PointsDelete,
) error

func (*Client) PointsGet added in v1.1.0

func (c *Client) PointsGet(
	ctx context.Context,
	req *request.PointsGet,
	res *response.PointsGet,
) error

func (*Client) PointsSearch added in v1.1.0

func (c *Client) PointsSearch(
	ctx context.Context,
	req *request.PointsSearch,
	res *response.PointsSearch,
) error

func (*Client) PointsUpsert added in v1.1.0

func (c *Client) PointsUpsert(
	ctx context.Context,
	req *request.PointsUpsert,
	res *response.PointsUpsert,
) error

func (*Client) VectorsDelete added in v1.1.0

func (c *Client) VectorsDelete(
	ctx context.Context,
	req *request.VectorsDelete,
	res *response.VectorsDelete,
) error

func (*Client) VectorsUpdate added in v1.1.0

func (c *Client) VectorsUpdate(
	ctx context.Context,
	req *request.VectorsUpdate,
	res *response.VectorsUpdate,
) error

Jump to

Keyboard shortcuts

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