1414class TestRunChain (unittest .IsolatedAsyncioTestCase ):
1515 async def test_run_extract_graph_single_document_correct_entities_returned (self ):
1616 results = await run_extract_graph (
17- docs = [Document ("test_text" , "1" )],
18- entity_types = ["person" ],
19- callbacks = None ,
20- args = {
21- "max_gleanings" : 0 ,
22- "summarize_descriptions" : False ,
23- },
2417 model = create_mock_llm (
2518 responses = [
2619 """
@@ -37,6 +30,12 @@ async def test_run_extract_graph_single_document_correct_entities_returned(self)
3730 ],
3831 name = "test_run_extract_graph_single_document_correct_entities_returned" ,
3932 ),
33+ docs = [Document ("test_text" , "1" )],
34+ entity_types = ["person" ],
35+ args = {
36+ "max_gleanings" : 0 ,
37+ "summarize_descriptions" : False ,
38+ },
4039 )
4140
4241 # self.assertItemsEqual isn't available yet, or I am just silly
@@ -49,13 +48,6 @@ async def test_run_extract_graph_multiple_documents_correct_entities_returned(
4948 self ,
5049 ):
5150 results = await run_extract_graph (
52- docs = [Document ("text_1" , "1" ), Document ("text_2" , "2" )],
53- entity_types = ["person" ],
54- callbacks = None ,
55- args = {
56- "max_gleanings" : 0 ,
57- "summarize_descriptions" : False ,
58- },
5951 model = create_mock_llm (
6052 responses = [
6153 """
@@ -76,6 +68,12 @@ async def test_run_extract_graph_multiple_documents_correct_entities_returned(
7668 ],
7769 name = "test_run_extract_graph_multiple_documents_correct_entities_returned" ,
7870 ),
71+ docs = [Document ("text_1" , "1" ), Document ("text_2" , "2" )],
72+ entity_types = ["person" ],
73+ args = {
74+ "max_gleanings" : 0 ,
75+ "summarize_descriptions" : False ,
76+ },
7977 )
8078
8179 # self.assertItemsEqual isn't available yet, or I am just silly
@@ -86,13 +84,6 @@ async def test_run_extract_graph_multiple_documents_correct_entities_returned(
8684
8785 async def test_run_extract_graph_multiple_documents_correct_edges_returned (self ):
8886 results = await run_extract_graph (
89- docs = [Document ("text_1" , "1" ), Document ("text_2" , "2" )],
90- entity_types = ["person" ],
91- callbacks = None ,
92- args = {
93- "max_gleanings" : 0 ,
94- "summarize_descriptions" : False ,
95- },
9687 model = create_mock_llm (
9788 responses = [
9889 """
@@ -113,6 +104,12 @@ async def test_run_extract_graph_multiple_documents_correct_edges_returned(self)
113104 ],
114105 name = "test_run_extract_graph_multiple_documents_correct_edges_returned" ,
115106 ),
107+ docs = [Document ("text_1" , "1" ), Document ("text_2" , "2" )],
108+ entity_types = ["person" ],
109+ args = {
110+ "max_gleanings" : 0 ,
111+ "summarize_descriptions" : False ,
112+ },
116113 )
117114
118115 # self.assertItemsEqual isn't available yet, or I am just silly
@@ -131,13 +128,6 @@ async def test_run_extract_graph_multiple_documents_correct_entity_source_ids_ma
131128 self ,
132129 ):
133130 results = await run_extract_graph (
134- docs = [Document ("text_1" , "1" ), Document ("text_2" , "2" )],
135- entity_types = ["person" ],
136- callbacks = None ,
137- args = {
138- "max_gleanings" : 0 ,
139- "summarize_descriptions" : False ,
140- },
141131 model = create_mock_llm (
142132 responses = [
143133 """
@@ -158,6 +148,12 @@ async def test_run_extract_graph_multiple_documents_correct_entity_source_ids_ma
158148 ],
159149 name = "test_run_extract_graph_multiple_documents_correct_entity_source_ids_mapped" ,
160150 ),
151+ docs = [Document ("text_1" , "1" ), Document ("text_2" , "2" )],
152+ entity_types = ["person" ],
153+ args = {
154+ "max_gleanings" : 0 ,
155+ "summarize_descriptions" : False ,
156+ },
161157 )
162158
163159 graph = results .graph
@@ -181,13 +177,6 @@ async def test_run_extract_graph_multiple_documents_correct_edge_source_ids_mapp
181177 self ,
182178 ):
183179 results = await run_extract_graph (
184- docs = [Document ("text_1" , "1" ), Document ("text_2" , "2" )],
185- entity_types = ["person" ],
186- callbacks = None ,
187- args = {
188- "max_gleanings" : 0 ,
189- "summarize_descriptions" : False ,
190- },
191180 model = create_mock_llm (
192181 responses = [
193182 """
@@ -208,6 +197,12 @@ async def test_run_extract_graph_multiple_documents_correct_edge_source_ids_mapp
208197 ],
209198 name = "test_run_extract_graph_multiple_documents_correct_edge_source_ids_mapped" ,
210199 ),
200+ docs = [Document ("text_1" , "1" ), Document ("text_2" , "2" )],
201+ entity_types = ["person" ],
202+ args = {
203+ "max_gleanings" : 0 ,
204+ "summarize_descriptions" : False ,
205+ },
211206 )
212207
213208 graph = results .graph
0 commit comments