Skip to main content

sqlite_graphrag/cli/
value_enums.rs

1//! `ValueEnum` types shared across subcommand argument structs.
2
3/// Graph export format.
4#[derive(Copy, Clone, Debug, PartialEq, Eq, clap::ValueEnum)]
5pub enum GraphExportFormat {
6    /// JSON variant.
7    Json,
8    /// DOT variant.
9    Dot,
10    /// Mermaid variant.
11    Mermaid,
12    /// Stream one JSON object per entity, then one per edge, then a summary line.
13    Ndjson,
14}
15
16/// Memory type.
17#[derive(Copy, Clone, Debug, Default, clap::ValueEnum)]
18pub enum MemoryType {
19    /// User variant.
20    User,
21    /// Feedback variant.
22    Feedback,
23    /// Project variant.
24    Project,
25    /// Reference variant.
26    Reference,
27    /// Decision variant.
28    Decision,
29    /// Incident variant.
30    Incident,
31    /// Skill variant.
32    Skill,
33    /// Document variant.
34    #[default]
35    Document,
36    /// Note variant.
37    Note,
38}
39
40impl MemoryType {
41    /// Return the canonical string representation.
42    pub fn as_str(&self) -> &'static str {
43        match self {
44            Self::User => "user",
45            Self::Feedback => "feedback",
46            Self::Project => "project",
47            Self::Reference => "reference",
48            Self::Decision => "decision",
49            Self::Incident => "incident",
50            Self::Skill => "skill",
51            Self::Document => "document",
52            Self::Note => "note",
53        }
54    }
55}