Skip to content

The agent engineering platform.

"community: Fix GithubFileLoader source code", "docs: Fix GithubFileLoader code sample" (#19943)

Nobuhiko Otoba4b63a217c227
diff --git a/docs/docs/integrations/document_loaders/github.ipynb b/docs/docs/integrations/document_loaders/github.ipynb
index 6a1ac50382..47e940b7c6 100644
--- a/docs/docs/integrations/document_loaders/github.ipynb
+++ b/docs/docs/integrations/document_loaders/github.ipynb
@@ -175,6 +175,7 @@
"source": [
"loader = GithubFileLoader(\n",
" repo=\"langchain-ai/langchain\", # the repo name\n",
+ " branch=\"master\", # the branch name\n",
" access_token=ACCESS_TOKEN,\n",
" github_api_url=\"https://api.github.com\",\n",
" file_filter=lambda file_path: file_path.endswith(\n",
@@ -191,13 +192,13 @@
"example output of one of document: \n",
"\n",
"```json\n",
- "documents.metadata: \n",
+ "document.metadata: \n",
" {\n",
" \"path\": \"README.md\",\n",
" \"sha\": \"82f1c4ea88ecf8d2dfsfx06a700e84be4\",\n",
" \"source\": \"https://github.com/langchain-ai/langchain/blob/master/README.md\"\n",
" }\n",
- "documents.content:\n",
+ "document.content:\n",
" mock content\n",
"```"
]
diff --git a/libs/community/langchain_community/document_loaders/github.py b/libs/community/langchain_community/document_loaders/github.py
index df53ed16c9..ee647d4240 100644
--- a/libs/community/langchain_community/document_loaders/github.py
+++ b/libs/community/langchain_community/document_loaders/github.py
@@ -178,7 +178,6 @@ class GitHubIssuesLoader(BaseGitHubLoader):
class GithubFileLoader(BaseGitHubLoader, ABC):
"""Load GitHub File"""
- file_extension: str = ".md"
branch: str = "main"
file_filter: Optional[Callable[[str], bool]]