From 467c506e33880736d4f729daecf43df5cd193d2f Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Tue, 6 Aug 2024 13:03:14 -0700 Subject: [PATCH] caching use file_checksum --- litellm/caching.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/litellm/caching.py b/litellm/caching.py index 6ed6eb9fdb..e23bd5bfc7 100644 --- a/litellm/caching.py +++ b/litellm/caching.py @@ -10,6 +10,7 @@ import ast import asyncio import hashlib +import io import json import logging import time @@ -1889,8 +1890,10 @@ class Cache: metadata = kwargs.get("metadata", {}) litellm_params = kwargs.get("litellm_params", {}) + # get checksum of file content param_value = ( - getattr(file, "name", None) + metadata.get("file_checksum") + or getattr(file, "name", None) or metadata.get("file_name") or litellm_params.get("file_name") )