Wrapper for GitHub API.
GitHubAPIWrapper()Validate that api key and python package exists in environment.
Extracts title and number from each Issue and puts them in a dictionary Parameters: issues(List[Issue]): A list of Github Issue objects Returns: List[dict]: A dictionary of issue titles and numbers
Extracts title and number from each Issue and puts them in a dictionary Parameters: issues(List[Issue]): A list of Github Issue objects Returns: List[dict]: A dictionary of issue titles and numbers
Fetches all open issues from the repo excluding pull requests
Fetches all open PRs from the repo
Fetches all files in the main branch of the repo.
Equivalent to git checkout branch_name for this Agent.
Clones formatting from Github.
Returns an Error (as a string) if branch doesn't exist.
Fetches a list of all branches in the repository.
Create a new branch, and set it as the active bot branch.
Equivalent to git switch -c proposed_branch_name
If the proposed branch already exists, we append _v1 then _v2...
until a unique name is found.
Fetches all files in the active branch of the repo, the branch the bot uses to make changes.
Recursively fetches files from a directory in the repo.
Fetches a specific issue and its first 10 comments
Parameters:
issue_number(int): The number for the github issue
Returns:
dict containing the issue's title, body, comments as a string, and the
username of the user who opened the issue
Fetches the full text of all files in a PR. Truncates after first 3k tokens.
Fetches a specific pull request and its first 10 comments, limited by max_tokens.
Makes a pull request from the bot's branch to the base branch Parameters: pr_query(str): a string which contains the PR title and the PR body. The title is the first line in the string, and the body are the rest of the string. For example, "Updated README made changes to add info" Returns: str: A success or failure message
Adds a comment to a github issue Parameters: comment_query(str): a string which contains the issue number, two newlines, and the comment. for example: "1
Working on it now" adds the comment "working on it now" to issue 1 Returns: str: A success or failure message
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
Returns:
str: A success or failure message
Read a file from this agent's branch, defined by self.active_branch, which supports PR branches. Parameters: file_path(str): the file path Returns: str: The file decoded as a string, or an error message if not found
Updates a file with new content. Parameters: file_query(str): Contains the file path and the file contents. The old file contents is wrapped in OLD <<<< and >>>> OLD The new file contents is wrapped in NEW <<<< and >>>> NEW For example: /test/hello.txt OLD <<<< Hello Earth! >>>> OLD NEW <<<< Hello Mars! >>>> NEW Returns: A success or failure message
Deletes a file from the repo Parameters: file_path(str): Where the file is Returns: str: Success or failure message
Searches issues and pull requests in the repository.
Searches code in the repository.
Creates a review request on THE open pull request that matches the current active_branch.
Fetches the latest release of the repository.
Fetches all releases of the repository.
Fetches a specific release of the repository.