The tool is a wrapper for the python-gitlab library. Quickstart‚ÄãInstall the python-gitlab libraryCreate a Gitlab personal access tokenSet 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 python-gitlab library‚Äã%pip install python-gitlab2. Create a Gitlab personal access token‚ÄãFollow the instructions here to create a Gitlab personal access token. Make sure your app has the following repository permissions:read_apiread_repositorywrite_repository3. Set Environmental Variables‚ÄãBefore initializing your agent, the following environmental variables need to be set:GITLAB_PERSONAL_ACCESS_TOKEN- The personal access token you created in the last stepGITLAB_REPOSITORY- The name of the Gitlab repository you want your bot to act upon. Must follow the format {username}/{repo-name}.GITLAB_BRANCH- The branch where the bot will make its commits. Defaults to 'main.'GITLAB_BASE_BRANCH- The base branch of your repo, usually either 'main' or 'master.' This is where pull requests will base from. Defaults to 'main.'Example: Simple Agent‚Äãimport osfrom langchain.agents import AgentTypefrom langchain.agents import initialize_agentfrom langchain.agents.agent_toolkits.gitlab.toolkit import GitLabToolkitfrom langchain.llms import OpenAIfrom langchain.utilities.gitlab import GitLabAPIWrapper# Set your environment variables using os.environos.environ["GITLAB_PERSONAL_ACCESS_TOKEN"] = ""os.environ["GITLAB_REPOSITORY"] =
The Gitlab toolkit contains tools that enable an LLM agent to interact with a gitlab repository.
The Gitlab toolkit contains tools that enable an LLM agent to interact with a gitlab repository. ->: The tool is a wrapper for the python-gitlab library. Quickstart‚ÄãInstall the python-gitlab libraryCreate a Gitlab personal access tokenSet 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 python-gitlab library‚Äã%pip install python-gitlab2. Create a Gitlab personal access token‚ÄãFollow the instructions here to create a Gitlab personal access token. Make sure your app has the following repository permissions:read_apiread_repositorywrite_repository3. Set Environmental Variables‚ÄãBefore initializing your agent, the following environmental variables need to be set:GITLAB_PERSONAL_ACCESS_TOKEN- The personal access token you created in the last stepGITLAB_REPOSITORY- The name of the Gitlab repository you want your bot to act upon. Must follow the format {username}/{repo-name}.GITLAB_BRANCH- The branch where the bot will make its commits. Defaults to 'main.'GITLAB_BASE_BRANCH- The base branch of your repo, usually either 'main' or 'master.' This is where pull requests will base from. Defaults to 'main.'Example: Simple Agent‚Äãimport osfrom langchain.agents import AgentTypefrom langchain.agents import initialize_agentfrom langchain.agents.agent_toolkits.gitlab.toolkit import GitLabToolkitfrom langchain.llms import OpenAIfrom langchain.utilities.gitlab import GitLabAPIWrapper# Set your environment variables using os.environos.environ["GITLAB_PERSONAL_ACCESS_TOKEN"] = ""os.environ["GITLAB_REPOSITORY"] =