[Refactor] Improve logging package wide (#1315)

This commit is contained in:
Deshraj Yadav
2024-03-13 17:13:30 -07:00
committed by GitHub
parent ef69c91b60
commit 3616eaadb4
54 changed files with 263 additions and 231 deletions

View File

@@ -14,6 +14,8 @@ from gptcache.similarity_evaluation.distance import \
from gptcache.similarity_evaluation.exact_match import \
ExactMatchEvaluation # noqa: F401
logger = logging.getLogger(__name__)
def gptcache_pre_function(data: dict[str, Any], **params: dict[str, Any]):
return data["input_query"]
@@ -24,12 +26,12 @@ def gptcache_data_manager(vector_dimension):
def gptcache_data_convert(cache_data):
logging.info("[Cache] Cache hit, returning cache data...")
logger.info("[Cache] Cache hit, returning cache data...")
return cache_data
def gptcache_update_cache_callback(llm_data, update_cache_func, *args, **kwargs):
logging.info("[Cache] Cache missed, updating cache...")
logger.info("[Cache] Cache missed, updating cache...")
update_cache_func(Answer(llm_data, CacheDataType.STR))
return llm_data