1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
//! # Tencent VectorDB Rust SDK
//!
//! Rust SDK for [Tencent Cloud VectorDB](https://cloud.tencent.com/product/vdb).
//!
//! ## Features
//!
//! - Database and collection management
//! - Document CRUD operations
//! - Vector similarity search
//! - Index management
//! - Filter support
//!
//! ## Example
//!
//! ```rust,no_run
//! use tcvectordb::{VectorDBClient, Document, Index, VectorIndex, FilterIndex};
//! use tcvectordb::enums::{IndexType, MetricType, FieldType, ReadConsistency};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let client = VectorDBClient::new(
//! "http://localhost:8100",
//! "root",
//! "your-api-key",
//! ReadConsistency::EventualConsistency,
//! 30,
//! )?;
//!
//! // Create database
//! let db = client.create_database("test_db").await?;
//!
//! // Create collection with index
//! let mut index = Index::new();
//! index.add_vector_index(VectorIndex::new(
//! "vector",
//! 3,
//! IndexType::HNSW,
//! MetricType::COSINE,
//! None,
//! ));
//! index.add_filter_index(FilterIndex::new(
//! "id",
//! FieldType::String,
//! IndexType::PRIMARY_KEY,
//! ));
//!
//! let collection = db.create_collection(
//! "test_collection",
//! 3,
//! 2,
//! Some("Test collection"),
//! Some(index),
//! None,
//! None,
//! ).await?;
//!
//! // Upsert documents
//! let documents = vec![
//! Document::new()
//! .with_id("doc1")
//! .with_vector(vec![0.1, 0.2, 0.3])
//! .with_field("title", "Document 1"),
//! ];
//!
//! collection.upsert(documents, None, true).await?;
//!
//! // Search similar vectors
//! let results = collection.search(
//! vec![vec![0.1, 0.2, 0.3]],
//! None,
//! None,
//! false,
//! 10,
//! None,
//! None,
//! None,
//! ).await?;
//!
//! println!("Search results: {:?}", results);
//!
//! Ok(())
//! }
//! ```
pub use VectorDBClient;
pub use Database;
pub use Collection;
pub use Document;
pub use ;
pub use ;
pub use Filter;
pub use Embedding;