Skip to main content

GitHubRepoViewer

Navigates and fetches content from GitHub repositories.

Basic Information

  • Type: haystack_integrations.github.src.haystack_integrations.components.connectors.github.repo_viewer.GitHubRepoViewer

Inputs

ParameterTypeDefaultDescription
repoOptional[str]NoneRepository in format "owner/repo"
pathstrPath within repository (default: root)
branchOptional[str]NoneGit reference (branch, tag, commit) to use

Outputs

ParameterTypeDefaultDescription
documentsList[Document]Dictionary containing list of documents

Overview

Work in Progress

Bear with us while we're working on adding pipeline examples and most common components connections.

Navigates and fetches content from GitHub repositories.

For directories:

  • Returns a list of Documents, one for each item
  • Each Document's content is the item name
  • Full path and metadata in Document.meta

For files:

  • Returns a single Document
  • Document's content is the file content
  • Full path and metadata in Document.meta

For errors:

  • Returns a single Document
  • Document's content is the error message
  • Document's meta contains type="error"

Usage Example

components:
GitHubRepoViewer:
type: github.src.haystack_integrations.components.connectors.github.repo_viewer.GitHubRepoViewer
init_parameters:

Parameters

Init Parameters

These are the parameters you can configure in Pipeline Builder:

ParameterTypeDefaultDescription
github_tokenOptional[Secret]NoneGitHub personal access token for API authentication
raise_on_failureboolTrueIf True, raises exceptions on API errors
max_file_sizeint1000000Maximum file size in bytes to fetch (default: 1MB)
repoOptional[str]NoneRepository in format "owner/repo"
branchstrmainGit reference (branch, tag, commit) to use

Run Method Parameters

These are the parameters you can configure for the component's run() method. This means you can pass these parameters at query time through the API, in Playground, or when running a job. For details, see Modify Pipeline Parameters at Query Time.

ParameterTypeDefaultDescription
repoOptional[str]NoneRepository in format "owner/repo"
pathstrPath within repository (default: root)
branchOptional[str]NoneGit reference (branch, tag, commit) to use