def METHOD_NAME(cls, d: Dict[str, Any]):
    conversation = cls.convert_conversation(d)
    if conversation is not None:
        return conversation
    tmp = {}
    for k, v in d.items():
        if isinstance(v, dict):
            if set(v.keys()) == conversation_keys:
                tmp[k] = Conversation(text=v["new_user_input"])
            else:
                tmp[k] = cls.METHOD_NAME(v)
        elif isinstance(v, list):
            tmp[k] = cls.convert_list(v)
        elif isinstance(v, str):
            if v.startswith(IMAGE_PREFIX):
                decoded = base64.b64decode(v.split(",")[1])
                buf = io.BytesIO(decoded)
                tmp[k] = Image.open(buf)
            else:
                tmp[k] = v  # type: ignore
        else:
            tmp[k] = v
    return tmp