@@ -1,5 +1,5 @@
|
|||||||
from .lightrag import LightRAG as LightRAG, QueryParam as QueryParam
|
from .lightrag import LightRAG as LightRAG, QueryParam as QueryParam
|
||||||
|
|
||||||
__version__ = "1.2.1"
|
__version__ = "1.2.2"
|
||||||
__author__ = "Zirui Guo"
|
__author__ = "Zirui Guo"
|
||||||
__url__ = "https://github.com/HKUDS/LightRAG"
|
__url__ = "https://github.com/HKUDS/LightRAG"
|
||||||
|
@@ -539,9 +539,16 @@ class LightRAG:
|
|||||||
split_by_character, split_by_character_only
|
split_by_character, split_by_character_only
|
||||||
)
|
)
|
||||||
|
|
||||||
def insert_custom_chunks(self, full_text: str, text_chunks: list[str], doc_id: str | list[str] | None = None) -> None:
|
def insert_custom_chunks(
|
||||||
|
self,
|
||||||
|
full_text: str,
|
||||||
|
text_chunks: list[str],
|
||||||
|
doc_id: str | list[str] | None = None,
|
||||||
|
) -> None:
|
||||||
loop = always_get_an_event_loop()
|
loop = always_get_an_event_loop()
|
||||||
loop.run_until_complete(self.ainsert_custom_chunks(full_text, text_chunks, doc_id))
|
loop.run_until_complete(
|
||||||
|
self.ainsert_custom_chunks(full_text, text_chunks, doc_id)
|
||||||
|
)
|
||||||
|
|
||||||
async def ainsert_custom_chunks(
|
async def ainsert_custom_chunks(
|
||||||
self, full_text: str, text_chunks: list[str], doc_id: str | None = None
|
self, full_text: str, text_chunks: list[str], doc_id: str | None = None
|
||||||
|
@@ -581,7 +581,7 @@ async def kg_query(
|
|||||||
global_config: dict[str, str],
|
global_config: dict[str, str],
|
||||||
hashing_kv: BaseKVStorage | None = None,
|
hashing_kv: BaseKVStorage | None = None,
|
||||||
system_prompt: str | None = None,
|
system_prompt: str | None = None,
|
||||||
) -> str:
|
) -> str | AsyncIterator[str]:
|
||||||
# Handle cache
|
# Handle cache
|
||||||
use_model_func = global_config["llm_model_func"]
|
use_model_func = global_config["llm_model_func"]
|
||||||
args_hash = compute_args_hash(query_param.mode, query, cache_type="query")
|
args_hash = compute_args_hash(query_param.mode, query, cache_type="query")
|
||||||
|
Reference in New Issue
Block a user