The tool is a wrapper for the PyGitHub library. Quickstart‚ÄãInstall the pygithub libraryCreate a Github appSet your environmental variablesPass the tools to your agent with toolkit.get_tools()Each of these steps will be explained in great detail below.Get Issues- fetches issues from the repository.Get Issue- fetches details about a specific issue.Comment on Issue- posts a comment on a specific issue.Create Pull Request- creates a pull request from the bot's working branch to the base branch.Create File- creates a new file in the repository.Read File- reads a file from the repository.Update File- updates a file in the repository.Delete File- deletes a file from the repository.Setup‚Äã1. Install the pygithub library‚Äã%pip install pygithub2. Create a Github App‚ÄãFollow the instructions here to create and register a Github app. Make sure your app has the following repository permissions:Commit statuses (read only)Contents (read and write)Issues (read and write)Metadata (read only)Pull requests (read and write)Once the app has been registered, add it to the repository you wish the bot to act upon.3. Set Environmental Variables‚ÄãBefore initializing your agent, the following environmental variables need to be set:GITHUB_APP_ID- A six digit number found in your app's general settingsGITHUB_APP_PRIVATE_KEY- The location of your app's private key .pem fileGITHUB_REPOSITORY- The name of the Github repository you want your bot to act upon. Must follow the format {username}/{repo-name}. Make sure the app has been added to this repository first!GITHUB_BRANCH- The branch where the bot will make its commits. Defaults to 'master.'GITHUB_BASE_BRANCH- The base branch of your repo, usually either 'main' or 'master.' This is where pull requests will base from. Defaults to 'master.'Example: Simple Agent‚Äãimport osfrom langchain.agents import AgentTypefrom langchain.agents import initialize_agentfrom langchain.agents.agent_toolkits.github.toolkit import GitHubToolkitfrom
The Github toolkit contains tools that enable an LLM agent to interact with a github repository.
The Github toolkit contains tools that enable an LLM agent to interact with a github repository. ->: The tool is a wrapper for the PyGitHub library. Quickstart‚ÄãInstall the pygithub libraryCreate a Github appSet your environmental variablesPass the tools to your agent with toolkit.get_tools()Each of these steps will be explained in great detail below.Get Issues- fetches issues from the repository.Get Issue- fetches details about a specific issue.Comment on Issue- posts a comment on a specific issue.Create Pull Request- creates a pull request from the bot's working branch to the base branch.Create File- creates a new file in the repository.Read File- reads a file from the repository.Update File- updates a file in the repository.Delete File- deletes a file from the repository.Setup‚Äã1. Install the pygithub library‚Äã%pip install pygithub2. Create a Github App‚ÄãFollow the instructions here to create and register a Github app. Make sure your app has the following repository permissions:Commit statuses (read only)Contents (read and write)Issues (read and write)Metadata (read only)Pull requests (read and write)Once the app has been registered, add it to the repository you wish the bot to act upon.3. Set Environmental Variables‚ÄãBefore initializing your agent, the following environmental variables need to be set:GITHUB_APP_ID- A six digit number found in your app's general settingsGITHUB_APP_PRIVATE_KEY- The location of your app's private key .pem fileGITHUB_REPOSITORY- The name of the Github repository you want your bot to act upon. Must follow the format {username}/{repo-name}. Make sure the app has been added to this repository first!GITHUB_BRANCH- The branch where the bot will make its commits. Defaults to 'master.'GITHUB_BASE_BRANCH- The base branch of your repo, usually either 'main' or 'master.' This is where pull requests will base from. Defaults to 'master.'Example: Simple Agent‚Äãimport osfrom langchain.agents import AgentTypefrom langchain.agents import initialize_agentfrom langchain.agents.agent_toolkits.github.toolkit import GitHubToolkitfrom