pub struct AsyncGraphRAG { /* private fields */ }Expand description
Async version of the main GraphRAG system
Implementations§
Source§impl AsyncGraphRAG
impl AsyncGraphRAG
Sourcepub async fn with_hierarchical_config(
config: Config,
hierarchical_config: HierarchicalConfig,
) -> Result<Self>
pub async fn with_hierarchical_config( config: Config, hierarchical_config: HierarchicalConfig, ) -> Result<Self>
Create with custom hierarchical configuration
Sourcepub async fn set_language_model(&mut self, model: Arc<BoxedAsyncLanguageModel>)
pub async fn set_language_model(&mut self, model: Arc<BoxedAsyncLanguageModel>)
Set the async language model
Sourcepub async fn initialize(&mut self) -> Result<()>
pub async fn initialize(&mut self) -> Result<()>
Initialize the async GraphRAG system
Sourcepub async fn add_document(&mut self, document: Document) -> Result<()>
pub async fn add_document(&mut self, document: Document) -> Result<()>
Add a document to the system asynchronously
Sourcepub async fn build_document_tree(&mut self, document: &Document) -> Result<()>
pub async fn build_document_tree(&mut self, document: &Document) -> Result<()>
Build hierarchical tree for a document asynchronously
Sourcepub async fn build_graph(&mut self) -> Result<()>
pub async fn build_graph(&mut self) -> Result<()>
Build the knowledge graph from documents asynchronously
Sourcepub async fn answer_question(&self, question: &str) -> Result<GeneratedAnswer>
pub async fn answer_question(&self, question: &str) -> Result<GeneratedAnswer>
Generate an answer to a question using async pipeline
Sourcepub async fn hierarchical_query(
&self,
query: &str,
max_results: usize,
) -> Result<Vec<QueryResult>>
pub async fn hierarchical_query( &self, query: &str, max_results: usize, ) -> Result<Vec<QueryResult>>
Query using hierarchical summarization asynchronously
Sourcepub async fn add_documents_batch(
&mut self,
documents: Vec<Document>,
) -> Result<()>
pub async fn add_documents_batch( &mut self, documents: Vec<Document>, ) -> Result<()>
Batch process multiple documents concurrently
Sourcepub async fn answer_questions_batch(
&self,
questions: &[&str],
) -> Result<Vec<GeneratedAnswer>>
pub async fn answer_questions_batch( &self, questions: &[&str], ) -> Result<Vec<GeneratedAnswer>>
Batch answer multiple questions concurrently
Sourcepub async fn get_performance_stats(&self) -> AsyncPerformanceStats
pub async fn get_performance_stats(&self) -> AsyncPerformanceStats
Get performance statistics
Sourcepub async fn health_check(&self) -> Result<AsyncHealthStatus>
pub async fn health_check(&self) -> Result<AsyncHealthStatus>
Health check for all async components
Sourcepub async fn save_state_async(&self, output_dir: &str) -> Result<()>
pub async fn save_state_async(&self, output_dir: &str) -> Result<()>
Save state asynchronously
Auto Trait Implementations§
impl Freeze for AsyncGraphRAG
impl !RefUnwindSafe for AsyncGraphRAG
impl Send for AsyncGraphRAG
impl Sync for AsyncGraphRAG
impl Unpin for AsyncGraphRAG
impl UnsafeUnpin for AsyncGraphRAG
impl !UnwindSafe for AsyncGraphRAG
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