|
23 | 23 | from graphrag.config.models.input_config import InputConfig |
24 | 24 | from graphrag.config.models.language_model_config import LanguageModelConfig |
25 | 25 | from graphrag.config.models.local_search_config import LocalSearchConfig |
| 26 | +from graphrag.config.models.output_config import OutputConfig |
26 | 27 | from graphrag.config.models.reporting_config import ReportingConfig |
27 | 28 | from graphrag.config.models.snapshots_config import SnapshotsConfig |
28 | | -from graphrag.config.models.storage_config import StorageConfig |
29 | 29 | from graphrag.config.models.summarize_descriptions_config import ( |
30 | 30 | SummarizeDescriptionsConfig, |
31 | 31 | ) |
@@ -99,38 +99,38 @@ def _validate_reporting_base_dir(self) -> None: |
99 | 99 | (Path(self.root_dir) / self.reporting.base_dir).resolve() |
100 | 100 | ) |
101 | 101 |
|
102 | | - storage: StorageConfig = Field( |
103 | | - description="The storage configuration.", default=StorageConfig() |
| 102 | + output: OutputConfig = Field( |
| 103 | + description="The output configuration.", default=OutputConfig() |
104 | 104 | ) |
105 | | - """The storage configuration.""" |
| 105 | + """The output configuration.""" |
106 | 106 |
|
107 | | - def _validate_storage_base_dir(self) -> None: |
108 | | - """Validate the storage base directory.""" |
109 | | - if self.storage.type == defs.StorageType.file: |
110 | | - if self.storage.base_dir.strip() == "": |
111 | | - msg = "Storage base directory is required for file storage. Please rerun `graphrag init` and set the storage configuration." |
| 107 | + def _validate_output_base_dir(self) -> None: |
| 108 | + """Validate the output base directory.""" |
| 109 | + if self.output.type == defs.OutputType.file: |
| 110 | + if self.output.base_dir.strip() == "": |
| 111 | + msg = "output base directory is required for file output. Please rerun `graphrag init` and set the output configuration." |
112 | 112 | raise ValueError(msg) |
113 | | - self.storage.base_dir = str( |
114 | | - (Path(self.root_dir) / self.storage.base_dir).resolve() |
| 113 | + self.output.base_dir = str( |
| 114 | + (Path(self.root_dir) / self.output.base_dir).resolve() |
115 | 115 | ) |
116 | 116 |
|
117 | | - update_index_storage: StorageConfig | None = Field( |
118 | | - description="The storage configuration for the updated index.", |
| 117 | + update_index_output: OutputConfig | None = Field( |
| 118 | + description="The output configuration for the updated index.", |
119 | 119 | default=None, |
120 | 120 | ) |
121 | | - """The storage configuration for the updated index.""" |
| 121 | + """The output configuration for the updated index.""" |
122 | 122 |
|
123 | | - def _validate_update_index_storage_base_dir(self) -> None: |
124 | | - """Validate the update index storage base directory.""" |
| 123 | + def _validate_update_index_output_base_dir(self) -> None: |
| 124 | + """Validate the update index output base directory.""" |
125 | 125 | if ( |
126 | | - self.update_index_storage |
127 | | - and self.update_index_storage.type == defs.StorageType.file |
| 126 | + self.update_index_output |
| 127 | + and self.update_index_output.type == defs.OutputType.file |
128 | 128 | ): |
129 | | - if self.update_index_storage.base_dir.strip() == "": |
130 | | - msg = "Update index storage base directory is required for file storage. Please rerun `graphrag init` and set the update index storage configuration." |
| 129 | + if self.update_index_output.base_dir.strip() == "": |
| 130 | + msg = "Update index output base directory is required for file output. Please rerun `graphrag init` and set the update index output configuration." |
131 | 131 | raise ValueError(msg) |
132 | | - self.update_index_storage.base_dir = str( |
133 | | - (Path(self.root_dir) / self.update_index_storage.base_dir).resolve() |
| 132 | + self.update_index_output.base_dir = str( |
| 133 | + (Path(self.root_dir) / self.update_index_output.base_dir).resolve() |
134 | 134 | ) |
135 | 135 |
|
136 | 136 | cache: CacheConfig = Field( |
@@ -269,7 +269,7 @@ def _validate_model(self): |
269 | 269 | self._validate_root_dir() |
270 | 270 | self._validate_models() |
271 | 271 | self._validate_reporting_base_dir() |
272 | | - self._validate_storage_base_dir() |
273 | | - self._validate_update_index_storage_base_dir() |
| 272 | + self._validate_output_base_dir() |
| 273 | + self._validate_update_index_output_base_dir() |
274 | 274 | self._validate_vector_store_db_uri() |
275 | 275 | return self |
0 commit comments