class_docstr: Serialized experiment state cache.
  
  ODB with git SHAs as keys. Objects can be either SerializableExp or
  SerializableError.
code: def put(
      self,
      exp: Union[SerializableExp, SerializableError],
      rev: Optional[str] = None,
      force: bool = False,
  ):
      rev = rev or getattr(exp, "rev", None)
      assert rev
      assert rev != "workspace"
      if force or not self.odb.exists(rev):
          try:
              self.delete(rev)
          except FileNotFoundError:
              pass
          self.odb.add_bytes(rev, exp.as_bytes())
          logger.trace("ExpCache: cache put '%s'", rev[:7])
  
file_path: dvc/dvc/repo/experiments/cache.py
imports: import os
  from typing import TYPE_CHECKING, Optional, Union
  from dvc.fs import localfs
  from dvc.log import logger
  from dvc_objects.db import ObjectDB
  from .serialize import DeserializeError, SerializableError, SerializableExp
  from .utils import EXEC_TMP_DIR
label_desc: Use image node_id 3 for calling the ExpCache obj's underlying member method code with example usage: obj.put(exp, rev, force) without return types