|
255 | 255 | "ktem.reasoning.react.ReactAgentPipeline", |
256 | 256 | "ktem.reasoning.rewoo.RewooAgentPipeline", |
257 | 257 | ] |
258 | | -KH_REASONINGS_USE_MULTIMODAL = False |
| 258 | +KH_REASONINGS_USE_MULTIMODAL = config("USE_MULTIMODAL", default=False, cast=bool) |
259 | 259 | KH_VLM_ENDPOINT = "{0}/openai/deployments/{1}/chat/completions?api-version={2}".format( |
260 | 260 | config("AZURE_OPENAI_ENDPOINT", default=""), |
261 | 261 | config("OPENAI_VISION_DEPLOYMENT_NAME", default="gpt-4o"), |
|
287 | 287 | } |
288 | 288 |
|
289 | 289 | USE_NANO_GRAPHRAG = config("USE_NANO_GRAPHRAG", default=False, cast=bool) |
290 | | -GRAPHRAG_INDEX_TYPE = ( |
291 | | - "ktem.index.file.graph.GraphRAGIndex" |
292 | | - if not USE_NANO_GRAPHRAG |
293 | | - else "ktem.index.file.graph.NanoGraphRAGIndex" |
294 | | -) |
| 290 | +USE_LIGHTRAG = config("USE_LIGHTRAG", default=False, cast=bool) |
| 291 | + |
| 292 | +GRAPHRAG_INDEX_TYPES = ["ktem.index.file.graph.GraphRAGIndex"] |
| 293 | + |
| 294 | +if USE_NANO_GRAPHRAG: |
| 295 | + GRAPHRAG_INDEX_TYPES.append("ktem.index.file.graph.NanoGraphRAGIndex") |
| 296 | +elif USE_LIGHTRAG: |
| 297 | + GRAPHRAG_INDEX_TYPES.append("ktem.index.file.graph.LightRAGIndex") |
| 298 | + |
295 | 299 | KH_INDEX_TYPES = [ |
296 | 300 | "ktem.index.file.FileIndex", |
297 | | - GRAPHRAG_INDEX_TYPE, |
| 301 | + *GRAPHRAG_INDEX_TYPES, |
298 | 302 | ] |
299 | 303 |
|
300 | | -GRAPHRAG_INDEX = ( |
| 304 | +GRAPHRAG_INDICES = [ |
301 | 305 | { |
302 | | - "name": "GraphRAG Collection", |
303 | | - "config": { |
304 | | - "supported_file_types": ( |
305 | | - ".png, .jpeg, .jpg, .tiff, .tif, .pdf, .xls, .xlsx, .doc, .docx, " |
306 | | - ".pptx, .csv, .html, .mhtml, .txt, .md, .zip" |
307 | | - ), |
308 | | - "private": False, |
309 | | - }, |
310 | | - "index_type": "ktem.index.file.graph.GraphRAGIndex", |
311 | | - } |
312 | | - if not USE_NANO_GRAPHRAG |
313 | | - else { |
314 | | - "name": "NanoGraphRAG Collection", |
| 306 | + "name": graph_type.split(".")[-1].replace("Index", "") |
| 307 | + + " Collection", # get last name |
315 | 308 | "config": { |
316 | 309 | "supported_file_types": ( |
317 | 310 | ".png, .jpeg, .jpg, .tiff, .tif, .pdf, .xls, .xlsx, .doc, .docx, " |
318 | 311 | ".pptx, .csv, .html, .mhtml, .txt, .md, .zip" |
319 | 312 | ), |
320 | 313 | "private": False, |
321 | 314 | }, |
322 | | - "index_type": "ktem.index.file.graph.NanoGraphRAGIndex", |
| 315 | + "index_type": graph_type, |
323 | 316 | } |
324 | | -) |
| 317 | + for graph_type in GRAPHRAG_INDEX_TYPES |
| 318 | +] |
325 | 319 |
|
326 | 320 | KH_INDICES = [ |
327 | 321 | { |
|
335 | 329 | }, |
336 | 330 | "index_type": "ktem.index.file.FileIndex", |
337 | 331 | }, |
338 | | - GRAPHRAG_INDEX, |
| 332 | + *GRAPHRAG_INDICES, |
339 | 333 | ] |
0 commit comments