Axos-AI / Axos

0 stars 0 forks source link

private repo support #10

Open vjz3qz opened 1 week ago

vjz3qz commented 1 week ago

Instead of just cloning a public github url, we should use the github api and be able to clone a private repo

vjz3qz commented 1 week ago
from llama_index.readers.github import GithubRepositoryReader, GithubClient

def initialize_github_client(github_token):
    return GithubClient(github_token)

github_client = initialize_github_client(github_token)

loader = GithubRepositoryReader(
            github_client,
            owner=owner,
            repo=repo,
            filter_file_extensions=(
                [".py", ".ipynb", ".js", ".ts", ".md"],
                GithubRepositoryReader.FilterType.INCLUDE,
            ),
            verbose=False,
            concurrent_requests=5,
        )

docs = loader.load_data(branch="main")

llama index includes support