Fix type-checking errors in snippets (code only, no .md)

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.
This commit is contained in:
xzfc
2025-11-28 22:02:07 +00:00
parent 00896acb28
commit 74a785218b
410 changed files with 1161 additions and 252 deletions
@@ -1,9 +1,10 @@
using Qdrant.Client; // @hide
public class Snippet
{
public static async Task Run()
{
var client = new QdrantClient("localhost", 6334); // @hide
await client.CollectionExistsAsync("{collection_name}");
}
}
@@ -1,7 +1,16 @@
package snippet
import "context"
import "github.com/qdrant/go-client/qdrant" // @hide
func Main() {
// @hide-start
client, err := qdrant.NewClient(&qdrant.Config{
Host: "localhost",
Port: 6334,
})
if err != nil { panic(err) }
// @hide-end
client.CollectionExists(context.Background(), "my_collection")
}
@@ -2,6 +2,10 @@ package com.example.snippets_amalgamation;
public class Snippet {
public static void run() throws Exception {
// @hide-start
io.qdrant.client.QdrantClient client =
new io.qdrant.client.QdrantClient(io.qdrant.client.QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
// @hide-end
client.collectionExistsAsync("{collection_name}").get();
}
}
@@ -1,6 +1,8 @@
pub async fn main() -> anyhow::Result<()> {
let client = qdrant_client::Qdrant::from_url("http://localhost:6334").build()?; // @hide
client.collection_exists("{collection_name}").await?;
Ok(())