pub struct ContextLiteClient { /* private fields */ }
Expand description
The main ContextLite client
Implementations§
Source§impl ContextLiteClient
impl ContextLiteClient
Sourcepub fn new(base_url: impl Into<String>) -> Result<Self>
pub fn new(base_url: impl Into<String>) -> Result<Self>
Create a new ContextLite client with default configuration
Sourcepub fn with_config(config: ClientConfig) -> Result<Self>
pub fn with_config(config: ClientConfig) -> Result<Self>
Create a new ContextLite client with custom configuration
Sourcepub async fn health(&self) -> Result<CompleteHealthStatus>
pub async fn health(&self) -> Result<CompleteHealthStatus>
Check server health status
Sourcepub async fn storage_info(&self) -> Result<StorageInfo>
pub async fn storage_info(&self) -> Result<StorageInfo>
Get storage information
Sourcepub async fn add_document(&self, document: &Document) -> Result<String>
pub async fn add_document(&self, document: &Document) -> Result<String>
Add a document to the index
Sourcepub async fn add_documents(&self, documents: &[Document]) -> Result<Vec<String>>
pub async fn add_documents(&self, documents: &[Document]) -> Result<Vec<String>>
Add multiple documents in batch
Sourcepub async fn get_document(&self, id: &str) -> Result<Document>
pub async fn get_document(&self, id: &str) -> Result<Document>
Get a document by ID
Sourcepub async fn update_document(&self, id: &str, document: &Document) -> Result<()>
pub async fn update_document(&self, id: &str, document: &Document) -> Result<()>
Update a document
Sourcepub async fn delete_document(&self, id: &str) -> Result<()>
pub async fn delete_document(&self, id: &str) -> Result<()>
Delete a document by ID
Sourcepub async fn search(&self, query: &SearchQuery) -> Result<SearchResponse>
pub async fn search(&self, query: &SearchQuery) -> Result<SearchResponse>
Search for documents
Sourcepub async fn assemble_context(
&self,
request: &ContextRequest,
) -> Result<ContextResponse>
pub async fn assemble_context( &self, request: &ContextRequest, ) -> Result<ContextResponse>
Assemble context from documents
Sourcepub async fn clear_documents(&self) -> Result<()>
pub async fn clear_documents(&self) -> Result<()>
Clear all documents from the index
Sourcepub fn config(&self) -> &ClientConfig
pub fn config(&self) -> &ClientConfig
Get the current client configuration
Trait Implementations§
Source§impl Clone for ContextLiteClient
impl Clone for ContextLiteClient
Source§fn clone(&self) -> ContextLiteClient
fn clone(&self) -> ContextLiteClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ContextLiteClient
impl Debug for ContextLiteClient
Auto Trait Implementations§
impl Freeze for ContextLiteClient
impl !RefUnwindSafe for ContextLiteClient
impl Send for ContextLiteClient
impl Sync for ContextLiteClient
impl Unpin for ContextLiteClient
impl !UnwindSafe for ContextLiteClient
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