gofannon 0.25.16__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.
@@ -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}"
@@ -39,11 +39,8 @@ class CreateIssue(BaseTool):
39
39
  "description": "The body of the issue"
40
40
  },
41
41
  "labels": {
42
- "type": "array",
43
- "items": {
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.16
3
+ Version: 0.25.17
4
4
  Summary: A collection of tools for LLMs
5
5
  License: ASFv2
6
6
  Author: Trevor Grant
@@ -16,9 +16,10 @@ gofannon/basic_math/multiplication.py,sha256=PJ5sKWMCVlBaTeZ_j3gwYOEQXAhN-qIXhnr
16
16
  gofannon/basic_math/subtraction.py,sha256=gM1_N1mZ3qAXC6qnkzfijKXiOx27Gg93-CaB_ifMbOQ,1164
17
17
  gofannon/config.py,sha256=KPVtjBnpwfM39EQg-_xiqL1UFxcuQehrQIUS6HHBP6k,1784
18
18
  gofannon/github/__init__.py,sha256=VFw4sJIt4Zc0-__eYnksN8Ku9qMhbPpHJEkXMWUiD30,4
19
+ gofannon/github/clone_repo.py,sha256=UNXh1JaZkzK94REJUfQrBAhF66ncFWkzcZj34Si34cI,2287
19
20
  gofannon/github/commit_file.py,sha256=jdQGQHbrZx4521XgTbx5N0Ss8fDyl7hvp9sjDW15v9U,2573
20
21
  gofannon/github/commit_files.py,sha256=OZclhhSejRB1CYmd7IGYvdJZEWBzpaRRKK5S8NQxALU,4554
21
- gofannon/github/create_issue.py,sha256=WXq0klzPvGZnZyZRmriGOkHl7E_Tp08vO1v2ou7TR8w,2560
22
+ gofannon/github/create_issue.py,sha256=oS4Q-3urpd-qTJ9K4cCCrwMl_QumlVFsM5q-M1_pc_I,2475
22
23
  gofannon/github/get_repo_contents.py,sha256=9k6M2BqGlNsSGVjyfW7nxZpk1TFuhyPoZvURkv1PEyo,3637
23
24
  gofannon/github/pr_review_tool.py,sha256=srBbfgqBWy-J4wdAM0kLJfQr8LJ6uaA4vkDErqhyMxI,4336
24
25
  gofannon/github/read_issue.py,sha256=JrnBAlZxknhHm3aLC0uB9u0bSvoQNfK3OKmxYlr8jgQ,2308
@@ -42,7 +43,7 @@ gofannon/reasoning/sequential_cot.py,sha256=m9c8GnyTtmI-JntCuhkoFfULAabVOxsYgTRU
42
43
  gofannon/reasoning/tree_of_thought.py,sha256=TRhRJQNsFVauCLw4TOvQCDcX1nGmp_wSg9H67GJn1hs,10574
43
44
  gofannon/wikipedia/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
44
45
  gofannon/wikipedia/wikipedia_lookup.py,sha256=J6wKPbSivCF7cccaiRaJW1o0VqNhQAGfrh5U1ULLesg,2869
45
- gofannon-0.25.16.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
46
- gofannon-0.25.16.dist-info/METADATA,sha256=WuSkPmoZvLl4UJxz6vVRJ9vLpZZH8NB_ZQqmHoCGiLQ,5415
47
- gofannon-0.25.16.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
48
- gofannon-0.25.16.dist-info/RECORD,,
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,,