Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@adiom-mark
Copy link
Collaborator

In cmd/grpcexample/main.go
replace the existing EmbeddingServiceHandler with something like:

epath, ehandler := adiomv1connect.NewEmbeddingServiceHandler(vector.NewOllama("http://localhost:11434/api", "nomic-embed-text"))

Run go run cmd/grpcexample/main.go

Create a collection like this:

package main

import (
	"context"

	"github.com/qdrant/go-client/qdrant"
)

func main() {
	client, err := qdrant.NewClient(&qdrant.Config{
		Host: "localhost",
		Port: 6334,
	})
	if err != nil {
		panic(err)
	}

	client.CreateCollection(context.Background(), &qdrant.CreateCollection{
		CollectionName: "test_collection",
		VectorsConfig: qdrant.NewVectorsConfig(&qdrant.VectorParams{
			Size:     768,
			Distance: qdrant.Distance_Cosine,
		}),
	})

}

Run qdrant

docker pull qdrant/qdrant
docker run -d -p 6333:6333 -p 6334:6334 \
    -v "$(pwd)/qdrant_storage:/qdrant/storage:z" \
    qdrant/qdrant

example dsync run cmd with movie dataset:

 go run main.go -ns test.movies:test_collection --verbosity DEBUG mongodb://localhost:27017 --max-page-size 300 qdrant --host localhost --port 6334 grpc://localhost:8085 --insecure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants