gofannon 0.25.15.6__py3-none-any.whl → 0.25.17__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gofannon/github/clone_repo.py +64 -0
- gofannon/github/create_issue.py +3 -6
- {gofannon-0.25.15.6.dist-info → gofannon-0.25.17.dist-info}/METADATA +2 -2
- {gofannon-0.25.15.6.dist-info → gofannon-0.25.17.dist-info}/RECORD +6 -6
- gofannon/cli.py +0 -53
- {gofannon-0.25.15.6.dist-info → gofannon-0.25.17.dist-info}/LICENSE +0 -0
- {gofannon-0.25.15.6.dist-info → gofannon-0.25.17.dist-info}/WHEEL +0 -0
@@ -0,0 +1,64 @@
|
|
1
|
+
import git
|
2
|
+
from pathlib import Path
|
3
|
+
|
4
|
+
from..base import BaseTool
|
5
|
+
from ..config import FunctionRegistry
|
6
|
+
import logging
|
7
|
+
|
8
|
+
logger = logging.getLogger(__name__)
|
9
|
+
|
10
|
+
@FunctionRegistry.register
|
11
|
+
class CloneRepo(BaseTool):
|
12
|
+
"""
|
13
|
+
Clone a GitHub repository to a specified local directory.
|
14
|
+
This tool takes a GitHub repository URL and a target local directory,
|
15
|
+
then clones the repository into that directory using GitPython.
|
16
|
+
Returns a success message if the operation completes successfully,
|
17
|
+
or an error message if it fails.
|
18
|
+
"""
|
19
|
+
def __init__(self, name="clone_github_repo"):
|
20
|
+
super().__init__()
|
21
|
+
self.name = name
|
22
|
+
|
23
|
+
@property
|
24
|
+
def definition(self):
|
25
|
+
return {
|
26
|
+
"type": "function",
|
27
|
+
"function": {
|
28
|
+
"name": self.name,
|
29
|
+
"description": "Clone a GitHub repository to a specified local directory.",
|
30
|
+
"parameters": {
|
31
|
+
"type": "object",
|
32
|
+
"properties": {
|
33
|
+
"repo_url": {
|
34
|
+
"type": "string",
|
35
|
+
"description": "The URL of the GitHub repository to clone."
|
36
|
+
},
|
37
|
+
"local_dir": {
|
38
|
+
"type": "string",
|
39
|
+
"description": "The local directory where the repository should be cloned."
|
40
|
+
}
|
41
|
+
},
|
42
|
+
"required": ["repo_url", "local_dir"]
|
43
|
+
}
|
44
|
+
}
|
45
|
+
}
|
46
|
+
|
47
|
+
def fn(self, repo_url, local_dir):
|
48
|
+
logger.debug(f"Cloning repository {repo_url} to {local_dir}")
|
49
|
+
|
50
|
+
# Ensure the local directory exists
|
51
|
+
local_dir_path = Path(local_dir)
|
52
|
+
if not local_dir_path.exists():
|
53
|
+
local_dir_path.mkdir(parents=True, exist_ok=True)
|
54
|
+
|
55
|
+
try:
|
56
|
+
# Clone the repository
|
57
|
+
repo = git.Repo.clone_from(repo_url, local_dir_path)
|
58
|
+
return f"Repository cloned successfully to {local_dir}"
|
59
|
+
except git.exc.GitCommandError as e:
|
60
|
+
logger.error(f"Error cloning repository: {e}")
|
61
|
+
return f"Error cloning repository: {e}"
|
62
|
+
except Exception as e:
|
63
|
+
logger.error(f"Unexpected error: {e}")
|
64
|
+
return f"Unexpected error: {e}"
|
gofannon/github/create_issue.py
CHANGED
@@ -39,11 +39,8 @@ class CreateIssue(BaseTool):
|
|
39
39
|
"description": "The body of the issue"
|
40
40
|
},
|
41
41
|
"labels": {
|
42
|
-
"type": "
|
43
|
-
"
|
44
|
-
"type": "string"
|
45
|
-
},
|
46
|
-
"description": "An array of labels for the issue"
|
42
|
+
"type": "string",
|
43
|
+
"description": "A comma separated list of labels to apply to the issue"
|
47
44
|
}
|
48
45
|
},
|
49
46
|
"required": ["repo_url", "title", "body"]
|
@@ -70,7 +67,7 @@ class CreateIssue(BaseTool):
|
|
70
67
|
}
|
71
68
|
|
72
69
|
if labels:
|
73
|
-
payload["labels"] = labels
|
70
|
+
payload["labels"] = labels.split(',')
|
74
71
|
|
75
72
|
response = post(api_url, headers=headers, json=payload)
|
76
73
|
response.raise_for_status()
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: gofannon
|
3
|
-
Version: 0.25.
|
3
|
+
Version: 0.25.17
|
4
4
|
Summary: A collection of tools for LLMs
|
5
5
|
License: ASFv2
|
6
6
|
Author: Trevor Grant
|
@@ -80,7 +80,7 @@ have the latest and greatest, this will work too:
|
|
80
80
|
git+https://github.com/The-AI-Alliance/gofannon.git@main
|
81
81
|
```
|
82
82
|
|
83
|
-
For more information, see
|
83
|
+
For more information, see our [quickstart guide](https://github.com/The-AI-Alliance/gofannon/blob/main/docs/quickstart.md).
|
84
84
|
|
85
85
|
## 🏆🏆 Acknowledgments 🏆🏆
|
86
86
|
|
@@ -14,12 +14,12 @@ gofannon/basic_math/division.py,sha256=ZO8ZzWNL9zeFdXTEdPWDpnbDrWMXVeucSu105RbQm
|
|
14
14
|
gofannon/basic_math/exponents.py,sha256=w4qDlFZ9M1lf6X-tjG-ndpECfCOS7Qtc_VLICw0oh2w,1205
|
15
15
|
gofannon/basic_math/multiplication.py,sha256=PJ5sKWMCVlBaTeZ_j3gwYOEQXAhN-qIXhnrNcyhWGKM,1168
|
16
16
|
gofannon/basic_math/subtraction.py,sha256=gM1_N1mZ3qAXC6qnkzfijKXiOx27Gg93-CaB_ifMbOQ,1164
|
17
|
-
gofannon/cli.py,sha256=-T-jjBNl_74TsGRcrjxsQnG0-wA2neYhncnaqCiEzPo,1733
|
18
17
|
gofannon/config.py,sha256=KPVtjBnpwfM39EQg-_xiqL1UFxcuQehrQIUS6HHBP6k,1784
|
19
18
|
gofannon/github/__init__.py,sha256=VFw4sJIt4Zc0-__eYnksN8Ku9qMhbPpHJEkXMWUiD30,4
|
19
|
+
gofannon/github/clone_repo.py,sha256=UNXh1JaZkzK94REJUfQrBAhF66ncFWkzcZj34Si34cI,2287
|
20
20
|
gofannon/github/commit_file.py,sha256=jdQGQHbrZx4521XgTbx5N0Ss8fDyl7hvp9sjDW15v9U,2573
|
21
21
|
gofannon/github/commit_files.py,sha256=OZclhhSejRB1CYmd7IGYvdJZEWBzpaRRKK5S8NQxALU,4554
|
22
|
-
gofannon/github/create_issue.py,sha256=
|
22
|
+
gofannon/github/create_issue.py,sha256=oS4Q-3urpd-qTJ9K4cCCrwMl_QumlVFsM5q-M1_pc_I,2475
|
23
23
|
gofannon/github/get_repo_contents.py,sha256=9k6M2BqGlNsSGVjyfW7nxZpk1TFuhyPoZvURkv1PEyo,3637
|
24
24
|
gofannon/github/pr_review_tool.py,sha256=srBbfgqBWy-J4wdAM0kLJfQr8LJ6uaA4vkDErqhyMxI,4336
|
25
25
|
gofannon/github/read_issue.py,sha256=JrnBAlZxknhHm3aLC0uB9u0bSvoQNfK3OKmxYlr8jgQ,2308
|
@@ -43,7 +43,7 @@ gofannon/reasoning/sequential_cot.py,sha256=m9c8GnyTtmI-JntCuhkoFfULAabVOxsYgTRU
|
|
43
43
|
gofannon/reasoning/tree_of_thought.py,sha256=TRhRJQNsFVauCLw4TOvQCDcX1nGmp_wSg9H67GJn1hs,10574
|
44
44
|
gofannon/wikipedia/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
45
45
|
gofannon/wikipedia/wikipedia_lookup.py,sha256=J6wKPbSivCF7cccaiRaJW1o0VqNhQAGfrh5U1ULLesg,2869
|
46
|
-
gofannon-0.25.
|
47
|
-
gofannon-0.25.
|
48
|
-
gofannon-0.25.
|
49
|
-
gofannon-0.25.
|
46
|
+
gofannon-0.25.17.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
47
|
+
gofannon-0.25.17.dist-info/METADATA,sha256=CHzEBQQRiROqssrVgBKj2e3Qk-sZaV-NcGZfK6aXNh4,5415
|
48
|
+
gofannon-0.25.17.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
|
49
|
+
gofannon-0.25.17.dist-info/RECORD,,
|
gofannon/cli.py
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
import argparse
|
2
|
-
from .orchestration import ToolChain
|
3
|
-
from .base import WorkflowContext
|
4
|
-
from orchestration.firebase_wrapper import FirebaseWrapper
|
5
|
-
import json
|
6
|
-
|
7
|
-
def main():
|
8
|
-
parser = argparse.ArgumentParser(description="Gofannon CLI")
|
9
|
-
parser.add_argument('--local', action='store_true', help='Run locally')
|
10
|
-
parser.add_argument('--firebase', help='Firebase config path')
|
11
|
-
parser.add_argument('--workflow', required=True, help='Workflow config JSON')
|
12
|
-
parser.add_argument('--output', help='Output file path')
|
13
|
-
|
14
|
-
args = parser.parse_args()
|
15
|
-
|
16
|
-
# Initialize context
|
17
|
-
if args.firebase:
|
18
|
-
FirebaseWrapper.initialize(args.firebase)
|
19
|
-
context = FirebaseWrapper.get_context('current_workflow')
|
20
|
-
else:
|
21
|
-
context = WorkflowContext()
|
22
|
-
|
23
|
-
# Load workflow config
|
24
|
-
with open(args.workflow) as f:
|
25
|
-
workflow_config = json.load(f)
|
26
|
-
|
27
|
-
# Import and instantiate tools
|
28
|
-
tools = []
|
29
|
-
for tool_config in workflow_config['tools']:
|
30
|
-
module = __import__(f".{tool_config['module']}", fromlist=[tool_config['class']])
|
31
|
-
tool_class = getattr(module, tool_config['class'])
|
32
|
-
tool = tool_class(**tool_config.get('params', {}))
|
33
|
-
tools.append(tool)
|
34
|
-
|
35
|
-
# Execute workflow
|
36
|
-
chain = ToolChain(tools, context)
|
37
|
-
result = chain.execute(workflow_config.get('initial_input', {}))
|
38
|
-
|
39
|
-
# Handle output
|
40
|
-
if args.output:
|
41
|
-
with open(args.output, 'w') as f:
|
42
|
-
json.dump(result.output, f)
|
43
|
-
else:
|
44
|
-
print(json.dumps(result.output, indent=2))
|
45
|
-
|
46
|
-
# Save final state
|
47
|
-
if args.firebase:
|
48
|
-
FirebaseWrapper.save_context('current_workflow', context)
|
49
|
-
else:
|
50
|
-
context.save_checkpoint('final')
|
51
|
-
|
52
|
-
if __name__ == '__main__':
|
53
|
-
main()
|
File without changes
|
File without changes
|