Skip to content

Commit 54885b8

Browse files
Refactor config defaults (microsoft#1723)
* Refactor config defaults - Implement type-safe, hierarchical dataclass for config defaults instead of namespaced constants. - Allow for instantiating config directly from defaults data structure. * fix vector_store db_uri default --------- Co-authored-by: Alonso Guevara <[email protected]>
1 parent 7bdeaee commit 54885b8

38 files changed

+886
-690
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "patch",
3+
"description": "Refactor config defaults from constants to type-safe, hierarchical dataclass."
4+
}

graphrag/api/prompt_tune.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
from pydantic import PositiveInt, validate_call
1515

16-
import graphrag.config.defaults as defs
1716
from graphrag.callbacks.noop_workflow_callbacks import NoopWorkflowCallbacks
17+
from graphrag.config.defaults import language_model_defaults
1818
from graphrag.config.models.graph_rag_config import GraphRagConfig
1919
from graphrag.language_model.manager import ModelManager
2020
from graphrag.logger.print_progress import PrintProgressLogger
@@ -102,7 +102,9 @@ async def generate_indexing_prompts(
102102
# if max_retries is not set, inject a dynamically assigned value based on the number of expected LLM calls
103103
# to be made or fallback to a default value in the worst case
104104
if default_llm_settings.max_retries == -1:
105-
default_llm_settings.max_retries = min(len(doc_list), defs.LLM_MAX_RETRIES)
105+
default_llm_settings.max_retries = min(
106+
len(doc_list), language_model_defaults.max_retries
107+
)
106108

107109
llm = ModelManager().register_chat(
108110
name="prompt_tuning",

0 commit comments

Comments
 (0)