Spaces:
Sleeping
Sleeping
mriusero
commited on
Commit
·
ade3428
1
Parent(s):
9332f3e
update doc
Browse files- app.py +3 -3
- tools/analyze_repo.py +5 -7
app.py
CHANGED
@@ -11,7 +11,7 @@ from tools.web_search import DuckDuckGoSearchTool
|
|
11 |
from tools.visit_webpage import VisitWebpageTool
|
12 |
from tools.get_timezone import get_current_time_in_timezone
|
13 |
from tools.calculate import calculator
|
14 |
-
from tools.analyze_repo import
|
15 |
|
16 |
from Gradio_UI import GradioUI
|
17 |
|
@@ -29,7 +29,7 @@ def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return
|
|
29 |
final_answer = FinalAnswerTool()
|
30 |
web_search = DuckDuckGoSearchTool()
|
31 |
visit_webpage = VisitWebpageTool()
|
32 |
-
|
33 |
|
34 |
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|
35 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
@@ -57,7 +57,7 @@ agent = CodeAgent(
|
|
57 |
visit_webpage,
|
58 |
get_current_time_in_timezone,
|
59 |
calculator,
|
60 |
-
|
61 |
], ## add your tools here (don't remove final answer)
|
62 |
max_steps=6,
|
63 |
verbosity_level=1,
|
|
|
11 |
from tools.visit_webpage import VisitWebpageTool
|
12 |
from tools.get_timezone import get_current_time_in_timezone
|
13 |
from tools.calculate import calculator
|
14 |
+
from tools.analyze_repo import GitHubAnalyzerTool
|
15 |
|
16 |
from Gradio_UI import GradioUI
|
17 |
|
|
|
29 |
final_answer = FinalAnswerTool()
|
30 |
web_search = DuckDuckGoSearchTool()
|
31 |
visit_webpage = VisitWebpageTool()
|
32 |
+
analyze_github_repository = GitHubAnalyzerTool()
|
33 |
|
34 |
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|
35 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
|
|
57 |
visit_webpage,
|
58 |
get_current_time_in_timezone,
|
59 |
calculator,
|
60 |
+
analyze_github_repository,
|
61 |
], ## add your tools here (don't remove final answer)
|
62 |
max_steps=6,
|
63 |
verbosity_level=1,
|
tools/analyze_repo.py
CHANGED
@@ -2,9 +2,9 @@ from typing import Any, Dict
|
|
2 |
import requests
|
3 |
from smolagents.tools import Tool
|
4 |
|
5 |
-
class
|
6 |
-
name = "
|
7 |
-
description = "Analyzes
|
8 |
inputs = {
|
9 |
'github_url': {'type': 'string', 'description': 'The URL of the public GitHub repository to analyze.'}
|
10 |
}
|
@@ -15,13 +15,11 @@ class GitHubCodeQualityTool(Tool):
|
|
15 |
|
16 |
def forward(self, github_url: str) -> str:
|
17 |
"""
|
18 |
-
Analyzes
|
19 |
-
|
20 |
Args:
|
21 |
github_url: The URL of the public GitHub repository to analyze.
|
22 |
-
|
23 |
Returns:
|
24 |
-
A
|
25 |
"""
|
26 |
if not self.validate_github_url(github_url):
|
27 |
return "Please provide a valid GitHub repository URL."
|
|
|
2 |
import requests
|
3 |
from smolagents.tools import Tool
|
4 |
|
5 |
+
class GitHubAnalyzerTool(Tool):
|
6 |
+
name = "analyze_github_repository"
|
7 |
+
description = "Analyzes statistics such as issues, pull_requests, contributors, stars and forks of a public GitHub repository and return a synthesis in markdown string with the results."
|
8 |
inputs = {
|
9 |
'github_url': {'type': 'string', 'description': 'The URL of the public GitHub repository to analyze.'}
|
10 |
}
|
|
|
15 |
|
16 |
def forward(self, github_url: str) -> str:
|
17 |
"""
|
18 |
+
Analyzes statistics such as issues, pull_requests, contributors, stars and forks of a public GitHub repository and return a synthesis in markdown string with the results.
|
|
|
19 |
Args:
|
20 |
github_url: The URL of the public GitHub repository to analyze.
|
|
|
21 |
Returns:
|
22 |
+
A synthesis of repository statistics in markdown string with the results.
|
23 |
"""
|
24 |
if not self.validate_github_url(github_url):
|
25 |
return "Please provide a valid GitHub repository URL."
|