2626from graphrag .config .models .input_config import InputConfig
2727from graphrag .config .models .language_model_config import LanguageModelConfig
2828from graphrag .config .models .local_search_config import LocalSearchConfig
29- from graphrag .config .models .output_config import OutputConfig
3029from graphrag .config .models .prune_graph_config import PruneGraphConfig
3130from graphrag .config .models .reporting_config import ReportingConfig
3231from graphrag .config .models .snapshots_config import SnapshotsConfig
32+ from graphrag .config .models .storage_config import StorageConfig
3333from graphrag .config .models .summarize_descriptions_config import (
3434 SummarizeDescriptionsConfig ,
3535)
@@ -102,29 +102,39 @@ def _validate_input_pattern(self) -> None:
102102 else :
103103 self .input .file_pattern = f".*\\ .{ self .input .file_type .value } $"
104104
105+ def _validate_input_base_dir (self ) -> None :
106+ """Validate the input base directory."""
107+ if self .input .storage .type == defs .StorageType .file :
108+ if self .input .storage .base_dir .strip () == "" :
109+ msg = "input storage base directory is required for file input storage. Please rerun `graphrag init` and set the input storage configuration."
110+ raise ValueError (msg )
111+ self .input .storage .base_dir = str (
112+ (Path (self .root_dir ) / self .input .storage .base_dir ).resolve ()
113+ )
114+
105115 chunks : ChunkingConfig = Field (
106116 description = "The chunking configuration to use." ,
107117 default = ChunkingConfig (),
108118 )
109119 """The chunking configuration to use."""
110120
111- output : OutputConfig = Field (
121+ output : StorageConfig = Field (
112122 description = "The output configuration." ,
113- default = OutputConfig (),
123+ default = StorageConfig (),
114124 )
115125 """The output configuration."""
116126
117127 def _validate_output_base_dir (self ) -> None :
118128 """Validate the output base directory."""
119- if self .output .type == defs .OutputType .file :
129+ if self .output .type == defs .StorageType .file :
120130 if self .output .base_dir .strip () == "" :
121131 msg = "output base directory is required for file output. Please rerun `graphrag init` and set the output configuration."
122132 raise ValueError (msg )
123133 self .output .base_dir = str (
124134 (Path (self .root_dir ) / self .output .base_dir ).resolve ()
125135 )
126136
127- outputs : dict [str , OutputConfig ] | None = Field (
137+ outputs : dict [str , StorageConfig ] | None = Field (
128138 description = "A list of output configurations used for multi-index query." ,
129139 default = graphrag_config_defaults .outputs ,
130140 )
@@ -133,26 +143,25 @@ def _validate_multi_output_base_dirs(self) -> None:
133143 """Validate the outputs dict base directories."""
134144 if self .outputs :
135145 for output in self .outputs .values ():
136- if output .type == defs .OutputType .file :
146+ if output .type == defs .StorageType .file :
137147 if output .base_dir .strip () == "" :
138148 msg = "Output base directory is required for file output. Please rerun `graphrag init` and set the output configuration."
139149 raise ValueError (msg )
140150 output .base_dir = str (
141151 (Path (self .root_dir ) / output .base_dir ).resolve ()
142152 )
143153
144- update_index_output : OutputConfig = Field (
154+ update_index_output : StorageConfig = Field (
145155 description = "The output configuration for the updated index." ,
146- default = OutputConfig (
147- type = graphrag_config_defaults .update_index_output .type ,
156+ default = StorageConfig (
148157 base_dir = graphrag_config_defaults .update_index_output .base_dir ,
149158 ),
150159 )
151160 """The output configuration for the updated index."""
152161
153162 def _validate_update_index_output_base_dir (self ) -> None :
154163 """Validate the update index output base directory."""
155- if self .update_index_output .type == defs .OutputType .file :
164+ if self .update_index_output .type == defs .StorageType .file :
156165 if self .update_index_output .base_dir .strip () == "" :
157166 msg = "update_index_output base directory is required for file output. Please rerun `graphrag init` and set the update_index_output configuration."
158167 raise ValueError (msg )
@@ -345,6 +354,7 @@ def _validate_model(self):
345354 self ._validate_root_dir ()
346355 self ._validate_models ()
347356 self ._validate_input_pattern ()
357+ self ._validate_input_base_dir ()
348358 self ._validate_reporting_base_dir ()
349359 self ._validate_output_base_dir ()
350360 self ._validate_multi_output_base_dirs ()
0 commit comments