address review: credential placeholders in snippets, reword footgun-guard

This commit is contained in:
Evgeniya Sukhodolskaya
2026-07-21 20:02:25 +02:00
parent 169c167102
commit 1744320e71
19 changed files with 55 additions and 99 deletions
@@ -11,13 +11,11 @@ public class Snippet
public static async Task Run()
{
// @block-start client-connection
var QDRANT_URL = Environment.GetEnvironmentVariable("QDRANT_URL");
var QDRANT_API_KEY = Environment.GetEnvironmentVariable("QDRANT_API_KEY");
// Replace the host and API key with your own from https://cloud.qdrant.io
var client = new QdrantClient(
host: QDRANT_URL!,
host: "xyz-example.qdrant.io",
https: true,
apiKey: QDRANT_API_KEY
apiKey: "<your-api-key>"
);
// @block-end client-connection
@@ -1,10 +1,8 @@
```csharp
var QDRANT_URL = Environment.GetEnvironmentVariable("QDRANT_URL");
var QDRANT_API_KEY = Environment.GetEnvironmentVariable("QDRANT_API_KEY");
// Replace the host and API key with your own from https://cloud.qdrant.io
var client = new QdrantClient(
host: QDRANT_URL!,
host: "xyz-example.qdrant.io",
https: true,
apiKey: QDRANT_API_KEY
apiKey: "<your-api-key>"
);
```
@@ -1,10 +1,8 @@
```go
QDRANT_URL := os.Getenv("QDRANT_URL")
QDRANT_API_KEY := os.Getenv("QDRANT_API_KEY")
// Replace the host and API key with your own from https://cloud.qdrant.io
client, err := qdrant.NewClient(&qdrant.Config{
Host: QDRANT_URL,
APIKey: QDRANT_API_KEY,
Host: "xyz-example.qdrant.io",
APIKey: "<your-api-key>",
UseTLS: true,
})
```
@@ -1,10 +1,8 @@
```java
static final String QDRANT_URL = System.getenv("QDRANT_URL");
static final String QDRANT_API_KEY = System.getenv("QDRANT_API_KEY");
// Replace the host and API key with your own from https://cloud.qdrant.io
static final QdrantClient client =
new QdrantClient(
QdrantGrpcClient.newBuilder(QDRANT_URL, 6334, true)
.withApiKey(QDRANT_API_KEY)
QdrantGrpcClient.newBuilder("xyz-example.qdrant.io", 6334, true)
.withApiKey("<your-api-key>")
.build());
```
@@ -1,14 +1,10 @@
```python
import os
from qdrant_client import QdrantClient, models
QDRANT_URL = os.getenv("QDRANT_URL")
QDRANT_API_KEY = os.getenv("QDRANT_API_KEY")
# Replace url and api_key with your own from https://cloud.qdrant.io
client = QdrantClient(
url=QDRANT_URL,
api_key=QDRANT_API_KEY,
url="https://xyz-example.qdrant.io:6333",
api_key="<your-api-key>",
cloud_inference=True
)
```
@@ -1,8 +1,6 @@
```rust
let qdrant_url = std::env::var("QDRANT_URL")?;
let qdrant_api_key = std::env::var("QDRANT_API_KEY")?;
let client = Qdrant::from_url(&qdrant_url)
.api_key(qdrant_api_key)
// Replace the URL and API key with your own from https://cloud.qdrant.io
let client = Qdrant::from_url("https://xyz-example.qdrant.io:6334")
.api_key("<your-api-key>")
.build()?;
```
@@ -1,11 +1,9 @@
```typescript
import { QdrantClient, Schemas } from "@qdrant/js-client-rest";
const QDRANT_URL = process.env.QDRANT_URL;
const QDRANT_API_KEY = process.env.QDRANT_API_KEY;
// Replace url and apiKey with your own from https://cloud.qdrant.io
const client = new QdrantClient({
url: QDRANT_URL,
apiKey: QDRANT_API_KEY,
url: "https://xyz-example.qdrant.io:6333",
apiKey: "<your-api-key>",
});
```
@@ -7,13 +7,11 @@ using Qdrant.Client.Grpc;
using static Qdrant.Client.Grpc.Conditions;
using Chunk = (string Url, string Anchor, int ChunkNum, string Text, string SectionUrl, string ContentHash, string PointId);
var QDRANT_URL = Environment.GetEnvironmentVariable("QDRANT_URL");
var QDRANT_API_KEY = Environment.GetEnvironmentVariable("QDRANT_API_KEY");
// Replace the host and API key with your own from https://cloud.qdrant.io
var client = new QdrantClient(
host: QDRANT_URL!,
host: "xyz-example.qdrant.io",
https: true,
apiKey: QDRANT_API_KEY
apiKey: "<your-api-key>"
);
var MODEL = "sentence-transformers/all-MiniLM-L6-v2";
@@ -4,7 +4,6 @@ import (
"crypto/sha256"
"encoding/hex"
"fmt"
"os"
"regexp"
"strings"
"time"
@@ -13,12 +12,10 @@ import (
"github.com/qdrant/go-client/qdrant"
)
QDRANT_URL := os.Getenv("QDRANT_URL")
QDRANT_API_KEY := os.Getenv("QDRANT_API_KEY")
// Replace the host and API key with your own from https://cloud.qdrant.io
client, err := qdrant.NewClient(&qdrant.Config{
Host: QDRANT_URL,
APIKey: QDRANT_API_KEY,
Host: "xyz-example.qdrant.io",
APIKey: "<your-api-key>",
UseTLS: true,
})
@@ -37,13 +37,11 @@ import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors;
static final String QDRANT_URL = System.getenv("QDRANT_URL");
static final String QDRANT_API_KEY = System.getenv("QDRANT_API_KEY");
// Replace the host and API key with your own from https://cloud.qdrant.io
static final QdrantClient client =
new QdrantClient(
QdrantGrpcClient.newBuilder(QDRANT_URL, 6334, true)
.withApiKey(QDRANT_API_KEY)
QdrantGrpcClient.newBuilder("xyz-example.qdrant.io", 6334, true)
.withApiKey("<your-api-key>")
.build());
static final String MODEL = "sentence-transformers/all-MiniLM-L6-v2";
@@ -1,14 +1,10 @@
```python
import os
from qdrant_client import QdrantClient, models
QDRANT_URL = os.getenv("QDRANT_URL")
QDRANT_API_KEY = os.getenv("QDRANT_API_KEY")
# Replace url and api_key with your own from https://cloud.qdrant.io
client = QdrantClient(
url=QDRANT_URL,
api_key=QDRANT_API_KEY,
url="https://xyz-example.qdrant.io:6333",
api_key="<your-api-key>",
cloud_inference=True
)
@@ -11,11 +11,9 @@ use qdrant_client::qdrant::{
use qdrant_client::{Payload, Qdrant};
use sha2::{Digest, Sha256};
let qdrant_url = std::env::var("QDRANT_URL")?;
let qdrant_api_key = std::env::var("QDRANT_API_KEY")?;
let client = Qdrant::from_url(&qdrant_url)
.api_key(qdrant_api_key)
// Replace the URL and API key with your own from https://cloud.qdrant.io
let client = Qdrant::from_url("https://xyz-example.qdrant.io:6334")
.api_key("<your-api-key>")
.build()?;
const MODEL: &str = "sentence-transformers/all-MiniLM-L6-v2";
@@ -1,12 +1,10 @@
```typescript
import { QdrantClient, Schemas } from "@qdrant/js-client-rest";
const QDRANT_URL = process.env.QDRANT_URL;
const QDRANT_API_KEY = process.env.QDRANT_API_KEY;
// Replace url and apiKey with your own from https://cloud.qdrant.io
const client = new QdrantClient({
url: QDRANT_URL,
apiKey: QDRANT_API_KEY,
url: "https://xyz-example.qdrant.io:6333",
apiKey: "<your-api-key>",
});
const MODEL = "sentence-transformers/all-MiniLM-L6-v2";
@@ -5,7 +5,6 @@ import (
"crypto/sha256"
"encoding/hex"
"fmt"
"os"
"regexp"
"strings"
"time"
@@ -16,12 +15,10 @@ import (
func Main() {
// @block-start client-connection
QDRANT_URL := os.Getenv("QDRANT_URL")
QDRANT_API_KEY := os.Getenv("QDRANT_API_KEY")
// Replace the host and API key with your own from https://cloud.qdrant.io
client, err := qdrant.NewClient(&qdrant.Config{
Host: QDRANT_URL,
APIKey: QDRANT_API_KEY,
Host: "xyz-example.qdrant.io",
APIKey: "<your-api-key>",
UseTLS: true,
})
// @block-end client-connection
@@ -41,13 +41,11 @@ import java.util.stream.Collectors;
public class Snippet {
// @block-start client-connection
static final String QDRANT_URL = System.getenv("QDRANT_URL");
static final String QDRANT_API_KEY = System.getenv("QDRANT_API_KEY");
// Replace the host and API key with your own from https://cloud.qdrant.io
static final QdrantClient client =
new QdrantClient(
QdrantGrpcClient.newBuilder(QDRANT_URL, 6334, true)
.withApiKey(QDRANT_API_KEY)
QdrantGrpcClient.newBuilder("xyz-example.qdrant.io", 6334, true)
.withApiKey("<your-api-key>")
.build());
// @block-end client-connection
@@ -1,14 +1,10 @@
# @block-start client-connection
import os
from qdrant_client import QdrantClient, models
QDRANT_URL = os.getenv("QDRANT_URL")
QDRANT_API_KEY = os.getenv("QDRANT_API_KEY")
# Replace url and api_key with your own from https://cloud.qdrant.io
client = QdrantClient(
url=QDRANT_URL,
api_key=QDRANT_API_KEY,
url="https://xyz-example.qdrant.io:6333",
api_key="<your-api-key>",
cloud_inference=True
)
# @block-end client-connection
@@ -12,11 +12,9 @@ use sha2::{Digest, Sha256};
pub async fn main() -> anyhow::Result<()> {
// @block-start client-connection
let qdrant_url = std::env::var("QDRANT_URL")?;
let qdrant_api_key = std::env::var("QDRANT_API_KEY")?;
let client = Qdrant::from_url(&qdrant_url)
.api_key(qdrant_api_key)
// Replace the URL and API key with your own from https://cloud.qdrant.io
let client = Qdrant::from_url("https://xyz-example.qdrant.io:6334")
.api_key("<your-api-key>")
.build()?;
// @block-end client-connection
@@ -1,12 +1,10 @@
// @block-start client-connection
import { QdrantClient, Schemas } from "@qdrant/js-client-rest";
const QDRANT_URL = process.env.QDRANT_URL;
const QDRANT_API_KEY = process.env.QDRANT_API_KEY;
// Replace url and apiKey with your own from https://cloud.qdrant.io
const client = new QdrantClient({
url: QDRANT_URL,
apiKey: QDRANT_API_KEY,
url: "https://xyz-example.qdrant.io:6333",
apiKey: "<your-api-key>",
});
// @block-end client-connection
@@ -208,7 +208,7 @@ incoming chunk
-> gone: delete (last, after all writes)
```
**Note:** Optional footgun-guard: take a [snapshot](/documentation/snapshots/) before sync, delete it later when everything looks fine.
**Note:** Optional safety net: take a [snapshot](/documentation/snapshots/) before sync, delete it later when everything looks fine.
### Input of a Sync Pipeline