pub struct VectorDBClient { /* private fields */ }
Expand description
VectorDB gRPC client
Implementations§
Source§impl VectorDBClient
impl VectorDBClient
Sourcepub async fn new(config: ClientConfig) -> Result<Self>
pub async fn new(config: ClientConfig) -> Result<Self>
Create a new VectorDB client with the given configuration
Sourcepub async fn connect<S: Into<String>>(address: S) -> Result<Self>
pub async fn connect<S: Into<String>>(address: S) -> Result<Self>
Create a new client connected to the given address
Sourcepub async fn get_server_info(&mut self) -> Result<ServerInfo>
pub async fn get_server_info(&mut self) -> Result<ServerInfo>
Get server information
Sourcepub async fn create_collection(
&mut self,
name: String,
vector_size: i32,
distance: String,
) -> Result<StatusResponse>
pub async fn create_collection( &mut self, name: String, vector_size: i32, distance: String, ) -> Result<StatusResponse>
Create a new collection
Sourcepub async fn list_collections(&mut self) -> Result<ListCollectionsResponse>
pub async fn list_collections(&mut self) -> Result<ListCollectionsResponse>
List all collections
Sourcepub async fn delete_collection(
&mut self,
name: String,
) -> Result<StatusResponse>
pub async fn delete_collection( &mut self, name: String, ) -> Result<StatusResponse>
Delete a collection
Sourcepub async fn clear_collection(&mut self, name: String) -> Result<StatusResponse>
pub async fn clear_collection(&mut self, name: String) -> Result<StatusResponse>
Clear a collection (delete and recreate empty)
Sourcepub async fn index_files(
&mut self,
collection_name: String,
paths: Vec<String>,
extensions: Vec<String>,
) -> Result<IndexResponse>
pub async fn index_files( &mut self, collection_name: String, paths: Vec<String>, extensions: Vec<String>, ) -> Result<IndexResponse>
Index files or directories into a collection
Sourcepub async fn query_collection(
&mut self,
collection_name: String,
query_text: String,
limit: i32,
language: Option<String>,
element_type: Option<String>,
) -> Result<QueryResponse>
pub async fn query_collection( &mut self, collection_name: String, query_text: String, limit: i32, language: Option<String>, element_type: Option<String>, ) -> Result<QueryResponse>
Query a collection for similar documents
Sourcepub async fn add_repository(
&mut self,
url: String,
local_path: Option<String>,
name: Option<String>,
branch: Option<String>,
remote: Option<String>,
ssh_key_path: Option<String>,
ssh_passphrase: Option<String>,
) -> Result<StatusResponse>
pub async fn add_repository( &mut self, url: String, local_path: Option<String>, name: Option<String>, branch: Option<String>, remote: Option<String>, ssh_key_path: Option<String>, ssh_passphrase: Option<String>, ) -> Result<StatusResponse>
Add a repository to be managed
Sourcepub async fn list_repositories(&mut self) -> Result<ListRepositoriesResponse>
pub async fn list_repositories(&mut self) -> Result<ListRepositoriesResponse>
List all managed repositories
Sourcepub async fn use_repository(&mut self, name: String) -> Result<StatusResponse>
pub async fn use_repository(&mut self, name: String) -> Result<StatusResponse>
Set the active repository
Sourcepub async fn remove_repository(
&mut self,
name: String,
skip_confirmation: bool,
) -> Result<StatusResponse>
pub async fn remove_repository( &mut self, name: String, skip_confirmation: bool, ) -> Result<StatusResponse>
Remove a repository
Sourcepub async fn sync_repository(
&mut self,
name: Option<String>,
extensions: Vec<String>,
force: bool,
) -> Result<StatusResponse>
pub async fn sync_repository( &mut self, name: Option<String>, extensions: Vec<String>, force: bool, ) -> Result<StatusResponse>
Synchronize a repository
Sourcepub async fn use_branch(
&mut self,
branch_name: String,
repository_name: Option<String>,
) -> Result<StatusResponse>
pub async fn use_branch( &mut self, branch_name: String, repository_name: Option<String>, ) -> Result<StatusResponse>
Set the active branch
Sourcepub async fn edit_file_by_lines(
&mut self,
file_path: String,
start_line: u32,
end_line: u32,
content: String,
format: bool,
update_references: bool,
) -> Result<EditCodeResponse>
pub async fn edit_file_by_lines( &mut self, file_path: String, start_line: u32, end_line: u32, content: String, format: bool, update_references: bool, ) -> Result<EditCodeResponse>
Apply an edit to a file using line-based targeting
Sourcepub async fn edit_file_by_element(
&mut self,
file_path: String,
element_query: String,
content: String,
format: bool,
update_references: bool,
) -> Result<EditCodeResponse>
pub async fn edit_file_by_element( &mut self, file_path: String, element_query: String, content: String, format: bool, update_references: bool, ) -> Result<EditCodeResponse>
Apply an edit to a file using semantic element targeting
Sourcepub async fn validate_edit_by_lines(
&mut self,
file_path: String,
start_line: u32,
end_line: u32,
content: String,
format: bool,
update_references: bool,
) -> Result<Vec<ValidationIssueInfo>>
pub async fn validate_edit_by_lines( &mut self, file_path: String, start_line: u32, end_line: u32, content: String, format: bool, update_references: bool, ) -> Result<Vec<ValidationIssueInfo>>
Validate an edit without applying it (line-based targeting)
Sourcepub async fn validate_edit_by_element(
&mut self,
file_path: String,
element_query: String,
content: String,
format: bool,
update_references: bool,
) -> Result<Vec<ValidationIssueInfo>>
pub async fn validate_edit_by_element( &mut self, file_path: String, element_query: String, content: String, format: bool, update_references: bool, ) -> Result<Vec<ValidationIssueInfo>>
Validate an edit without applying it (semantic element targeting)
Auto Trait Implementations§
impl !Freeze for VectorDBClient
impl !RefUnwindSafe for VectorDBClient
impl Send for VectorDBClient
impl Sync for VectorDBClient
impl Unpin for VectorDBClient
impl !UnwindSafe for VectorDBClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request