gofannon 0.1.0__tar.gz → 0.25.11__tar.gz

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.
Files changed (51) hide show
  1. gofannon-0.25.11/PKG-INFO +148 -0
  2. gofannon-0.25.11/README.md +111 -0
  3. gofannon-0.25.11/gofannon/arxiv/__init__.py +0 -0
  4. gofannon-0.25.11/gofannon/base/__init__.py +113 -0
  5. gofannon-0.25.11/gofannon/base/bedrock.py +666 -0
  6. gofannon-0.25.11/gofannon/base/langchain.py +85 -0
  7. gofannon-0.25.11/gofannon/base/smol_agents.py +51 -0
  8. gofannon-0.25.11/gofannon/basic_math/__init__.py +1 -0
  9. {gofannon-0.1.0 → gofannon-0.25.11}/gofannon/config.py +3 -1
  10. gofannon-0.25.11/gofannon/github/__init__.py +4 -0
  11. gofannon-0.25.11/gofannon/github/pr_review_tool.py +104 -0
  12. gofannon-0.25.11/gofannon/google_search/__init__.py +0 -0
  13. gofannon-0.25.11/gofannon/google_search/google_search.py +55 -0
  14. gofannon-0.25.11/gofannon/headless_browser/__init__.py +0 -0
  15. gofannon-0.25.11/gofannon/headless_browser/base.py +42 -0
  16. gofannon-0.25.11/gofannon/headless_browser/headless_browser_get.py +35 -0
  17. gofannon-0.25.11/gofannon/open_notify_space/__init__.py +1 -0
  18. gofannon-0.25.11/gofannon/open_notify_space/iss_locator.py +126 -0
  19. gofannon-0.25.11/gofannon/reasoning/__init__.py +0 -0
  20. gofannon-0.25.11/pyproject.toml +38 -0
  21. gofannon-0.1.0/PKG-INFO +0 -84
  22. gofannon-0.1.0/README.md +0 -61
  23. gofannon-0.1.0/gofannon/arxiv/__init__.py +0 -2
  24. gofannon-0.1.0/gofannon/base/__init__.py +0 -251
  25. gofannon-0.1.0/gofannon/basic_math/__init__.py +0 -5
  26. gofannon-0.1.0/gofannon/github/__init__.py +0 -11
  27. gofannon-0.1.0/gofannon/reasoning/__init__.py +0 -3
  28. gofannon-0.1.0/pyproject.toml +0 -23
  29. {gofannon-0.1.0 → gofannon-0.25.11}/LICENSE +0 -0
  30. {gofannon-0.1.0 → gofannon-0.25.11}/gofannon/__init__.py +0 -0
  31. {gofannon-0.1.0 → gofannon-0.25.11}/gofannon/arxiv/get_article.py +0 -0
  32. {gofannon-0.1.0 → gofannon-0.25.11}/gofannon/arxiv/search.py +0 -0
  33. {gofannon-0.1.0 → gofannon-0.25.11}/gofannon/basic_math/addition.py +0 -0
  34. {gofannon-0.1.0 → gofannon-0.25.11}/gofannon/basic_math/division.py +0 -0
  35. {gofannon-0.1.0 → gofannon-0.25.11}/gofannon/basic_math/exponents.py +0 -0
  36. {gofannon-0.1.0 → gofannon-0.25.11}/gofannon/basic_math/multiplication.py +0 -0
  37. {gofannon-0.1.0 → gofannon-0.25.11}/gofannon/basic_math/subtraction.py +0 -0
  38. {gofannon-0.1.0 → gofannon-0.25.11}/gofannon/cli.py +0 -0
  39. {gofannon-0.1.0 → gofannon-0.25.11}/gofannon/github/commit_file.py +0 -0
  40. {gofannon-0.1.0 → gofannon-0.25.11}/gofannon/github/commit_files.py +0 -0
  41. {gofannon-0.1.0 → gofannon-0.25.11}/gofannon/github/create_issue.py +0 -0
  42. {gofannon-0.1.0 → gofannon-0.25.11}/gofannon/github/get_repo_contents.py +0 -0
  43. {gofannon-0.1.0 → gofannon-0.25.11}/gofannon/github/read_issue.py +0 -0
  44. {gofannon-0.1.0 → gofannon-0.25.11}/gofannon/github/search.py +0 -0
  45. {gofannon-0.1.0 → gofannon-0.25.11}/gofannon/nhsta/__init__.py +0 -0
  46. {gofannon-0.1.0 → gofannon-0.25.11}/gofannon/orchestration/__init__.py +0 -0
  47. {gofannon-0.1.0 → gofannon-0.25.11}/gofannon/orchestration/firebase_wrapper.py +0 -0
  48. {gofannon-0.1.0 → gofannon-0.25.11}/gofannon/reasoning/base.py +0 -0
  49. {gofannon-0.1.0 → gofannon-0.25.11}/gofannon/reasoning/hierarchical_cot.py +0 -0
  50. {gofannon-0.1.0 → gofannon-0.25.11}/gofannon/reasoning/sequential_cot.py +0 -0
  51. {gofannon-0.1.0 → gofannon-0.25.11}/gofannon/reasoning/tree_of_thought.py +0 -0
@@ -0,0 +1,148 @@
1
+ Metadata-Version: 2.3
2
+ Name: gofannon
3
+ Version: 0.25.11
4
+ Summary: A collection of tools for LLMs
5
+ License: ASFv2
6
+ Author: Trevor Grant
7
+ Author-email: trevor.d.grant@gmail.com
8
+ Requires-Python: >=3.10,<4.0
9
+ Classifier: License :: Other/Proprietary License
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Provides-Extra: aws
16
+ Provides-Extra: google
17
+ Provides-Extra: headless-browser
18
+ Provides-Extra: langchain
19
+ Provides-Extra: smolagents
20
+ Provides-Extra: testing
21
+ Requires-Dist: GitPython (>=3.1.43,<4.0.0)
22
+ Requires-Dist: boto3 (>=1.34.97,<2.0.0) ; extra == "aws"
23
+ Requires-Dist: google-api-python-client (>=2.161.0,<3.0.0) ; extra == "google"
24
+ Requires-Dist: jsonschema (>=4.23.0,<5.0.0)
25
+ Requires-Dist: langchain (>=0.3.16,<0.4.0) ; extra == "langchain"
26
+ Requires-Dist: openai (>=1.60.2,<2.0.0)
27
+ Requires-Dist: pydantic (>=2.10.6,<3.0.0) ; extra == "langchain"
28
+ Requires-Dist: pygithub (>=2.6.1,<3.0.0)
29
+ Requires-Dist: pytest (>=8.3.4,<9.0.0) ; extra == "testing"
30
+ Requires-Dist: python-dotenv (>=1.0.1,<2.0.0)
31
+ Requires-Dist: requests (>=2.32.3,<3.0.0)
32
+ Requires-Dist: requests-mock (>=1.12.1,<2.0.0) ; extra == "testing"
33
+ Requires-Dist: selenium (>=4.10.0,<5.0.0) ; extra == "headless-browser"
34
+ Requires-Dist: smolagents (>=1.6.0,<2.0.0) ; extra == "smolagents"
35
+ Description-Content-Type: text/markdown
36
+
37
+ ![gofannon logo](https://github.com/The-AI-Alliance/gofannon/blob/main/gofannon.jpg)
38
+ <!-- ![CI](https://github.com/The-AI-Alliance/gofannon/actions/workflows/main.yml/badge.svg) -->
39
+ ![PyPI](https://img.shields.io/pypi/v/gofannon)
40
+ ![License](https://img.shields.io/github/license/The-AI-Alliance/gofannon)
41
+ ![Issues](https://img.shields.io/github/issues/The-AI-Alliance/gofannon)
42
+ ![GitHub stars](https://img.shields.io/github/stars/The-AI-Alliance/gofannon?style=social)
43
+
44
+ # gofannon
45
+
46
+ **gofannon** is a collection of tools designed to enhance the capabilities of function-calling-enabled language models. These tools provide additional functionality for various tasks, including mathematical operations, GitHub interactions, arXiv searches, and advanced reasoning techniques.
47
+
48
+ ## Why the name `gofanon` ?
49
+
50
+ See [`why_the_name_gofannon.md`](https://github.com/The-AI-Alliance/gofannon/blob/main/why_the_name_gofannon.md) for the rich story on why we chose to honor this Celtic Diety
51
+
52
+ ## Our Mission
53
+
54
+ We aim to achieve:
55
+
56
+ ### Cross-Framework Compatibility
57
+ We solve the "vendor lock-in" problem in AI tooling through:
58
+ - Standardized interface definitions
59
+ - Automatic schema translation
60
+ - Bidirectional conversion tools
61
+
62
+ ### Open Source Education
63
+ We make AI development accessible by:
64
+ - Curated contribution pathways
65
+ - Interactive documentation
66
+ - Pair programming sessions
67
+ - Weekly office hours
68
+
69
+ ### Encouraging First-Time Contributors
70
+ We actively support new contributors through:
71
+ - Beginner-friendly issues
72
+ - Clear documentation and guides
73
+ - Supportuve community engagement
74
+
75
+ ## Features
76
+
77
+ - **Basic Math Operations**: Perform addition, subtraction, multiplication, division, and exponentiation.
78
+ - **GitHub Integration**: Interact with GitHub repositories, including creating issues, committing files, and retrieving repository contents.
79
+ - **arXiv Search**: Search for and retrieve articles from arXiv.
80
+ - **Advanced Reasoning**: Utilize Chain-of-Thought (CoT) and Tree-of-Thought (ToT) reasoning techniques for complex problem-solving.
81
+ - **NHTSA Complaints**: Retrieve vehicle complaint data from the National Highway Traffic Safety Administration (NHTSA).
82
+
83
+ ## Roadmap
84
+
85
+ For a detailed overview of planned features and their current status, please refer to the [ROADMAP](https://github.com/The-AI-Alliance/gofannon/blob/main/ROADMAP.md).
86
+
87
+ ## Documentation
88
+
89
+ Documentation can be found [here](https://github.com/The-AI-Alliance/gofannon/tree/main/docs).Each tool comes with its own documentation, which can be found in the docs/ directory. The documentation provides detailed information on how to use each tool, including required parameters and example usage.
90
+
91
+ ## Installation
92
+
93
+ To install gofannon, simply clone the repository and install the required dependencies:
94
+
95
+ ```bash
96
+ git clone https://github.com/The-AI-Alliance/gofannon.git
97
+ cd gofannon
98
+ pip install -r requirements.txt
99
+ ```
100
+
101
+ or
102
+
103
+ ```
104
+ pip install git+https://github.com/The-AI-Alliance/gofannon.git
105
+ # OR
106
+ pip install gofannon
107
+ ```
108
+
109
+ ## Communication Channels
110
+ - **Discord** [Join our Discord server](https://discord.gg/2MMCVs76Sr)for eal-time collaboration and support
111
+ - **GitHub Discussions**: Explore our [GitHub organization](https://github.com/The-AI-Alliance/agents-wg/discussions/) for all related projects
112
+ - **Community Calls**: [Join our bi-weekly video meetings](https://calendar.app.google/c4eKW4zrNiXaue926)
113
+
114
+ ## Usage Example
115
+ ```bash
116
+ from gofannon.base import BaseTool
117
+
118
+ class NewTool(BaseTool):
119
+ def __init__(self):
120
+ super().__init__()
121
+
122
+ @property
123
+ def definition(self):
124
+ return {
125
+ # Define your tool metadata and configuration
126
+ }
127
+
128
+ def fn(self, *args, **kwargs):
129
+ # Define your tool functionality
130
+ pass
131
+ ```
132
+
133
+ ## License
134
+
135
+ This project is licensed under the ASFv2 License. See the [LICENSE](https://github.com/The-AI-Alliance/gofannon/blob/main/LICENSE) file for more details.
136
+
137
+ ## Contributing
138
+
139
+ We welcome contributions from the community! If you'd like to add a new tool or improve an existing one, please check out our [CONTRIBUTING](https://github.com/The-AI-Alliance/gofannon/blob/main/CONTRIBUTING.md) guide for detailed instructions on how to get started.
140
+
141
+ ## Support
142
+
143
+ If you encounter any issues or have questions, please open an issue on our [GitHub repository](https://github.com/your-repo/gofannon/issues).
144
+
145
+ ## Acknowledgments
146
+
147
+ We would like to thank the open-source community for their contributions and support in making this project possible.
148
+
@@ -0,0 +1,111 @@
1
+ ![gofannon logo](https://github.com/The-AI-Alliance/gofannon/blob/main/gofannon.jpg)
2
+ <!-- ![CI](https://github.com/The-AI-Alliance/gofannon/actions/workflows/main.yml/badge.svg) -->
3
+ ![PyPI](https://img.shields.io/pypi/v/gofannon)
4
+ ![License](https://img.shields.io/github/license/The-AI-Alliance/gofannon)
5
+ ![Issues](https://img.shields.io/github/issues/The-AI-Alliance/gofannon)
6
+ ![GitHub stars](https://img.shields.io/github/stars/The-AI-Alliance/gofannon?style=social)
7
+
8
+ # gofannon
9
+
10
+ **gofannon** is a collection of tools designed to enhance the capabilities of function-calling-enabled language models. These tools provide additional functionality for various tasks, including mathematical operations, GitHub interactions, arXiv searches, and advanced reasoning techniques.
11
+
12
+ ## Why the name `gofanon` ?
13
+
14
+ See [`why_the_name_gofannon.md`](https://github.com/The-AI-Alliance/gofannon/blob/main/why_the_name_gofannon.md) for the rich story on why we chose to honor this Celtic Diety
15
+
16
+ ## Our Mission
17
+
18
+ We aim to achieve:
19
+
20
+ ### Cross-Framework Compatibility
21
+ We solve the "vendor lock-in" problem in AI tooling through:
22
+ - Standardized interface definitions
23
+ - Automatic schema translation
24
+ - Bidirectional conversion tools
25
+
26
+ ### Open Source Education
27
+ We make AI development accessible by:
28
+ - Curated contribution pathways
29
+ - Interactive documentation
30
+ - Pair programming sessions
31
+ - Weekly office hours
32
+
33
+ ### Encouraging First-Time Contributors
34
+ We actively support new contributors through:
35
+ - Beginner-friendly issues
36
+ - Clear documentation and guides
37
+ - Supportuve community engagement
38
+
39
+ ## Features
40
+
41
+ - **Basic Math Operations**: Perform addition, subtraction, multiplication, division, and exponentiation.
42
+ - **GitHub Integration**: Interact with GitHub repositories, including creating issues, committing files, and retrieving repository contents.
43
+ - **arXiv Search**: Search for and retrieve articles from arXiv.
44
+ - **Advanced Reasoning**: Utilize Chain-of-Thought (CoT) and Tree-of-Thought (ToT) reasoning techniques for complex problem-solving.
45
+ - **NHTSA Complaints**: Retrieve vehicle complaint data from the National Highway Traffic Safety Administration (NHTSA).
46
+
47
+ ## Roadmap
48
+
49
+ For a detailed overview of planned features and their current status, please refer to the [ROADMAP](https://github.com/The-AI-Alliance/gofannon/blob/main/ROADMAP.md).
50
+
51
+ ## Documentation
52
+
53
+ Documentation can be found [here](https://github.com/The-AI-Alliance/gofannon/tree/main/docs).Each tool comes with its own documentation, which can be found in the docs/ directory. The documentation provides detailed information on how to use each tool, including required parameters and example usage.
54
+
55
+ ## Installation
56
+
57
+ To install gofannon, simply clone the repository and install the required dependencies:
58
+
59
+ ```bash
60
+ git clone https://github.com/The-AI-Alliance/gofannon.git
61
+ cd gofannon
62
+ pip install -r requirements.txt
63
+ ```
64
+
65
+ or
66
+
67
+ ```
68
+ pip install git+https://github.com/The-AI-Alliance/gofannon.git
69
+ # OR
70
+ pip install gofannon
71
+ ```
72
+
73
+ ## Communication Channels
74
+ - **Discord** [Join our Discord server](https://discord.gg/2MMCVs76Sr)for eal-time collaboration and support
75
+ - **GitHub Discussions**: Explore our [GitHub organization](https://github.com/The-AI-Alliance/agents-wg/discussions/) for all related projects
76
+ - **Community Calls**: [Join our bi-weekly video meetings](https://calendar.app.google/c4eKW4zrNiXaue926)
77
+
78
+ ## Usage Example
79
+ ```bash
80
+ from gofannon.base import BaseTool
81
+
82
+ class NewTool(BaseTool):
83
+ def __init__(self):
84
+ super().__init__()
85
+
86
+ @property
87
+ def definition(self):
88
+ return {
89
+ # Define your tool metadata and configuration
90
+ }
91
+
92
+ def fn(self, *args, **kwargs):
93
+ # Define your tool functionality
94
+ pass
95
+ ```
96
+
97
+ ## License
98
+
99
+ This project is licensed under the ASFv2 License. See the [LICENSE](https://github.com/The-AI-Alliance/gofannon/blob/main/LICENSE) file for more details.
100
+
101
+ ## Contributing
102
+
103
+ We welcome contributions from the community! If you'd like to add a new tool or improve an existing one, please check out our [CONTRIBUTING](https://github.com/The-AI-Alliance/gofannon/blob/main/CONTRIBUTING.md) guide for detailed instructions on how to get started.
104
+
105
+ ## Support
106
+
107
+ If you encounter any issues or have questions, please open an issue on our [GitHub repository](https://github.com/your-repo/gofannon/issues).
108
+
109
+ ## Acknowledgments
110
+
111
+ We would like to thank the open-source community for their contributions and support in making this project possible.
File without changes
@@ -0,0 +1,113 @@
1
+ import time
2
+ from abc import ABC, abstractmethod
3
+ from dataclasses import dataclass
4
+ from typing import Any, Callable
5
+ import json
6
+ import logging
7
+ from pathlib import Path
8
+ from ..config import ToolConfig
9
+
10
+ from .smol_agents import SmolAgentsMixin
11
+ from .langchain import LangchainMixin
12
+ from .bedrock import BedrockMixin
13
+
14
+
15
+ @dataclass
16
+ class ToolResult:
17
+ success: bool
18
+ output: Any
19
+ error: str = None
20
+ retryable: bool = False
21
+
22
+
23
+ class WorkflowContext:
24
+ def __init__(self, firebase_config=None):
25
+ self.data = {}
26
+ self.execution_log = []
27
+ self.firebase_config = firebase_config
28
+ self.local_storage = Path.home() / ".llama" / "checkpoints"
29
+ self.local_storage.mkdir(parents=True, exist_ok=True)
30
+
31
+ def save_checkpoint(self, name="checkpoint"):
32
+ if self.firebase_config:
33
+ self._save_to_firebase(name)
34
+ else:
35
+ self._save_local(name)
36
+
37
+ def _save_local(self, name):
38
+ path = self.local_storage / f"{name}.json"
39
+ with open(path, "w") as f:
40
+ json.dump({"data": self.data, "execution_log": self.execution_log}, f)
41
+
42
+ def _save_to_firebase(self, name):
43
+ from firebase_admin import firestore
44
+
45
+ db = firestore.client()
46
+ doc_ref = db.collection("checkpoints").document(name)
47
+ doc_ref.set(
48
+ {
49
+ "data": self.data,
50
+ "execution_log": self.execution_log,
51
+ "timestamp": firestore.SERVER_TIMESTAMP,
52
+ }
53
+ )
54
+
55
+ def log_execution(self, tool_name, duration, input_data, output_data):
56
+ entry = {
57
+ "tool": tool_name,
58
+ "duration": duration,
59
+ "input": input_data,
60
+ "output": output_data,
61
+ }
62
+ self.execution_log.append(entry)
63
+
64
+
65
+ class BaseTool(SmolAgentsMixin, LangchainMixin, BedrockMixin, ABC):
66
+ def __init__(self, **kwargs):
67
+ self.logger = logging.getLogger(
68
+ f"{self.__class__.__module__}.{self.__class__.__name__}"
69
+ )
70
+ self._load_config()
71
+ self._configure(**kwargs)
72
+ self.logger.debug("Initialized %s tool", self.__class__.__name__)
73
+
74
+ def _configure(self, **kwargs):
75
+ """Set instance-specific configurations"""
76
+ for key, value in kwargs.items():
77
+ if hasattr(self, key):
78
+ setattr(self, key, value)
79
+
80
+ def _load_config(self):
81
+ """Auto-load config based on tool type"""
82
+ if hasattr(self, "API_SERVICE"):
83
+ self.api_key = ToolConfig.get(f"{self.API_SERVICE}_api_key")
84
+
85
+ @property
86
+ @abstractmethod
87
+ def definition(self):
88
+ pass
89
+
90
+ @property
91
+ def output_schema(self):
92
+ return self.definition.get("function", {}).get("parameters", {})
93
+
94
+ @abstractmethod
95
+ def fn(self, *args, **kwargs):
96
+ pass
97
+
98
+ def execute(self, context: WorkflowContext, **kwargs) -> ToolResult:
99
+ try:
100
+ start_time = time.time()
101
+ result = self.fn(**kwargs)
102
+ duration = time.time() - start_time
103
+
104
+ context.log_execution(
105
+ tool_name=self.__class__.__name__,
106
+ duration=duration,
107
+ input_data=kwargs,
108
+ output_data=result,
109
+ )
110
+
111
+ return ToolResult(success=True, output=result)
112
+ except Exception as e:
113
+ return ToolResult(success=False, output=None, error=str(e), retryable=True)