VectorizerClient

Struct VectorizerClient 

Source
pub struct VectorizerClient { /* private fields */ }
Expand description

Vectorizer client with optional master/replica topology support

Implementations§

Source§

impl VectorizerClient

Source

pub fn base_url(&self) -> &str

Get the base URL (for HTTP transport)

Source

pub fn new(config: ClientConfig) -> Result<Self>

Create a new client with configuration

Source

pub fn new_default() -> Result<Self>

Create a new client with default configuration

Source

pub fn new_with_url(base_url: &str) -> Result<Self>

Create client with custom URL

Source

pub fn new_with_api_key(base_url: &str, api_key: &str) -> Result<Self>

Create client with API key

Source

pub fn from_connection_string( connection_string: &str, api_key: Option<&str>, ) -> Result<Self>

Create client from connection string

Source

pub fn protocol(&self) -> Protocol

Get the current protocol being used

Source

pub async fn with_master<F, Fut, T>(&self, callback: F) -> Result<T>
where F: FnOnce(VectorizerClient) -> Fut, Fut: Future<Output = Result<T>>,

Execute a callback with master transport for read-your-writes scenarios. All operations within the callback will be routed to master.

Source

pub async fn health_check(&self) -> Result<HealthStatus>

Health check

Source

pub async fn list_collections(&self) -> Result<Vec<Collection>>

List collections

Source

pub async fn search_vectors( &self, collection: &str, query: &str, limit: Option<usize>, score_threshold: Option<f32>, ) -> Result<SearchResponse>

Search vectors

Intelligent search with multi-query expansion and semantic reranking

Semantic search with advanced reranking and similarity thresholds

Context-aware search with metadata filtering and contextual reranking

Multi-collection search with cross-collection reranking and aggregation

Perform hybrid search combining dense and sparse vectors

Source

pub async fn qdrant_list_collections(&self) -> Result<Value>

List all collections (Qdrant-compatible API)

Source

pub async fn qdrant_get_collection(&self, name: &str) -> Result<Value>

Get collection information (Qdrant-compatible API)

Source

pub async fn qdrant_create_collection( &self, name: &str, config: &Value, ) -> Result<Value>

Create collection (Qdrant-compatible API)

Source

pub async fn qdrant_upsert_points( &self, collection: &str, points: &Value, wait: bool, ) -> Result<Value>

Upsert points to collection (Qdrant-compatible API)

Source

pub async fn qdrant_search_points( &self, collection: &str, vector: &[f32], limit: Option<usize>, filter: Option<&Value>, with_payload: bool, with_vector: bool, ) -> Result<Value>

Search points in collection (Qdrant-compatible API)

Source

pub async fn qdrant_delete_points( &self, collection: &str, point_ids: &[Value], wait: bool, ) -> Result<Value>

Delete points from collection (Qdrant-compatible API)

Source

pub async fn qdrant_retrieve_points( &self, collection: &str, point_ids: &[Value], with_payload: bool, with_vector: bool, ) -> Result<Value>

Retrieve points by IDs (Qdrant-compatible API)

Source

pub async fn qdrant_count_points( &self, collection: &str, filter: Option<&Value>, ) -> Result<Value>

Count points in collection (Qdrant-compatible API)

Source

pub async fn qdrant_list_collection_snapshots( &self, collection: &str, ) -> Result<Value>

List snapshots for a collection (Qdrant-compatible API)

Source

pub async fn qdrant_create_collection_snapshot( &self, collection: &str, ) -> Result<Value>

Create snapshot for a collection (Qdrant-compatible API)

Source

pub async fn qdrant_delete_collection_snapshot( &self, collection: &str, snapshot_name: &str, ) -> Result<Value>

Delete snapshot (Qdrant-compatible API)

Source

pub async fn qdrant_recover_collection_snapshot( &self, collection: &str, location: &str, ) -> Result<Value>

Recover collection from snapshot (Qdrant-compatible API)

Source

pub async fn qdrant_list_all_snapshots(&self) -> Result<Value>

List all snapshots (Qdrant-compatible API)

Source

pub async fn qdrant_create_full_snapshot(&self) -> Result<Value>

Create full snapshot (Qdrant-compatible API)

Source

pub async fn qdrant_list_shard_keys(&self, collection: &str) -> Result<Value>

List shard keys for a collection (Qdrant-compatible API)

Source

pub async fn qdrant_create_shard_key( &self, collection: &str, shard_key: &Value, ) -> Result<Value>

Create shard key (Qdrant-compatible API)

Source

pub async fn qdrant_delete_shard_key( &self, collection: &str, shard_key: &Value, ) -> Result<Value>

Delete shard key (Qdrant-compatible API)

Source

pub async fn qdrant_get_cluster_status(&self) -> Result<Value>

Get cluster status (Qdrant-compatible API)

Source

pub async fn qdrant_cluster_recover(&self) -> Result<Value>

Recover current peer (Qdrant-compatible API)

Source

pub async fn qdrant_remove_peer(&self, peer_id: &str) -> Result<Value>

Remove peer from cluster (Qdrant-compatible API)

Source

pub async fn qdrant_list_metadata_keys(&self) -> Result<Value>

List metadata keys (Qdrant-compatible API)

Source

pub async fn qdrant_get_metadata_key(&self, key: &str) -> Result<Value>

Get metadata key (Qdrant-compatible API)

Source

pub async fn qdrant_update_metadata_key( &self, key: &str, value: &Value, ) -> Result<Value>

Update metadata key (Qdrant-compatible API)

Source

pub async fn qdrant_query_points( &self, collection: &str, request: &Value, ) -> Result<Value>

Query points (Qdrant 1.7+ Query API)

Source

pub async fn qdrant_batch_query_points( &self, collection: &str, request: &Value, ) -> Result<Value>

Batch query points (Qdrant 1.7+ Query API)

Source

pub async fn qdrant_query_points_groups( &self, collection: &str, request: &Value, ) -> Result<Value>

Query points with groups (Qdrant 1.7+ Query API)

Source

pub async fn qdrant_search_points_groups( &self, collection: &str, request: &Value, ) -> Result<Value>

Search points with groups (Qdrant Search Groups API)

Source

pub async fn qdrant_search_matrix_pairs( &self, collection: &str, request: &Value, ) -> Result<Value>

Search matrix pairs (Qdrant Search Matrix API)

Source

pub async fn qdrant_search_matrix_offsets( &self, collection: &str, request: &Value, ) -> Result<Value>

Search matrix offsets (Qdrant Search Matrix API)

Source

pub async fn create_collection( &self, name: &str, dimension: usize, metric: Option<SimilarityMetric>, ) -> Result<CollectionInfo>

Create collection

Source

pub async fn insert_texts( &self, collection: &str, texts: Vec<BatchTextRequest>, ) -> Result<BatchResponse>

Insert texts

Source

pub async fn delete_collection(&self, name: &str) -> Result<()>

Delete collection

Source

pub async fn get_vector( &self, collection: &str, vector_id: &str, ) -> Result<Vector>

Get vector

Source

pub async fn get_collection_info( &self, collection: &str, ) -> Result<CollectionInfo>

Get collection info

Source

pub async fn embed_text( &self, text: &str, model: Option<&str>, ) -> Result<EmbeddingResponse>

Generate embeddings

Source

pub async fn discover( &self, query: &str, include_collections: Option<Vec<String>>, exclude_collections: Option<Vec<String>>, max_bullets: Option<usize>, broad_k: Option<usize>, focus_k: Option<usize>, ) -> Result<Value>

Complete discovery pipeline with intelligent search and prompt generation

Source

pub async fn filter_collections( &self, query: &str, include: Option<Vec<String>>, exclude: Option<Vec<String>>, ) -> Result<Value>

Pre-filter collections by name patterns

Source

pub async fn score_collections( &self, query: &str, name_match_weight: Option<f32>, term_boost_weight: Option<f32>, signal_boost_weight: Option<f32>, ) -> Result<Value>

Rank collections by relevance

Source

pub async fn expand_queries( &self, query: &str, max_expansions: Option<usize>, include_definition: Option<bool>, include_features: Option<bool>, include_architecture: Option<bool>, ) -> Result<Value>

Generate query variations

Source

pub async fn get_file_content( &self, collection: &str, file_path: &str, max_size_kb: Option<usize>, ) -> Result<Value>

Retrieve complete file content from a collection

Source

pub async fn list_files_in_collection( &self, collection: &str, filter_by_type: Option<Vec<String>>, min_chunks: Option<usize>, max_results: Option<usize>, sort_by: Option<&str>, ) -> Result<Value>

List all indexed files in a collection

Source

pub async fn get_file_summary( &self, collection: &str, file_path: &str, summary_type: Option<&str>, max_sentences: Option<usize>, ) -> Result<Value>

Get extractive or structural summary of an indexed file

Source

pub async fn get_file_chunks_ordered( &self, collection: &str, file_path: &str, start_chunk: Option<usize>, limit: Option<usize>, include_context: Option<bool>, ) -> Result<Value>

Retrieve chunks in original file order for progressive reading

Source

pub async fn get_project_outline( &self, collection: &str, max_depth: Option<usize>, include_summaries: Option<bool>, highlight_key_files: Option<bool>, ) -> Result<Value>

Generate hierarchical project structure overview

Find semantically related files using vector similarity

Source

pub async fn search_by_file_type( &self, collection: &str, query: &str, file_types: Vec<String>, limit: Option<usize>, return_full_files: Option<bool>, ) -> Result<Value>

Semantic search filtered by file type

Source

pub async fn list_graph_nodes( &self, collection: &str, ) -> Result<ListNodesResponse>

List all nodes in a collection’s graph

Source

pub async fn get_graph_neighbors( &self, collection: &str, node_id: &str, ) -> Result<GetNeighborsResponse>

Get neighbors of a specific node

Find related nodes within N hops

Source

pub async fn find_graph_path( &self, request: FindPathRequest, ) -> Result<FindPathResponse>

Find shortest path between two nodes

Source

pub async fn create_graph_edge( &self, request: CreateEdgeRequest, ) -> Result<CreateEdgeResponse>

Create an explicit edge between two nodes

Source

pub async fn delete_graph_edge(&self, edge_id: &str) -> Result<()>

Delete an edge by ID

Source

pub async fn list_graph_edges( &self, collection: &str, ) -> Result<ListEdgesResponse>

List all edges in a collection

Source

pub async fn discover_graph_edges( &self, collection: &str, request: DiscoverEdgesRequest, ) -> Result<DiscoverEdgesResponse>

Discover SIMILAR_TO edges for entire collection

Source

pub async fn discover_graph_edges_for_node( &self, collection: &str, node_id: &str, request: DiscoverEdgesRequest, ) -> Result<DiscoverEdgesResponse>

Discover SIMILAR_TO edges for a specific node

Source

pub async fn get_graph_discovery_status( &self, collection: &str, ) -> Result<DiscoveryStatusResponse>

Get discovery status for a collection

Source

pub async fn upload_file( &self, file_bytes: Vec<u8>, filename: &str, collection_name: &str, options: UploadFileOptions, ) -> Result<FileUploadResponse>

Upload a file for automatic text extraction, chunking, and indexing.

§Arguments
  • file_bytes - File content as bytes
  • filename - Name of the file (used for extension detection)
  • collection_name - Target collection name
  • options - Upload options (chunk size, overlap, metadata)
§Example
use vectorizer_sdk::{VectorizerClient, ClientConfig, UploadFileOptions};
use std::collections::HashMap;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let config = ClientConfig::default();
    let client = VectorizerClient::new(config)?;

    let file_bytes = std::fs::read("document.pdf")?;
    let options = UploadFileOptions::default();

    let response = client.upload_file(
        file_bytes,
        "document.pdf",
        "my-docs",
        options
    ).await?;

    println!("Uploaded: {} chunks created", response.chunks_created);
    Ok(())
}
Source

pub async fn upload_file_content( &self, content: &str, filename: &str, collection_name: &str, options: UploadFileOptions, ) -> Result<FileUploadResponse>

Upload file content directly as a string.

This is a convenience method that accepts text content directly instead of file bytes.

§Arguments
  • content - File content as string
  • filename - Name of the file (used for extension detection)
  • collection_name - Target collection name
  • options - Upload options (chunk size, overlap, metadata)
§Example
use vectorizer_sdk::{VectorizerClient, ClientConfig, UploadFileOptions};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let config = ClientConfig::default();
    let client = VectorizerClient::new(config)?;

    let code = r#"fn main() { println!("Hello!"); }"#;
    let options = UploadFileOptions::default();

    let response = client.upload_file_content(
        code,
        "main.rs",
        "rust-code",
        options
    ).await?;

    println!("Uploaded: {} vectors created", response.vectors_created);
    Ok(())
}
Source

pub async fn get_upload_config(&self) -> Result<FileUploadConfig>

Get file upload configuration from the server.

Returns the maximum file size, allowed extensions, and default chunk settings.

§Example
use vectorizer_sdk::{VectorizerClient, ClientConfig};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let config = ClientConfig::default();
    let client = VectorizerClient::new(config)?;

    let upload_config = client.get_upload_config().await?;
    println!("Max file size: {}MB", upload_config.max_file_size_mb);
    println!("Allowed extensions: {:?}", upload_config.allowed_extensions);
    Ok(())
}

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,