MCPcopy Index your code
hub / github.com/AsyncFuncAI/deepwiki-open / get_file_content

Function get_file_content

api/data_pipeline.py:695–718  ·  view source on GitHub ↗

Retrieves the content of a file from a Git repository (GitHub or GitLab). Args: repo_type (str): Type of repository repo_url (str): The URL of the repository file_path (str): The path to the file within the repository access_token (str, optional): Access tok

(repo_url: str, file_path: str, repo_type: str = None, access_token: str = None)

Source from the content-addressed store, hash-verified

693
694
695def get_file_content(repo_url: str, file_path: str, repo_type: str = None, access_token: str = None) -> str:
696 """
697 Retrieves the content of a file from a Git repository (GitHub or GitLab).
698
699 Args:
700 repo_type (str): Type of repository
701 repo_url (str): The URL of the repository
702 file_path (str): The path to the file within the repository
703 access_token (str, optional): Access token for private repositories
704
705 Returns:
706 str: The content of the file as a string
707
708 Raises:
709 ValueError: If the file cannot be fetched or if the URL is not valid
710 """
711 if repo_type == "github":
712 return get_github_file_content(repo_url, file_path, access_token)
713 elif repo_type == "gitlab":
714 return get_gitlab_file_content(repo_url, file_path, access_token)
715 elif repo_type == "bitbucket":
716 return get_bitbucket_file_content(repo_url, file_path, access_token)
717 else:
718 raise ValueError("Unsupported repository type. Only GitHub, GitLab, and Bitbucket are supported.")
719
720class DatabaseManager:
721 """

Callers 2

handle_websocket_chatFunction · 0.90
chat_completions_streamFunction · 0.90

Calls 3

get_github_file_contentFunction · 0.85
get_gitlab_file_contentFunction · 0.85

Tested by

no test coverage detected