RAG Result • Rust AI Agent SDK
RAGResult: Result of a RAG query.
RAGResult
Defined in the RAG module.
Rust AI Agent SDK
Result of a RAG query.
Fields
| Name | Type | Description |
|---|---|---|
answer | String | Generated answer |
citations | Vec<Citation> | Citations used in the answer |
context | ContextPack | Context chunks used |
tokens_used | usize | Token usage |
processing_time_ms | u64 | Processing time in milliseconds |
Methods
new
fn new(answer: impl Into<String>, context: ContextPack) -> SelfCreate a new RAG result
Parameters:
| Name | Type |
|---|---|
answer | impl Into<String> |
context | ContextPack |
add_citation
fn add_citation(&mut self, citation: Citation) -> ()Add a citation
Parameters:
| Name | Type |
|---|---|
citation | Citation |
citation_count
fn citation_count(&self) -> usizeGet the number of citations
Source
View on GitHubpraisonai/src/rag/mod.rs at line 138