pub struct RagSystem { /* private fields */ }Expand description
Local file-based RAG system
Implementations§
Source§impl RagSystem
impl RagSystem
pub async fn new(config: RagConfig) -> Result<Self>
pub async fn new_with_llm( config: RagConfig, llm_client: Option<LlmClient>, ) -> Result<Self>
pub async fn index_document(&mut self, path: PathBuf) -> Result<usize>
pub async fn index_directory(&mut self, path: PathBuf) -> Result<usize>
pub async fn index_url(&mut self, url: &str) -> Result<usize>
pub async fn index_url_deep( &mut self, url: &str, max_depth: Option<u32>, max_pages: Option<u32>, ) -> Result<usize>
Sourcepub async fn index_url_deep_stream(
&self,
url: &str,
max_depth: Option<u32>,
crawl_all: bool,
embed_concurrency: Option<usize>,
crawl_max_pages: Option<usize>,
) -> Result<usize>
pub async fn index_url_deep_stream( &self, url: &str, max_depth: Option<u32>, crawl_all: bool, embed_concurrency: Option<usize>, crawl_max_pages: Option<usize>, ) -> Result<usize>
Streamed deep indexing: overlaps crawling and embedding using Tokio for speed
pub async fn search( &self, query: &str, max_results: Option<usize>, ) -> Result<Vec<RagSearchResult>>
pub async fn get_stats(&self) -> Result<RagStats>
pub async fn clear_index(&self) -> Result<()>
pub async fn health_check(&self) -> Result<()>
Auto Trait Implementations§
impl Freeze for RagSystem
impl !RefUnwindSafe for RagSystem
impl Send for RagSystem
impl Sync for RagSystem
impl Unpin for RagSystem
impl UnsafeUnpin for RagSystem
impl !UnwindSafe for RagSystem
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more