1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! Level 1: Simple one-function API for absolute beginners
//!
//! This module provides the simplest possible interface to GraphRAG,
//! allowing users to get started with a single function call.
use crate::;
/// Answer a question about a document with one function call
///
/// This is the simplest way to use GraphRAG. Just provide text content
/// and a question, and get back an answer.
///
/// # Examples
///
/// ```rust
/// use graphrag_rs::simple::answer;
///
/// let text = "The quick brown fox jumps over the lazy dog.";
/// let response = answer(text, "What animal jumps?").unwrap();
/// println!("{}", response);
/// ```
/// Answer a question about a file with one function call
///
/// # Examples
///
/// ```rust,no_run
/// use graphrag_rs::simple::answer_file;
///
/// let response = answer_file("document.txt", "What is this about?").unwrap();
/// println!("{}", response);
/// ```