Skip to content

Commit 2314a6a

Browse files
committed
fix: lightrag setting prompts
1 parent d87c76a commit 2314a6a

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

libs/ktem/ktem/index/file/graph/lightrag_pipelines.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,13 +241,12 @@ def build_graphrag(working_dir, llm_func, embedding_func):
241241
class LightRAGIndexingPipeline(GraphRAGIndexingPipeline):
242242
"""GraphRAG specific indexing pipeline"""
243243

244-
prompts: dict[str, list] = {}
244+
prompts: dict[str, str] = {}
245245

246246
@classmethod
247247
def get_user_settings(cls) -> dict:
248248
try:
249249
from lightrag.prompt import PROMPTS
250-
content: list
251250

252251
blacklist_keywords = ["default", "response", "process"]
253252
return {
@@ -260,14 +259,14 @@ def get_user_settings(cls) -> dict:
260259
if all(
261260
keyword not in prompt_name.lower() for keyword in blacklist_keywords
262261
)
262+
and isinstance(content, str)
263263
}
264264
except ImportError as e:
265265
print(e)
266266
return {}
267267

268268
def call_graphrag_index(self, graph_id: str, docs: list[Document]):
269269
from lightrag.prompt import PROMPTS
270-
content: list
271270

272271
# modify the prompt if it is set in the settings
273272
for prompt_name, content in self.prompts.items():

libs/ktem/ktem/index/file/graph/nano_pipelines.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,13 +237,12 @@ def build_graphrag(working_dir, llm_func, embedding_func):
237237
class NanoGraphRAGIndexingPipeline(GraphRAGIndexingPipeline):
238238
"""GraphRAG specific indexing pipeline"""
239239

240-
prompts: dict[str, list] = {}
240+
prompts: dict[str, str] = {}
241241

242242
@classmethod
243243
def get_user_settings(cls) -> dict:
244244
try:
245245
from nano_graphrag.prompt import PROMPTS
246-
content: list
247246

248247
blacklist_keywords = ["default", "response", "process"]
249248
return {
@@ -256,14 +255,14 @@ def get_user_settings(cls) -> dict:
256255
if all(
257256
keyword not in prompt_name.lower() for keyword in blacklist_keywords
258257
)
258+
and isinstance(content, str)
259259
}
260260
except ImportError as e:
261261
print(e)
262262
return {}
263263

264264
def call_graphrag_index(self, graph_id: str, docs: list[Document]):
265265
from nano_graphrag.prompt import PROMPTS
266-
content: list
267266

268267
# modify the prompt if it is set in the settings
269268
for prompt_name, content in self.prompts.items():

0 commit comments

Comments
 (0)