mirror of
https://github.com/HKUDS/LightRAG.git
synced 2025-11-11 15:23:49 +00:00
Add cache type "extract" for entity extraction
This commit is contained in:
parent
2d387fa6de
commit
c9481c81b9
@ -391,7 +391,7 @@ async def extract_entities(
|
|||||||
arg_hash,
|
arg_hash,
|
||||||
_prompt,
|
_prompt,
|
||||||
"default",
|
"default",
|
||||||
cache_type="default",
|
cache_type="extract",
|
||||||
llm=custom_llm,
|
llm=custom_llm,
|
||||||
)
|
)
|
||||||
if cached_return:
|
if cached_return:
|
||||||
@ -407,7 +407,7 @@ async def extract_entities(
|
|||||||
res: str = await use_llm_func(input_text)
|
res: str = await use_llm_func(input_text)
|
||||||
await save_to_cache(
|
await save_to_cache(
|
||||||
llm_response_cache,
|
llm_response_cache,
|
||||||
CacheData(args_hash=arg_hash, content=res, prompt=_prompt),
|
CacheData(args_hash=arg_hash, content=res, prompt=_prompt, cache_type="extract"),
|
||||||
)
|
)
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|||||||
@ -105,7 +105,7 @@ def compute_args_hash(*args, cache_type: str = None) -> str:
|
|||||||
"""Compute a hash for the given arguments.
|
"""Compute a hash for the given arguments.
|
||||||
Args:
|
Args:
|
||||||
*args: Arguments to hash
|
*args: Arguments to hash
|
||||||
cache_type: Type of cache (e.g., 'keywords', 'query')
|
cache_type: Type of cache (e.g., 'keywords', 'query', 'extract')
|
||||||
Returns:
|
Returns:
|
||||||
str: Hash string
|
str: Hash string
|
||||||
"""
|
"""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user