def _stringify_obj(d: Any) -> Union[str, list, dict]:
    """Utility function to convert all keys in a dictionary to strings."""
    if isinstance(d, list):
        return [_stringify_obj(v) for v in d]
    elif isinstance(d, Dict):
        return {str(k): _stringify_obj(v) for k, v in d.items()}
    else:
        return str(d)
Utility function to convert all keys in a dictionary to strings.
llama-index-core/llama_index/core/memory/vector_memory.py