def set_key(
        self,
        store_name: str,
        key: str,
        value: Any,
        ttl: Optional[int] = None,
        policy: str = "persist",
    ) -> KeyDocument:
        """Sets the value of a key in the specified store.

        Keys can be either **persistent** or **cacheable**, depending on the provided
        ``policy`` or whether a TTL (time-to-live) is set.

        - If ``policy="persist"`` (default), the key will remain in the store until
          explicitly deleted.
        - If ``policy="evict"``, the key may be evicted by the system or manually
          removed using :meth:`~clear_cache`.
        - If a TTL is provided, the key is **always** treated as ``policy="evict"``.

        Args:
            store_name: the name of the store
            key: the key to set
            value: the value to set
            ttl (None): an optional TTL in seconds
            policy (persist): the eviction policy for the key. Can be "persist" or "evict".
                If "persist", the key will never be automatically removed.
                If "evict", the key may be removed automatically if a TTL is set,
                or manually via :meth:`clear_cache`.

        Returns:
            KeyDocument: The created or updated key document.
        """
        return self._repo.set_key(
            store_name, key, value, ttl=ttl, policy=policy
        )
Sets the value of a key in the specified store.

        Keys can be either **persistent** or **cacheable**, depending on the provided
        ``policy`` or whether a TTL (time-to-live) is set.

        - If ``policy="persist"`` (default), the key will remain in the store until
          explicitly deleted.
        - If ``policy="evict"``, the key may be evicted by the system or manually
          removed using :meth:`~clear_cache`.
        - If a TTL is provided, the key is **always** treated as ``policy="evict"``.

        Args:
            store_name: the name of the store
            key: the key to set
            value: the value to set
            ttl (None): an optional TTL in seconds
            policy (persist): the eviction policy for the key. Can be "persist" or "evict".
                If "persist", the key will never be automatically removed.
                If "evict", the key may be removed automatically if a TTL is set,
                or manually via :meth:`clear_cache`.

        Returns:
            KeyDocument: The created or updated key document.
        
fiftyone/operators/store/service.py