mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-06 11:28: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.
28 lines
878 B
Rust
28 lines
878 B
Rust
use qdrant_client::{
|
|
Payload, Qdrant,
|
|
qdrant::{Image, PointStruct, UpsertPointsBuilder},
|
|
};
|
|
use std::collections::HashMap;
|
|
|
|
pub async fn main() -> anyhow::Result<()> {
|
|
let client = Qdrant::from_url("<your-qdrant-url>").build()?;
|
|
let mut options = HashMap::new();
|
|
options.insert("jina-api-key".to_string(), "<YOUR_JINAAI_API_KEY>".into());
|
|
options.insert("dimensions".to_string(), 512.into());
|
|
|
|
client
|
|
.upsert_points(UpsertPointsBuilder::new("{collection_name}",
|
|
vec![
|
|
PointStruct::new(1,
|
|
Image {
|
|
image: Some("https://qdrant.tech/example.png".into()),
|
|
model: "jinaai/jina-clip-v2".into(),
|
|
options,
|
|
},
|
|
Payload::default())
|
|
]).wait(true))
|
|
.await?;
|
|
|
|
Ok(())
|
|
}
|