def from_dict(js: Dict[str, str]) -> Optional["YAuth"]:
        """
        Create a YAuth instance from a dictionary.

        :param js: A dictionary containing 'folder_id' and 'api_key'.
        :return: A YAuth instance.
        :raises YException: If 'folder_id' or 'api_key' is not provided.
        """
        if js.get("folder_id") is not None and js.get("api_key") is not None:
            return YAuth(js["folder_id"], api_key=js["api_key"])
        raise YException(
            "Cannot create valid authentication object: you need to provide folder_id and either iam token or api_key fields"
        )

        Create a YAuth instance from a dictionary.

        :param js: A dictionary containing 'folder_id' and 'api_key'.
        :return: A YAuth instance.
        :raises YException: If 'folder_id' or 'api_key' is not provided.
        
llama-index-integrations/embeddings/llama-index-embeddings-yandexgpt/llama_index/embeddings/yandexgpt/util.py