code: def set_cache(self, key, value, **kwargs):
      try:
          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 = json.dumps(value)
          if ttl is not None:
              cache_control = (
                  f"immutable, max-age={ttl}, s-maxage={ttl}"
              )
              import datetime
  
              # Calculate expiration time
              expiration_time = datetime.datetime.now() + ttl
  
              # Upload the data to S3 with the calculated expiration time
              self.s3_client.put_object(
                  Bucket=self.bucket_name,
                  Key=key,
                  Body=serialized_value,
                  Expires=expiration_time,
                  CacheControl=cache_control,
                  ContentType="application/json",
                  ContentLanguage="en",
                  ContentDisposition=f'inline; filename="{key}.json"',
              )
          else:
              cache_control = (
                  "immutable, max-age=31536000, s-maxage=31536000"
              )
              # Upload the data to S3 without specifying Expires
              self.s3_client.put_object(
                  Bucket=self.bucket_name,
                  Key=key,
                  Body=serialized_value,
                  CacheControl=cache_control,
                  ContentType="application/json",
                  ContentLanguage="en",
                  ContentDisposition=f'inline; filename="{key}.json"',
              )
      except Exception as e:
          # NON blocking - notify users S3 is throwing an exception
          print_verbose(
              f"S3 Caching: set_cache() - Got exception from S3: {e}"
          )
  
imports: import litellm
  import time, logging
  import json, traceback, ast, hashlib
  from typing import Optional, Literal, List, Union, Any
  from openai._models import BaseModel
label_desc: Use image node_id 2 for calling the S3Cache obj's underlying member method code with example usage: obj.set_cache(key, value) without return types