Spaces:
Sleeping
Sleeping
mriusero
commited on
Commit
·
dc645d9
1
Parent(s):
ea9236b
fix: Tool instance
Browse files- tools/analyze_repo.py +5 -4
- tools/visit_webpage.py +1 -0
tools/analyze_repo.py
CHANGED
@@ -1,7 +1,8 @@
|
|
1 |
from typing import Any, Dict
|
2 |
import requests
|
|
|
3 |
|
4 |
-
class GitHubCodeQualityTool:
|
5 |
name = "github_code_quality"
|
6 |
description = "Analyzes the code quality of a public GitHub repository."
|
7 |
inputs = {
|
@@ -9,9 +10,6 @@ class GitHubCodeQualityTool:
|
|
9 |
}
|
10 |
output_type = "dict"
|
11 |
|
12 |
-
def __init__(self):
|
13 |
-
pass
|
14 |
-
|
15 |
def forward(self, github_url: str) -> Dict[str, Any]:
|
16 |
"""
|
17 |
Analyzes the code quality of a public GitHub repository.
|
@@ -58,3 +56,6 @@ class GitHubCodeQualityTool:
|
|
58 |
def extract_repo_info(self, github_url: str) -> str:
|
59 |
"""Extracts repository information from the GitHub URL."""
|
60 |
return "/".join(github_url.split("/")[-2:])
|
|
|
|
|
|
|
|
1 |
from typing import Any, Dict
|
2 |
import requests
|
3 |
+
from smolagents.tools import Tool
|
4 |
|
5 |
+
class GitHubCodeQualityTool(Tool):
|
6 |
name = "github_code_quality"
|
7 |
description = "Analyzes the code quality of a public GitHub repository."
|
8 |
inputs = {
|
|
|
10 |
}
|
11 |
output_type = "dict"
|
12 |
|
|
|
|
|
|
|
13 |
def forward(self, github_url: str) -> Dict[str, Any]:
|
14 |
"""
|
15 |
Analyzes the code quality of a public GitHub repository.
|
|
|
56 |
def extract_repo_info(self, github_url: str) -> str:
|
57 |
"""Extracts repository information from the GitHub URL."""
|
58 |
return "/".join(github_url.split("/")[-2:])
|
59 |
+
|
60 |
+
def __init__(self, *args, **kwargs):
|
61 |
+
self.is_initialized = False
|
tools/visit_webpage.py
CHANGED
@@ -3,6 +3,7 @@ from smolagents.tools import Tool
|
|
3 |
import requests
|
4 |
import markdownify
|
5 |
import smolagents
|
|
|
6 |
|
7 |
class VisitWebpageTool(Tool):
|
8 |
name = "visit_webpage"
|
|
|
3 |
import requests
|
4 |
import markdownify
|
5 |
import smolagents
|
6 |
+
import re
|
7 |
|
8 |
class VisitWebpageTool(Tool):
|
9 |
name = "visit_webpage"
|