Integrate GitLab Data with LlamaIndex
Fetch and index GitLab repository files and issues using LlamaIndex readers for enhanced AI-driven insights and data retrieval.
Why it matters
Connect your GitLab projects and issues to LlamaIndex for advanced data analysis and retrieval. Leverage your code repositories and issue tracking data within your AI applications.
Outcomes
What it gets done
Read files from GitLab repositories by branch or commit.
Fetch open issues from specific GitLab projects.
Retrieve issues from GitLab groups.
Integrate GitLab data into LlamaIndex for RAG.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/li-reader-readers-gitlab | bash Capabilities
What this skill does
Pulls structured data fields from unstructured text.
Chunks, embeds, and indexes documents for semantic retrieval.
Writes and executes SQL or NoSQL queries on databases.
Overview
LlamaIndex Readers Integration: Gitlab
What it does
LlamaIndex Readers Integration: Gitlab
pip install llama-index-readers-gitlab
The gitlab readers package leverages python-gitlab to fetch contents from gitlab projects. It consists of two separate readers:
- Repository Reader
- Issues Reader
Access token or oauth token is required for private groups and projects.
Repository Reader
This reader will read through files in a repo based on branch or commit.
import gitlab
from llama_index.readers.gitlab import GitLabRepositoryReader
gitlab_client = gitlab.Gitlab("https://gitlab.com")
project_repo_reader = GitLabRepositoryReader(
gitlab_client=gitlab_client,
project_id=project_id,
verbose=True,
)
docs = project_repo_reader.load_data(file_path="README.rst", ref="develop")
Issues Reader
import gitlab
from llama_index.readers.gitlab import GitLabIssuesReader
gitlab_client = gitlab.Gitlab("https://gitlab.com")
# load issues by project id
project_issues_reader = GitLabIssuesReader(
gitlab_client=gitlab_client,
project_id=project_id,
verbose=True,
)
docs = project_issues_reader.load_data(
state=GitLabIssuesReader.IssueState.OPEN
)
# load issues by group id
group_issues_reader = GitLabIssuesReader(
gitlab_client=gitlab_client,
group_id=group_id,
verbose=True,
)
docs = group_issues_reader.load_data(state=GitLabIssuesReader.IssueState.OPEN)
Source README
LlamaIndex Readers Integration: Gitlab
pip install llama-index-readers-gitlab
The gitlab readers package leverages python-gitlab to fetch contents from gitlab projects. It consists of two separate readers:
- Repository Reader
- Issues Reader
Access token or oauth token is required for private groups and projects.
Repository Reader
This reader will read through files in a repo based on branch or commit.
import gitlab
from llama_index.readers.gitlab import GitLabRepositoryReader
gitlab_client = gitlab.Gitlab("https://gitlab.com")
project_repo_reader = GitLabRepositoryReader(
gitlab_client=gitlab_client,
project_id=project_id,
verbose=True,
)
docs = project_repo_reader.load_data(file_path="README.rst", ref="develop")
Issues Reader
import gitlab
from llama_index.readers.gitlab import GitLabIssuesReader
gitlab_client = gitlab.Gitlab("https://gitlab.com")
# load issues by project id
project_issues_reader = GitLabIssuesReader(
gitlab_client=gitlab_client,
project_id=project_id,
verbose=True,
)
docs = project_issues_reader.load_data(
state=GitLabIssuesReader.IssueState.OPEN
)
# load issues by group id
group_issues_reader = GitLabIssuesReader(
gitlab_client=gitlab_client,
group_id=group_id,
verbose=True,
)
docs = group_issues_reader.load_data(state=GitLabIssuesReader.IssueState.OPEN)
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.