use std::collections::HashMap; use qdrant_client::qdrant::{Document, PointStruct, UpsertPointsBuilder}; use qdrant_client::{Payload, Qdrant}; use serde_json::json; pub async fn main() -> anyhow::Result<()> { let client = Qdrant::from_url("http://localhost:6334").build()?; // @hide let point = PointStruct::new( 1, HashMap::from([( "description-dense".to_string(), Document::new( "A Victorian scientist builds a device to travel far into the future and observes the dim trajectories of humanity. He discovers evolutionary divergence and the consequences of class division. Wells's novella established time travel as a vehicle for social commentary.", "sentence-transformers/all-minilm-l6-v2", ), )]), Payload::try_from(json!({ "title": "The Time Machine", "author": "H.G. Wells", "isbn": "9780553213515", })) .unwrap(), ); client .upsert_points(UpsertPointsBuilder::new("books", vec![point]).wait(true)) .await?; Ok(()) }