MCPcopy Create free account
hub / github.com/NanGePlus/LightRAGTest / aquery

Method aquery

LightRAG/lightrag/lightrag.py:416–438  ·  view source on GitHub ↗
(self, query: str, param: QueryParam = QueryParam())

Source from the content-addressed store, hash-verified

414 return loop.run_until_complete(self.aquery(query, param))
415
416 async def aquery(self, query: str, param: QueryParam = QueryParam()):
417 if param.mode in ["local", "global", "hybrid"]:
418 response = await kg_query(
419 query,
420 self.chunk_entity_relation_graph,
421 self.entities_vdb,
422 self.relationships_vdb,
423 self.text_chunks,
424 param,
425 asdict(self),
426 )
427 elif param.mode == "naive":
428 response = await naive_query(
429 query,
430 self.chunks_vdb,
431 self.text_chunks,
432 param,
433 asdict(self),
434 )
435 else:
436 raise ValueError(f"Unknown mode {param.mode}")
437 await self._query_done()
438 return response
439
440 async def _query_done(self):
441 tasks = []

Callers 6

queryMethod · 0.95
mainFunction · 0.95
mainFunction · 0.95
process_queryFunction · 0.80
process_queryFunction · 0.80
query_endpointFunction · 0.80

Calls 4

_query_doneMethod · 0.95
QueryParamClass · 0.85
kg_queryFunction · 0.85
naive_queryFunction · 0.85

Tested by

no test coverage detected