mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
refactor
Signed-off-by: B-Step62 <yuki.watanabe@databricks.com>
This commit is contained in:
parent
f356096772
commit
77de86e0e7
8 changed files with 78 additions and 99 deletions
|
@ -280,13 +280,7 @@ class LLMCachingHandler:
|
|||
is_async=False,
|
||||
)
|
||||
|
||||
if litellm.sync_logging:
|
||||
logging_obj.success_handler(cached_result, start_time, end_time, True)
|
||||
else:
|
||||
threading.Thread(
|
||||
target=logging_obj.success_handler,
|
||||
args=(cached_result, start_time, end_time, cache_hit),
|
||||
).start()
|
||||
logging_obj.success_handler(cached_result, start_time, end_time, True)
|
||||
cache_key = litellm.cache._get_preset_cache_key_from_kwargs(
|
||||
**kwargs
|
||||
)
|
||||
|
@ -452,13 +446,7 @@ class LLMCachingHandler:
|
|||
cached_result, start_time, end_time, cache_hit
|
||||
)
|
||||
)
|
||||
if litellm.sync_logging:
|
||||
logging_obj.success_handler(cached_result, start_time, end_time, cache_hit)
|
||||
else:
|
||||
threading.Thread(
|
||||
target=logging_obj.success_handler,
|
||||
args=(cached_result, start_time, end_time, cache_hit),
|
||||
).start()
|
||||
logging_obj.success_handler(cached_result, start_time, end_time, cache_hit)
|
||||
|
||||
async def _retrieve_from_cache(
|
||||
self, call_type: str, kwargs: Dict[str, Any], args: Tuple[Any, ...]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue