INNER CODE UNIT · Python
get_git_tree
SPThole/CoexistAI · app.py:465
async def get_git_tree(request:GitTreeRequest):
"""
Retrieves and returns the directory tree structure of a GitHub repository or a local Git repository.
Args:
url (str): The base URL of the GitHub repository (e.g., 'https://github.com/user/repo')
or the path to the local repository on your system.
Returns:
str: The directory tree structure as a string.
"""
return await git_tree_search(request.repobaseurl)
@app.post('/git-search',operation_id="get_git_search")
async def get_git_search(request:GitSearchRequest):
"""
Fetches the content of a specific part (directory or file) from either and does what asked in users query.
First use get_git_tree to understand the structure of the repo and which part might be useful to answer users query