tcvectordb 0.1.9

Rust SDK for Tencent Cloud VectorDB
Documentation
//! # 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 mod client;
pub mod database;
pub mod collection;
pub mod document;
pub mod index;
pub mod enums;
pub mod error;
pub mod filter;

pub use client::VectorDBClient;
pub use database::Database;
pub use collection::Collection;
pub use document::Document;
pub use index::{Index, VectorIndex, FilterIndex, SparseIndex};
pub use error::{VectorDBError, Result};
pub use filter::Filter;
pub use enums::Embedding;