GithubFileLoader#
- class langchain_community.document_loaders.github.GithubFileLoader[source]#
Bases:
BaseGitHubLoader
,ABC
Load GitHub File
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- param access_token: str [Required]#
Personal access token - see settings/tokens
- param branch: str = 'main'#
- param file_filter: Callable[[str], bool] | None [Required]#
- param github_api_url: str = 'https://api.github.com'#
URL of GitHub API
- param repo: str [Required]#
Name of repository
- async alazy_load() AsyncIterator[Document] #
A lazy loader for Documents.
- Return type:
AsyncIterator[Document]
- lazy_load() Iterator[Document] [source]#
A lazy loader for Documents.
- Return type:
Iterator[Document]
- load_and_split(text_splitter: TextSplitter | None = None) list[Document] #
Load Documents and split into chunks. Chunks are returned as Documents.
Do not override this method. It should be considered to be deprecated!
- Parameters:
text_splitter (Optional[TextSplitter]) – TextSplitter instance to use for splitting documents. Defaults to RecursiveCharacterTextSplitter.
- Returns:
List of Documents.
- Return type:
list[Document]
- property headers: Dict[str, str]#
Examples using GithubFileLoader