mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-07 11:58:31 +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.
33 lines
695 B
Go
33 lines
695 B
Go
package snippet
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/qdrant/go-client/qdrant"
|
|
)
|
|
|
|
func Main() {
|
|
client, err := qdrant.NewClient(&qdrant.Config{
|
|
Host: "xyz-example.qdrant.io",
|
|
Port: 6334,
|
|
APIKey: "<paste-your-api-key-here>",
|
|
UseTLS: true,
|
|
})
|
|
|
|
if err != nil { panic(err) } // @hide
|
|
|
|
client.Query(context.Background(), &qdrant.QueryPoints{
|
|
CollectionName: "{collection_name}",
|
|
Query: qdrant.NewQueryNearest(
|
|
qdrant.NewVectorInputDocument(&qdrant.Document{
|
|
Text: "Mission to Mars",
|
|
Model: "jinaai/jina-clip-v2",
|
|
Options: qdrant.NewValueMap(map[string]any{
|
|
"jina-api-key": "<YOUR_JINAAI_API_KEY>",
|
|
"dimensions": 512,
|
|
}),
|
|
}),
|
|
),
|
|
})
|
|
}
|