mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-05 19:08:32 +02:00
35 lines
780 B
Go
35 lines
780 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-openrouter-key-here>",
|
|
UseTLS: true,
|
|
})
|
|
|
|
if err != nil { panic(err) } // @hide
|
|
|
|
client.Upsert(context.Background(), &qdrant.UpsertPoints{
|
|
CollectionName: "{collection_name}",
|
|
Points: []*qdrant.PointStruct{
|
|
{
|
|
Id: qdrant.NewIDNum(uint64(1)),
|
|
Vectors: qdrant.NewVectorsDocument(&qdrant.Document{
|
|
Model: "openrouter/mistralai/mistral-embed-2312",
|
|
Text: "Recipe for baking chocolate chip cookies",
|
|
Options: qdrant.NewValueMap(map[string]any{
|
|
"openrouter-api-key": "<YOUR_OPENROUTER_API_KEY>",
|
|
}),
|
|
}),
|
|
},
|
|
},
|
|
})
|
|
}
|