55
66from dataclasses import dataclass , field
77from pathlib import Path
8- from typing import Literal
8+ from typing import ClassVar , Literal
99
1010from graphrag .config .embeddings import default_embeddings
1111from graphrag .config .enums import (
@@ -55,7 +55,7 @@ class BasicSearchDefaults:
5555class CacheDefaults :
5656 """Default values for cache."""
5757
58- type = CacheType .file
58+ type : ClassVar [ CacheType ] = CacheType .file
5959 base_dir : str = "cache"
6060 connection_string : None = None
6161 container_name : None = None
@@ -70,7 +70,7 @@ class ChunksDefaults:
7070 size : int = 1200
7171 overlap : int = 100
7272 group_by_columns : list [str ] = field (default_factory = lambda : ["id" ])
73- strategy = ChunkStrategyType .tokens
73+ strategy : ClassVar [ ChunkStrategyType ] = ChunkStrategyType .tokens
7474 encoding_model : str = "cl100k_base"
7575 prepend_metadata : bool = False
7676 chunk_size_includes_metadata : bool = False
@@ -120,8 +120,8 @@ class DriftSearchDefaults:
120120 local_search_temperature : float = 0
121121 local_search_top_p : float = 1
122122 local_search_n : int = 1
123- local_search_llm_max_gen_tokens = None
124- local_search_llm_max_gen_completion_tokens = None
123+ local_search_llm_max_gen_tokens : ClassVar [ None ] = None
124+ local_search_llm_max_gen_completion_tokens : ClassVar [ None ] = None
125125 chat_model_id : str = DEFAULT_CHAT_MODEL_ID
126126 embedding_model_id : str = DEFAULT_EMBEDDING_MODEL_ID
127127
@@ -184,7 +184,9 @@ class ExtractGraphDefaults:
184184class TextAnalyzerDefaults :
185185 """Default values for text analyzer."""
186186
187- extractor_type = NounPhraseExtractorType .RegexEnglish
187+ extractor_type : ClassVar [NounPhraseExtractorType ] = (
188+ NounPhraseExtractorType .RegexEnglish
189+ )
188190 model_name : str = "en_core_web_md"
189191 max_word_length : int = 15
190192 word_delimiter : str = " "
@@ -238,8 +240,8 @@ class GlobalSearchDefaults:
238240class InputDefaults :
239241 """Default values for input."""
240242
241- type = InputType .file
242- file_type = InputFileType .text
243+ type : ClassVar [ InputType ] = InputType .file
244+ file_type : ClassVar [ InputFileType ] = InputFileType .text
243245 base_dir : str = "input"
244246 connection_string : None = None
245247 storage_account_blob_url : None = None
@@ -257,7 +259,7 @@ class LanguageModelDefaults:
257259 """Default values for language model."""
258260
259261 api_key : None = None
260- auth_type = AuthType .APIKey
262+ auth_type : ClassVar [ AuthType ] = AuthType .APIKey
261263 encoding_model : str = ""
262264 max_tokens : int | None = None
263265 temperature : float = 0
@@ -304,7 +306,7 @@ class LocalSearchDefaults:
304306class OutputDefaults :
305307 """Default values for output."""
306308
307- type = OutputType .file
309+ type : ClassVar [ OutputType ] = OutputType .file
308310 base_dir : str = DEFAULT_OUTPUT_BASE_DIR
309311 connection_string : None = None
310312 container_name : None = None
@@ -329,7 +331,7 @@ class PruneGraphDefaults:
329331class ReportingDefaults :
330332 """Default values for reporting."""
331333
332- type = ReportingType .file
334+ type : ClassVar [ ReportingType ] = ReportingType .file
333335 base_dir : str = "logs"
334336 connection_string : None = None
335337 container_name : None = None
@@ -367,7 +369,7 @@ class UmapDefaults:
367369class UpdateIndexOutputDefaults :
368370 """Default values for update index output."""
369371
370- type = OutputType .file
372+ type : ClassVar [ OutputType ] = OutputType .file
371373 base_dir : str = "update_output"
372374 connection_string : None = None
373375 container_name : None = None
@@ -378,7 +380,7 @@ class UpdateIndexOutputDefaults:
378380class VectorStoreDefaults :
379381 """Default values for vector stores."""
380382
381- type = VectorStoreType .LanceDB .value
383+ type : ClassVar [ str ] = VectorStoreType .LanceDB .value
382384 db_uri : str = str (Path (DEFAULT_OUTPUT_BASE_DIR ) / "lancedb" )
383385 container_name : str = "default"
384386 overwrite : bool = True
0 commit comments