Documentation Index
Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
Citation
Defined in the RAG module.
Rust AI Agent SDK
A citation referencing a source document.
Fields
| Name | Type | Description |
|---|
id | String | Citation ID (e.g., “[1]“) |
source | String | Source document or URL |
text | String | Relevant text snippet |
page | Option<u32> | Page number if applicable |
score | Option<f32> | Relevance score (0.0 to 1.0) |
metadata | HashMap<String | Additional metadata |
Methods
new
fn new(id: impl Into<String>, source: impl Into<String>, text: impl Into<String>) -> Self
Create a new citation
Parameters:
| Name | Type |
|---|
id | impl Into<String> |
source | impl Into<String> |
text | impl Into<String> |
page
fn page(mut self, page: u32) -> Self
Set the page number
Parameters:
score
fn score(mut self, score: f32) -> Self
Set the relevance score
Parameters:
fn metadata(mut self, key: impl Into<String>, value: impl Into<String>) -> Self
Add metadata
Parameters:
| Name | Type |
|---|
key | impl Into<String> |
value | impl Into<String> |
Source
View on GitHub
praisonai/src/rag/mod.rs at line 34