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
//! # vectordb-client
//!
//! Client library for interacting with the VectorDB semantic code search service.
//! This crate provides a gRPC client for connecting to the VectorDB server and
//! performing operations such as indexing code, searching, repository management,
//! and semantic code editing.
//!
//! ## Usage
//!
//! ```rust,no_run
//! use vectordb_client::VectorDBClient;
//! use std::error::Error;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn Error>> {
//! // Create a client with default configuration (localhost:50051)
//! let mut client = VectorDBClient::default().await?;
//!
//! // Get server info
//! let server_info = client.get_server_info().await?;
//! println!("Connected to server version: {}", server_info.version);
//!
//! // List collections
//! let collections = client.list_collections().await?;
//! println!("Available collections:");
//! for collection in collections.collections {
//! println!(" - {}", collection);
//! }
//!
//! Ok(())
//! }
//! ```
//!
//! ## Code Editing Features
//!
//! The client supports semantic code editing with both line-based and element-based targeting:
//!
//! ```rust,no_run
//! use vectordb_client::VectorDBClient;
//! use std::error::Error;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn Error>> {
//! let mut client = VectorDBClient::default().await?;
//!
//! // Edit a function by element name
//! let result = client.edit_file_by_element(
//! "src/main.rs".to_string(),
//! "function:process_data".to_string(),
//! "fn process_data(input: &str) -> String {\n format!(\"processed: {}\", input)\n}".to_string(),
//! true, // format code
//! false, // don't update references
//! ).await?;
//!
//! if result.success {
//! println!("Edit applied successfully");
//! } else {
//! println!("Edit failed: {}", result.error_message.unwrap_or_default());
//! }
//!
//! Ok(())
//! }
//! ```
pub use VectorDBClient;
pub use ClientConfig;
pub use ;
// Re-export messages from the proto crate for convenience
pub use ;
// Re-export editing types
pub use ;
pub use ;