how you can load issues and pull requests (PRs) for a given repository on GitHub. We will use the LangChain Python repository as an example.Setup access token‚ÄãTo access the GitHub API, you need a personal access token - you can set up yours here: https://github.com/settings/tokens?type=beta. You can either set this token as the environment variable GITHUB_PERSONAL_ACCESS_TOKEN and it will be automatically pulled in, or you can pass it in directly at initialization as the access_token named parameter.# If you haven't set your access token as an environment variable, pass it in here.from getpass import getpassACCESS_TOKEN = getpass()Load Issues and PRs‚Äãfrom langchain.document_loaders import GitHubIssuesLoaderloader = GitHubIssuesLoader(    repo="langchain-ai/langchain",    access_token=ACCESS_TOKEN,  # delete/comment out this argument if you've set the access token as an env var.    creator="UmerHA",)Let's load all issues and PRs created by "UmerHA".Here's a list of all filters you can use:include_prsmilestonestateassigneecreatormentionedlabelssortdirectionsinceFor more info, see https://docs.github.com/en/rest/issues/issues?apiVersion=2022-11-28#list-repository-issues.docs = loader.load()print(docs[0].page_content)print(docs[0].metadata)    # Creates GitHubLoader (#5257)        GitHubLoader is a DocumentLoader that loads issues and PRs from GitHub.        Fixes #5257        Community members can review the PR once tests pass. Tag maintainers/contributors who might be interested:    DataLoaders    - @eyurtsev        {'url': 'https://github.com/langchain-ai/langchain/pull/5408', 'title': 'DocumentLoader for GitHub', 'creator': 'UmerHA', 'created_at': '2023-05-29T14:50:53Z', 'comments': 0, 'state': 'open', 'labels': ['enhancement', 'lgtm', 'doc loader'], 'assignee': None, 'milestone': None, 'locked': False, 'number': 5408, 'is_pull_request': True}Only load issues‚ÄãBy default, the GitHub API returns considers pull requests to also be issues. To only get 'pure'
This notebooks shows how you can load issues and pull requests (PRs) for a given repository on GitHub. We will use the LangChain Python repository as an example.
This notebooks shows how you can load issues and pull requests (PRs) for a given repository on GitHub. We will use the LangChain Python repository as an example. ->: how you can load issues and pull requests (PRs) for a given repository on GitHub. We will use the LangChain Python repository as an example.Setup access token‚ÄãTo access the GitHub API, you need a personal access token - you can set up yours here: https://github.com/settings/tokens?type=beta. You can either set this token as the environment variable GITHUB_PERSONAL_ACCESS_TOKEN and it will be automatically pulled in, or you can pass it in directly at initialization as the access_token named parameter.# If you haven't set your access token as an environment variable, pass it in here.from getpass import getpassACCESS_TOKEN = getpass()Load Issues and PRs‚Äãfrom langchain.document_loaders import GitHubIssuesLoaderloader = GitHubIssuesLoader(    repo="langchain-ai/langchain",    access_token=ACCESS_TOKEN,  # delete/comment out this argument if you've set the access token as an env var.    creator="UmerHA",)Let's load all issues and PRs created by "UmerHA".Here's a list of all filters you can use:include_prsmilestonestateassigneecreatormentionedlabelssortdirectionsinceFor more info, see https://docs.github.com/en/rest/issues/issues?apiVersion=2022-11-28#list-repository-issues.docs = loader.load()print(docs[0].page_content)print(docs[0].metadata)    # Creates GitHubLoader (#5257)        GitHubLoader is a DocumentLoader that loads issues and PRs from GitHub.        Fixes #5257        Community members can review the PR once tests pass. Tag maintainers/contributors who might be interested:    DataLoaders    - @eyurtsev        {'url': 'https://github.com/langchain-ai/langchain/pull/5408', 'title': 'DocumentLoader for GitHub', 'creator': 'UmerHA', 'created_at': '2023-05-29T14:50:53Z', 'comments': 0, 'state': 'open', 'labels': ['enhancement', 'lgtm', 'doc loader'], 'assignee': None, 'milestone': None, 'locked': False, 'number': 5408, 'is_pull_request': True}Only load issues‚ÄãBy default, the GitHub API returns considers pull requests to also be issues. To only get 'pure'