Skip to content

Commit 73eb5c8

Browse files
committed
Add default lm configs to verb tests
1 parent ec0874e commit 73eb5c8

14 files changed

+87
-17
lines changed

tests/unit/config/test_config.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ def test_missing_default_embedding_model_config() -> None:
3636
create_graphrag_config({"models": models_config})
3737

3838

39+
def test_skip_validation() -> None:
40+
create_graphrag_config(skip_validation=True)
41+
42+
3943
def test_missing_openai_required_api_key() -> None:
4044
model_config_missing_api_key = {
4145
defs.DEFAULT_CHAT_MODEL_ID: {

tests/verbs/test_compute_communities.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from graphrag.utils.storage import load_table_from_storage
88

99
from .util import (
10+
DEFAULT_MODEL_CONFIG,
1011
compare_outputs,
1112
create_test_context,
1213
load_test_table,
@@ -20,7 +21,9 @@ async def test_compute_communities():
2021
storage=["base_relationship_edges"],
2122
)
2223

23-
config = create_graphrag_config(skip_validation=True)
24+
config = create_graphrag_config(
25+
{"models": DEFAULT_MODEL_CONFIG}, skip_validation=True
26+
)
2427

2528
await run_workflow(
2629
config,

tests/verbs/test_create_base_text_units.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from graphrag.utils.storage import load_table_from_storage
88

99
from .util import (
10+
DEFAULT_MODEL_CONFIG,
1011
compare_outputs,
1112
create_test_context,
1213
load_test_table,
@@ -18,7 +19,9 @@ async def test_create_base_text_units():
1819

1920
context = await create_test_context()
2021

21-
config = create_graphrag_config(skip_validation=True)
22+
config = create_graphrag_config(
23+
{"models": DEFAULT_MODEL_CONFIG}, skip_validation=True
24+
)
2225
# test data was created with 4o, so we need to match the encoding for chunks to be identical
2326
config.chunks.encoding_model = "o200k_base"
2427

tests/verbs/test_create_final_communities.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from graphrag.utils.storage import load_table_from_storage
1111

1212
from .util import (
13+
DEFAULT_MODEL_CONFIG,
1314
compare_outputs,
1415
create_test_context,
1516
load_test_table,
@@ -27,7 +28,9 @@ async def test_create_final_communities():
2728
],
2829
)
2930

30-
config = create_graphrag_config(skip_validation=True)
31+
config = create_graphrag_config(
32+
{"models": DEFAULT_MODEL_CONFIG}, skip_validation=True
33+
)
3134

3235
await run_workflow(
3336
config,

tests/verbs/test_create_final_community_reports.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from graphrag.utils.storage import load_table_from_storage
2020

2121
from .util import (
22+
DEFAULT_MODEL_CONFIG,
2223
compare_outputs,
2324
create_test_context,
2425
load_test_table,
@@ -61,7 +62,9 @@ async def test_create_final_community_reports():
6162
]
6263
)
6364

64-
config = create_graphrag_config(skip_validation=True)
65+
config = create_graphrag_config(
66+
{"models": DEFAULT_MODEL_CONFIG}, skip_validation=True
67+
)
6568
config.community_reports.strategy = {
6669
"type": "graph_intelligence",
6770
"llm": MOCK_LLM_CONFIG,
@@ -96,7 +99,9 @@ async def test_create_final_community_reports_missing_llm_throws():
9699
]
97100
)
98101

99-
config = create_graphrag_config(skip_validation=True)
102+
config = create_graphrag_config(
103+
{"models": DEFAULT_MODEL_CONFIG}, skip_validation=True
104+
)
100105
config.community_reports.strategy = {
101106
"type": "graph_intelligence",
102107
}

tests/verbs/test_create_final_covariates.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from graphrag.utils.storage import load_table_from_storage
1616

1717
from .util import (
18+
DEFAULT_MODEL_CONFIG,
1819
create_test_context,
1920
load_test_table,
2021
)
@@ -36,7 +37,9 @@ async def test_create_final_covariates():
3637
storage=["create_base_text_units"],
3738
)
3839

39-
config = create_graphrag_config(skip_validation=True)
40+
config = create_graphrag_config(
41+
{"models": DEFAULT_MODEL_CONFIG}, skip_validation=True
42+
)
4043
config.claim_extraction.strategy = {
4144
"type": "graph_intelligence",
4245
"llm": MOCK_LLM_CONFIG,
@@ -85,7 +88,9 @@ async def test_create_final_covariates_missing_llm_throws():
8588
storage=["create_base_text_units"],
8689
)
8790

88-
config = create_graphrag_config(skip_validation=True)
91+
config = create_graphrag_config(
92+
{"models": DEFAULT_MODEL_CONFIG}, skip_validation=True
93+
)
8994
config.claim_extraction.strategy = {
9095
"type": "graph_intelligence",
9196
"claim_description": "description",

tests/verbs/test_create_final_documents.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from graphrag.utils.storage import load_table_from_storage
1111

1212
from .util import (
13+
DEFAULT_MODEL_CONFIG,
1314
compare_outputs,
1415
create_test_context,
1516
load_test_table,
@@ -23,7 +24,9 @@ async def test_create_final_documents():
2324
storage=["create_base_text_units"],
2425
)
2526

26-
config = create_graphrag_config(skip_validation=True)
27+
config = create_graphrag_config(
28+
{"models": DEFAULT_MODEL_CONFIG}, skip_validation=True
29+
)
2730

2831
await run_workflow(
2932
config,
@@ -43,7 +46,9 @@ async def test_create_final_documents_with_attribute_columns():
4346
storage=["create_base_text_units"],
4447
)
4548

46-
config = create_graphrag_config(skip_validation=True)
49+
config = create_graphrag_config(
50+
{"models": DEFAULT_MODEL_CONFIG}, skip_validation=True
51+
)
4752
config.input.document_attribute_columns = ["title"]
4853

4954
await run_workflow(

tests/verbs/test_create_final_entities.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from graphrag.utils.storage import load_table_from_storage
1111

1212
from .util import (
13+
DEFAULT_MODEL_CONFIG,
1314
compare_outputs,
1415
create_test_context,
1516
load_test_table,
@@ -23,7 +24,9 @@ async def test_create_final_entities():
2324
storage=["base_entity_nodes"],
2425
)
2526

26-
config = create_graphrag_config(skip_validation=True)
27+
config = create_graphrag_config(
28+
{"models": DEFAULT_MODEL_CONFIG}, skip_validation=True
29+
)
2730

2831
await run_workflow(
2932
config,

tests/verbs/test_create_final_nodes.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from graphrag.utils.storage import load_table_from_storage
1111

1212
from .util import (
13+
DEFAULT_MODEL_CONFIG,
1314
compare_outputs,
1415
create_test_context,
1516
load_test_table,
@@ -27,7 +28,9 @@ async def test_create_final_nodes():
2728
],
2829
)
2930

30-
config = create_graphrag_config(skip_validation=True)
31+
config = create_graphrag_config(
32+
{"models": DEFAULT_MODEL_CONFIG}, skip_validation=True
33+
)
3134

3235
await run_workflow(
3336
config,

tests/verbs/test_create_final_relationships.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from graphrag.utils.storage import load_table_from_storage
1212

1313
from .util import (
14+
DEFAULT_MODEL_CONFIG,
1415
compare_outputs,
1516
create_test_context,
1617
load_test_table,
@@ -24,7 +25,9 @@ async def test_create_final_relationships():
2425
storage=["base_relationship_edges"],
2526
)
2627

27-
config = create_graphrag_config(skip_validation=True)
28+
config = create_graphrag_config(
29+
{"models": DEFAULT_MODEL_CONFIG}, skip_validation=True
30+
)
2831

2932
await run_workflow(
3033
config,

0 commit comments

Comments
 (0)