pub struct Documents<'a> { /* private fields */ }Expand description
Documents resource for managing documents in collections
Implementations§
Source§impl<'a> Documents<'a>
impl<'a> Documents<'a>
Sourcepub async fn add(
&self,
collection_name: impl Into<String>,
path: impl Into<String>,
content: DocumentContent,
metadata: Option<Metadata>,
overwrite: Option<bool>,
) -> Result<DocumentResponse>
pub async fn add( &self, collection_name: impl Into<String>, path: impl Into<String>, content: DocumentContent, metadata: Option<Metadata>, overwrite: Option<bool>, ) -> Result<DocumentResponse>
Add a document to a collection
§Arguments
collection_name- Name of the collectionpath- Document path/identifiercontent- Document contentmetadata- Optional metadataoverwrite- Whether to overwrite if exists
Sourcepub async fn add_text(
&self,
collection_name: impl Into<String>,
path: impl Into<String>,
text: impl Into<String>,
metadata: Option<Metadata>,
) -> Result<DocumentResponse>
pub async fn add_text( &self, collection_name: impl Into<String>, path: impl Into<String>, text: impl Into<String>, metadata: Option<Metadata>, ) -> Result<DocumentResponse>
Add a text document
Convenience method for adding plain text documents
Sourcepub async fn add_pdf(
&self,
collection_name: impl Into<String>,
path: impl Into<String>,
base64_data: impl Into<String>,
metadata: Option<Metadata>,
) -> Result<DocumentResponse>
pub async fn add_pdf( &self, collection_name: impl Into<String>, path: impl Into<String>, base64_data: impl Into<String>, metadata: Option<Metadata>, ) -> Result<DocumentResponse>
Add a PDF document from base64 data
Convenience method for adding PDF documents with OCR
Sourcepub async fn add_pdf_file(
&self,
collection_name: impl Into<String>,
document_path: impl Into<String>,
file_path: impl AsRef<Path>,
metadata: Option<Metadata>,
) -> Result<DocumentResponse>
pub async fn add_pdf_file( &self, collection_name: impl Into<String>, document_path: impl Into<String>, file_path: impl AsRef<Path>, metadata: Option<Metadata>, ) -> Result<DocumentResponse>
Add a PDF document from file path
Reads the file and encodes it as base64
Sourcepub async fn update(
&self,
collection_name: impl Into<String>,
path: impl Into<String>,
metadata: Option<Metadata>,
index_status: Option<IndexStatus>,
) -> Result<DocumentResponse>
pub async fn update( &self, collection_name: impl Into<String>, path: impl Into<String>, metadata: Option<Metadata>, index_status: Option<IndexStatus>, ) -> Result<DocumentResponse>
Update a document’s metadata or index status
Sourcepub async fn delete(
&self,
collection_name: impl Into<String>,
path: impl Into<String>,
) -> Result<DocumentResponse>
pub async fn delete( &self, collection_name: impl Into<String>, path: impl Into<String>, ) -> Result<DocumentResponse>
Delete a document
Sourcepub async fn get_info(
&self,
collection_name: impl Into<String>,
path: impl Into<String>,
include_content: Option<bool>,
) -> Result<DocumentInfoResponse>
pub async fn get_info( &self, collection_name: impl Into<String>, path: impl Into<String>, include_content: Option<bool>, ) -> Result<DocumentInfoResponse>
Get document information
Sourcepub async fn get_info_list(
&self,
collection_name: impl Into<String>,
limit: Option<u32>,
path_gt: Option<String>,
) -> Result<DocumentInfoListResponse>
pub async fn get_info_list( &self, collection_name: impl Into<String>, limit: Option<u32>, path_gt: Option<String>, ) -> Result<DocumentInfoListResponse>
Get list of documents in a collection
Auto Trait Implementations§
impl<'a> Freeze for Documents<'a>
impl<'a> !RefUnwindSafe for Documents<'a>
impl<'a> Send for Documents<'a>
impl<'a> Sync for Documents<'a>
impl<'a> Unpin for Documents<'a>
impl<'a> !UnwindSafe for Documents<'a>
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