mirror of
https://github.com/qdrant/landing_page.git
synced 2026-09-26 22:48:30 +02:00
This commit both: - Fixes pre-existing mistakes in snippets, aka wrong code samples. - Adds hidden (`@hide`) statements that do not appear in the docs, but satisfy typecheckers.
30 lines
660 B
Go
30 lines
660 B
Go
package snippet
|
|
|
|
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) } // @hide
|
|
|
|
client.CreateCollection(context.Background(), &qdrant.CreateCollection{
|
|
CollectionName: "{collection_name}",
|
|
VectorsConfig: qdrant.NewVectorsConfig(&qdrant.VectorParams{
|
|
Size: 768,
|
|
Distance: qdrant.Distance_Cosine,
|
|
OnDisk: qdrant.PtrOf(true),
|
|
}),
|
|
QuantizationConfig: qdrant.NewQuantizationScalar(&qdrant.ScalarQuantization{
|
|
Type: qdrant.QuantizationType_Int8,
|
|
AlwaysRam: qdrant.PtrOf(true),
|
|
}),
|
|
})
|
|
}
|