Hide boilerplate in snippets.

This commit is contained in:
István Zoltán Szabó
2026-07-21 14:04:28 +02:00
parent 3fecc10c89
commit 4bc89cd833
44 changed files with 46 additions and 64 deletions
@@ -5,7 +5,9 @@ public class Snippet
{
public static async Task Run()
{
// @hide-start
var client = new QdrantClient("localhost", 6334);
// @hide-end
await client.UpsertAsync(
collectionName: "{collection_name}",
@@ -2,8 +2,6 @@
using Qdrant.Client;
using Qdrant.Client.Grpc;
var client = new QdrantClient("localhost", 6334);
await client.UpsertAsync(
collectionName: "{collection_name}",
points: new List<PointStruct>
@@ -5,11 +5,6 @@ import (
"github.com/qdrant/go-client/qdrant"
)
client, err := qdrant.NewClient(&qdrant.Config{
Host: "localhost",
Port: 6334,
})
client.Upsert(context.Background(), &qdrant.UpsertPoints{
CollectionName: "{collection_name}",
Points: []*qdrant.PointStruct{
@@ -9,9 +9,6 @@ import io.qdrant.client.grpc.Points.PointStruct;
import io.qdrant.client.grpc.Points.UpsertPoints;
import java.util.List;
QdrantClient client =
new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
client
.upsertAsync(
UpsertPoints.newBuilder()
@@ -1,8 +1,6 @@
```python
from qdrant_client import QdrantClient, models
client = QdrantClient(url="http://localhost:6333")
client.upsert(
collection_name="{collection_name}",
points=[
@@ -1,8 +1,6 @@
```typescript
import { QdrantClient } from "@qdrant/js-client-rest";
const client = new QdrantClient({ host: "localhost", port: 6333 });
client.upsert("{collection_name}", {
points: [
{
@@ -7,12 +7,14 @@ import (
)
func Main() {
// @hide-start
client, err := qdrant.NewClient(&qdrant.Config{
Host: "localhost",
Port: 6334,
})
if err != nil { panic(err) } // @hide
if err != nil { panic(err) }
// @hide-end
client.Upsert(context.Background(), &qdrant.UpsertPoints{
CollectionName: "{collection_name}",
@@ -12,8 +12,10 @@ import java.util.List;
public class Snippet {
public static void run() throws Exception {
// @hide-start
QdrantClient client =
new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
// @hide-end
client
.upsertAsync(
@@ -1,6 +1,8 @@
from qdrant_client import QdrantClient, models
# @hide-start
client = QdrantClient(url="http://localhost:6333")
# @hide-end
client.upsert(
collection_name="{collection_name}",
@@ -1,6 +1,8 @@
import { QdrantClient } from "@qdrant/js-client-rest";
// @hide-start
const client = new QdrantClient({ host: "localhost", port: 6333 });
// @hide-end
client.upsert("{collection_name}", {
points: [