pub struct VectorizerClient { /* private fields */ }
Expand description
Simplified client for Vectorizer
Implementations§
Source§impl VectorizerClient
impl VectorizerClient
Sourcepub fn new_default() -> Result<Self>
pub fn new_default() -> Result<Self>
Create a new client
Sourcepub fn new_with_url(base_url: &str) -> Result<Self>
pub fn new_with_url(base_url: &str) -> Result<Self>
Create client with custom URL
Sourcepub fn new_with_api_key(base_url: &str, api_key: &str) -> Result<Self>
pub fn new_with_api_key(base_url: &str, api_key: &str) -> Result<Self>
Create client with API key
Sourcepub async fn health_check(&self) -> Result<HealthStatus>
pub async fn health_check(&self) -> Result<HealthStatus>
Health check
Sourcepub async fn list_collections(&self) -> Result<Vec<CollectionInfo>>
pub async fn list_collections(&self) -> Result<Vec<CollectionInfo>>
List collections
Sourcepub async fn search_vectors(
&self,
collection: &str,
query: &str,
limit: Option<usize>,
score_threshold: Option<f32>,
) -> Result<SearchResponse>
pub async fn search_vectors( &self, collection: &str, query: &str, limit: Option<usize>, score_threshold: Option<f32>, ) -> Result<SearchResponse>
Search vectors
Sourcepub async fn create_collection(
&self,
name: &str,
dimension: usize,
metric: Option<SimilarityMetric>,
) -> Result<CollectionInfo>
pub async fn create_collection( &self, name: &str, dimension: usize, metric: Option<SimilarityMetric>, ) -> Result<CollectionInfo>
Create collection
Sourcepub async fn insert_texts(
&self,
collection: &str,
texts: Vec<BatchTextRequest>,
) -> Result<BatchResponse>
pub async fn insert_texts( &self, collection: &str, texts: Vec<BatchTextRequest>, ) -> Result<BatchResponse>
Insert texts
Sourcepub async fn delete_collection(&self, name: &str) -> Result<()>
pub async fn delete_collection(&self, name: &str) -> Result<()>
Delete collection
Sourcepub async fn get_vector(
&self,
collection: &str,
vector_id: &str,
) -> Result<Vector>
pub async fn get_vector( &self, collection: &str, vector_id: &str, ) -> Result<Vector>
Get vector
Sourcepub async fn get_collection_info(
&self,
collection: &str,
) -> Result<CollectionInfo>
pub async fn get_collection_info( &self, collection: &str, ) -> Result<CollectionInfo>
Get collection info
Sourcepub async fn embed_text(
&self,
text: &str,
model: Option<&str>,
) -> Result<EmbeddingResponse>
pub async fn embed_text( &self, text: &str, model: Option<&str>, ) -> Result<EmbeddingResponse>
Generate embeddings
Auto Trait Implementations§
impl Freeze for VectorizerClient
impl !RefUnwindSafe for VectorizerClient
impl Send for VectorizerClient
impl Sync for VectorizerClient
impl Unpin for VectorizerClient
impl !UnwindSafe for VectorizerClient
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