# Path: golem/core/interfaces/all.py
# def create_from_prefix(prefix):
#     ifs = get_interfaces()
#     for interface in ifs:
#         if interface.prefix == prefix:
#             return interface


from golem.core.interfaces.all import create_from_prefix
        :param unique_id: A string that uniquely identifies the user within the interface
        :param profile: Profile object
        :param meta: Any interface-specific data. type: dict
        """
        if interface is None:
            raise ValueError("Interface must be set")
        elif not isinstance(unique_id, str):
            raise ValueError("UID must be a string")
        elif not isinstance(profile, Profile) and profile is not None:
            raise ValueError("Profile must be instance of class Profile")
        self.interface = interface
        self.chat_id = self.interface.prefix + "_" + unique_id
        self.profile = profile or Profile()
        self.meta = meta or {}
        self.is_logged = is_logged
        self.is_admin = is_admin
        self.is_test = is_test

    def to_json(self):
        return {
            "interface": self.interface.prefix,
            "unique_id": self.chat_id.split('_', maxsplit=1)[1],
            "profile": self.profile.to_json(),
            "meta": self.meta,
            "is_logged": self.is_logged,
            "is_admin": self.is_admin
        }

    @staticmethod
    def from_json(data: dict):

# Path: golem/core/interfaces/all.py
# def create_from_prefix(prefix):
#     ifs = get_interfaces()
#     for interface in ifs:
#         if interface.prefix == prefix:
#             return interface


# Path: golem/core/chat_session.py
from golem.core.interfaces.all import create_from_prefix

        :param unique_id: A string that uniquely identifies the user within the interface
        :param profile: Profile object
        :param meta: Any interface-specific data. type: dict
        """
        if interface is None:
            raise ValueError("Interface must be set")
        elif not isinstance(unique_id, str):
            raise ValueError("UID must be a string")
        elif not isinstance(profile, Profile) and profile is not None:
            raise ValueError("Profile must be instance of class Profile")
        self.interface = interface
        self.chat_id = self.interface.prefix + "_" + unique_id
        self.profile = profile or Profile()
        self.meta = meta or {}
        self.is_logged = is_logged
        self.is_admin = is_admin
        self.is_test = is_test

    def to_json(self):
        return {
            "interface": self.interface.prefix,
            "unique_id": self.chat_id.split('_', maxsplit=1)[1],
            "profile": self.profile.to_json(),
            "meta": self.meta,
            "is_logged": self.is_logged,
            "is_admin": self.is_admin
        }

    @staticmethod
    def from_json(data: dict):

        interface = create_from_prefix(data['interface'])