forked from microsoft/graphrag
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathGraphRagConfig.cs
More file actions
65 lines (44 loc) · 2.06 KB
/
GraphRagConfig.cs
File metadata and controls
65 lines (44 loc) · 2.06 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
namespace GraphRag.Config;
/// <summary>
/// Represents the root configuration for the GraphRAG pipeline.
/// </summary>
public sealed class GraphRagConfig
{
public string RootDir { get; set; } = Directory.GetCurrentDirectory();
public HashSet<string> Models { get; set; } = new(StringComparer.OrdinalIgnoreCase);
public InputConfig Input { get; set; } = new();
public ChunkingConfig Chunks { get; set; } = new();
public StorageConfig Output { get; set; } = new();
public Dictionary<string, StorageConfig>? Outputs { get; set; }
= new(StringComparer.OrdinalIgnoreCase);
public StorageConfig UpdateIndexOutput { get; set; } = new()
{
BaseDir = "output/update",
Type = StorageType.File
};
public ReportingConfig Reporting { get; set; } = new();
public Dictionary<string, VectorStoreConfig> VectorStore { get; set; } = new(StringComparer.OrdinalIgnoreCase)
{
["default_vector_store"] = new VectorStoreConfig()
};
public List<string>? Workflows { get; set; }
= new();
public TextEmbeddingConfig EmbedText { get; set; } = new();
public ExtractGraphConfig ExtractGraph { get; set; } = new();
public SummarizeDescriptionsConfig SummarizeDescriptions { get; set; } = new();
public ClusterGraphConfig ClusterGraph { get; set; } = new();
public HeuristicMaintenanceConfig Heuristics { get; set; } = new();
public CommunityReportsConfig CommunityReports { get; set; } = new();
public PromptTuningConfig PromptTuning { get; set; } = new();
public SnapshotsConfig Snapshots { get; set; } = new();
public Dictionary<string, object?> Extensions { get; set; } = new(StringComparer.OrdinalIgnoreCase);
public VectorStoreConfig GetVectorStoreConfig(string vectorStoreId)
{
ArgumentException.ThrowIfNullOrWhiteSpace(vectorStoreId);
if (!VectorStore.TryGetValue(vectorStoreId, out var config))
{
throw new KeyNotFoundException($"Vector store ID '{vectorStoreId}' not found in configuration.");
}
return config;
}
}