MCPcopy Create free account
hub / github.com/VGabriel45/SolidityVisualizer / get_cached_github_data

Function get_cached_github_data

backend/app/routers/generate.py:36–47  ·  view source on GitHub ↗
(username: str, repo: str, github_pat: str | None = None)

Source from the content-addressed store, hash-verified

34# cache github data to avoid double API calls from cost and generate
35@lru_cache(maxsize=100)
36def get_cached_github_data(username: str, repo: str, github_pat: str | None = None):
37 # Create a new service instance for each call with the appropriate PAT
38 current_github_service = GitHubService(pat=github_pat)
39
40 default_branch = current_github_service.get_default_branch(username, repo)
41 if not default_branch:
42 default_branch = "main" # fallback value
43
44 file_tree = current_github_service.get_github_file_paths_as_list(username, repo)
45 readme = current_github_service.get_github_readme(username, repo)
46
47 return {"default_branch": default_branch, "file_tree": file_tree, "readme": readme}
48
49
50class ApiRequest(BaseModel):

Callers 2

get_generation_costFunction · 0.85
event_generatorFunction · 0.85

Calls 4

get_default_branchMethod · 0.95
get_github_readmeMethod · 0.95
GitHubServiceClass · 0.90

Tested by

no test coverage detected