(feat) use same id to log on s3, langfuse

This commit is contained in:
ishaan-jaff 2024-02-02 16:26:40 -08:00
parent c9b3a03092
commit d69edac11b
3 changed files with 21 additions and 38 deletions

View file

@ -128,19 +128,18 @@ class S3Logger:
# non blocking if it can't cast to a str
pass
s3_file_name = litellm.utils.get_logging_id(start_time, payload) or ""
s3_object_key = (
(self.s3_path.rstrip("/") + "/" if self.s3_path else "")
+ start_time.strftime('%Y-%m-%d') + "/"
+ "time-"
+ start_time.strftime('%H-%M-%S-%f')
+ "_"
+ payload["id"]
+ start_time.strftime("%Y-%m-%d")
+ "/"
+ s3_file_name
) # we need the s3 key to include the time, so we log cache hits too
s3_object_key += ".json"
s3_object_download_filename = (
"time-"
+ start_time.strftime('%Y-%m-%dT%H-%M-%S-%f')
+ start_time.strftime("%Y-%m-%dT%H-%M-%S-%f")
+ "_"
+ payload["id"]
+ ".json"