field names and values are the metadata values.
    Returns:
        Dict[str, Any]: A sanitized dictionary ready for indexing in Redis.
    Raises:
        ValueError: If any metadata value is not one of the known
            types (string, int, float, or list of strings).
    """
    def raise_error(key: str, value: Any) -> None:
        raise ValueError(
            f"Metadata value for key '{key}' must be a string, int, "
            + f"float, or list of strings. Got {type(value).__name__}"
        )
    clean_meta: Dict[str, Union[str, float, int]] = {}
    for key, value in metadata.items():
        if not value:
            clean_meta[key] = ""
            continue
        # No transformation needed
        if isinstance(value, (str, int, float)):
            clean_meta[key] = value
        # if it's a list/tuple of strings, we join it
        elif isinstance(value, (list, tuple)):
            if not value or isinstance(value[0], str):
                clean_meta[key] = REDIS_TAG_SEPARATOR.join(value)
            else:
                raise_error(key, value)
        else:
            raise_error(key, value)
    return clean_meta
[docs]class RedisVectorStoreRetriever(VectorStoreRetriever):
    """Retriever for Redis VectorStore."""
    vectorstore: Redis
    """Redis VectorStore."""
    search_type: str = "similarity"
    """Type of search to perform. Can be either
    'similarity',
    'similarity_distance_threshold',
    'similarity_score_threshold'
    """
    search_kwargs: Dict[str, Any] = {
        "k": 4,