return "Unable to make comment due to error:\n" + str(e)
[docs]    def create_file(self, file_query: str) -> str:
        """
        Creates a new file on the Github repo
        Parameters:
            file_query(str): a string which contains the file path
            and the file contents. The file path is the first line
            in the string, and the contents are the rest of the string.
            For example, "hello_world.md\n# Hello World!"
        Returns:
            str: A success or failure message
        """
        file_path = file_query.split("\n")[0]
        file_contents = file_query[len(file_path) + 2 :]
        try:
            exists = self.github_repo_instance.get_contents(file_path)
            if exists is None:
                self.github_repo_instance.create_file(
                    path=file_path,
                    message="Create " + file_path,
                    content=file_contents,
                    branch=self.github_branch,
                )
                return "Created file " + file_path
            else:
                return f"File already exists at {file_path}. Use update_file instead"
        except Exception as e:
            return "Unable to make file due to error:\n" + str(e)
[docs]    def read_file(self, file_path: str) -> str:
        """
        Reads a file from the github repo
        Parameters:
            file_path(str): the file path
        Returns:
            str: The file decoded as a string
        """
        file = self.github_repo_instance.get_contents(file_path)
        return file.decoded_content.decode("utf-8")
[docs]    def update_file(self, file_query: str) -> str:
        """
        Updates a file with new content.
        Parameters: