(caching) Fix incorrect usage of str, which created invalid JSON.

This commit is contained in:
David Manouchehri 2024-01-09 14:21:08 -05:00
parent 7f739bb6ce
commit 8a07476524
No known key found for this signature in database

View file

@ -154,7 +154,7 @@ class S3Cache(BaseCache):
print_verbose(f"LiteLLM SET Cache - S3. Key={key}. Value={value}")
ttl = kwargs.get("ttl", None)
# Convert value to JSON before storing in S3
serialized_value = str(value)
serialized_value = json.dumps(value)
if ttl is not None:
cache_control = f"immutable, max-age={ttl}, s-maxage={ttl}"
import datetime