Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/ParisNeo/LightRAG
Browse files Browse the repository at this point in the history
  • Loading branch information
ParisNeo committed Dec 19, 2024
2 parents fe6ebfa + 5df5754 commit bbba07e
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions lightrag/lightrag.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,14 @@ def __post_init__(self):
self.llm_model_func = limit_async_func_call(self.llm_model_max_async)(
partial(
self.llm_model_func,
hashing_kv=self.llm_response_cache,
hashing_kv=self.llm_response_cache
if self.llm_response_cache
and hasattr(self.llm_response_cache, "global_config")
else self.key_string_value_json_storage_cls(
namespace="llm_response_cache",
global_config=asdict(self),
embedding_func=None,
),
**self.llm_model_kwargs,
)
)
Expand Down Expand Up @@ -515,7 +522,14 @@ async def aquery(self, query: str, param: QueryParam = QueryParam()):
self.text_chunks,
param,
asdict(self),
hashing_kv=self.llm_response_cache,
hashing_kv=self.llm_response_cache
if self.llm_response_cache
and hasattr(self.llm_response_cache, "global_config")
else self.key_string_value_json_storage_cls(
namespace="llm_response_cache",
global_config=asdict(self),
embedding_func=None,
),
)
elif param.mode == "naive":
response = await naive_query(
Expand All @@ -524,7 +538,14 @@ async def aquery(self, query: str, param: QueryParam = QueryParam()):
self.text_chunks,
param,
asdict(self),
hashing_kv=self.llm_response_cache,
hashing_kv=self.llm_response_cache
if self.llm_response_cache
and hasattr(self.llm_response_cache, "global_config")
else self.key_string_value_json_storage_cls(
namespace="llm_response_cache",
global_config=asdict(self),
embedding_func=None,
),
)
else:
raise ValueError(f"Unknown mode {param.mode}")
Expand Down

0 comments on commit bbba07e

Please sign in to comment.