Update app.py
Browse files
app.py
CHANGED
@@ -218,6 +218,24 @@ def github_tool(
|
|
218 |
files = [{'name': content.name, 'path': content.path,
|
219 |
'download_url': content.download_url} for content in contents]
|
220 |
return files
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
221 |
|
222 |
else:
|
223 |
raise ValueError(f"Nieznana akcja: {action}")
|
@@ -254,6 +272,7 @@ with gr.Blocks() as demo:
|
|
254 |
"fork_repository",
|
255 |
"list_forks",
|
256 |
"list_files",
|
|
|
257 |
],
|
258 |
label="Akcja",
|
259 |
)
|
|
|
218 |
files = [{'name': content.name, 'path': content.path,
|
219 |
'download_url': content.download_url} for content in contents]
|
220 |
return files
|
221 |
+
|
222 |
+
elif action == "get_repository_info":
|
223 |
+
if not all([owner, repo_name]):
|
224 |
+
raise ValueError("Brakujące parametry: owner, repo_name")
|
225 |
+
repo = g.get_repo(f"{owner}/{repo_name}")
|
226 |
+
info = {
|
227 |
+
"nazwa": repo.name,
|
228 |
+
"opis": repo.description,
|
229 |
+
"url": repo.html_url,
|
230 |
+
"właściciel": repo.owner.login,
|
231 |
+
"gałąź domyślna": repo.default_branch,
|
232 |
+
"język": repo.language,
|
233 |
+
"liczba gwiazdek": repo.stargazers_count,
|
234 |
+
"liczba forków": repo.forks_count,
|
235 |
+
"utworzone": repo.created_at,
|
236 |
+
"ostatnia aktualizacja": repo.updated_at
|
237 |
+
}
|
238 |
+
return info # Zwraca słownik z informacjami
|
239 |
|
240 |
else:
|
241 |
raise ValueError(f"Nieznana akcja: {action}")
|
|
|
272 |
"fork_repository",
|
273 |
"list_forks",
|
274 |
"list_files",
|
275 |
+
"get_repository_info", # Dodana akcja
|
276 |
],
|
277 |
label="Akcja",
|
278 |
)
|