gofannon 0.25.13__tar.gz → 0.25.15__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.15/PKG-INFO +119 -0
  2. gofannon-0.25.15/README.md +81 -0
  3. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/base/__init__.py +14 -1
  4. gofannon-0.25.15/gofannon/base/langflow.py +111 -0
  5. gofannon-0.25.15/gofannon/base/mcp.py +6 -0
  6. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/config.py +2 -1
  7. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/github/commit_files.py +4 -2
  8. gofannon-0.25.15/gofannon/nasa/apod.py +68 -0
  9. gofannon-0.25.15/gofannon/reasoning/__init__.py +0 -0
  10. gofannon-0.25.15/gofannon/wikipedia/__init__.py +0 -0
  11. gofannon-0.25.15/gofannon/wikipedia/wikipedia_lookup.py +78 -0
  12. {gofannon-0.25.13 → gofannon-0.25.15}/pyproject.toml +17 -8
  13. gofannon-0.25.13/PKG-INFO +0 -148
  14. gofannon-0.25.13/README.md +0 -111
  15. {gofannon-0.25.13 → gofannon-0.25.15}/LICENSE +0 -0
  16. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/__init__.py +0 -0
  17. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/arxiv/__init__.py +0 -0
  18. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/arxiv/get_article.py +0 -0
  19. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/arxiv/search.py +0 -0
  20. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/base/bedrock.py +0 -0
  21. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/base/langchain.py +0 -0
  22. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/base/smol_agents.py +0 -0
  23. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/basic_math/__init__.py +0 -0
  24. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/basic_math/addition.py +0 -0
  25. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/basic_math/division.py +0 -0
  26. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/basic_math/exponents.py +0 -0
  27. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/basic_math/multiplication.py +0 -0
  28. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/basic_math/subtraction.py +0 -0
  29. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/cli.py +0 -0
  30. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/github/__init__.py +0 -0
  31. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/github/commit_file.py +0 -0
  32. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/github/create_issue.py +0 -0
  33. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/github/get_repo_contents.py +0 -0
  34. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/github/pr_review_tool.py +0 -0
  35. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/github/read_issue.py +0 -0
  36. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/github/search.py +0 -0
  37. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/google_search/__init__.py +0 -0
  38. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/google_search/google_search.py +0 -0
  39. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/headless_browser/__init__.py +0 -0
  40. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/headless_browser/base.py +0 -0
  41. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/headless_browser/headless_browser_get.py +0 -0
  42. {gofannon-0.25.13/gofannon/reasoning → gofannon-0.25.15/gofannon/nasa}/__init__.py +0 -0
  43. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/nhsta/__init__.py +0 -0
  44. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/open_notify_space/__init__.py +0 -0
  45. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/open_notify_space/iss_locator.py +0 -0
  46. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/orchestration/__init__.py +0 -0
  47. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/orchestration/firebase_wrapper.py +0 -0
  48. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/reasoning/base.py +0 -0
  49. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/reasoning/hierarchical_cot.py +0 -0
  50. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/reasoning/sequential_cot.py +0 -0
  51. {gofannon-0.25.13 → gofannon-0.25.15}/gofannon/reasoning/tree_of_thought.py +0 -0
@@ -0,0 +1,119 @@
1
+ Metadata-Version: 2.3
2
+ Name: gofannon
3
+ Version: 0.25.15
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: langflow
20
+ Provides-Extra: smolagents
21
+ Provides-Extra: testing
22
+ Requires-Dist: GitPython (>=3.1.43,<4.0.0)
23
+ Requires-Dist: boto3 (>=1.34.97,<2.0.0) ; extra == "aws"
24
+ Requires-Dist: google-api-python-client (>=2.154.0,<3.0.0) ; extra == "google"
25
+ Requires-Dist: jsonschema (>=4.23.0,<5.0.0)
26
+ Requires-Dist: langchain-core (>=0.3.16,<0.4.0) ; (python_version < "3.13") and (extra == "langchain")
27
+ Requires-Dist: openai (>=1.60.2,<2.0.0)
28
+ Requires-Dist: pydantic (>=2.10.6,<3.0.0) ; extra == "langchain"
29
+ Requires-Dist: pygithub (>=2.6.1,<3.0.0)
30
+ Requires-Dist: pytest (>=8.3.5,<9.0.0) ; extra == "testing"
31
+ Requires-Dist: python-dotenv (>=1.0.1,<2.0.0)
32
+ Requires-Dist: requests (>=2.32.3,<3.0.0)
33
+ Requires-Dist: requests-mock (>=1.12.1,<2.0.0) ; extra == "testing"
34
+ Requires-Dist: selenium (>=4.10.0,<5.0.0) ; extra == "headless-browser"
35
+ Requires-Dist: smolagents (>=1.6.0,<2.0.0) ; extra == "smolagents"
36
+ Description-Content-Type: text/markdown
37
+
38
+ ![logo](https://the-ai-alliance.github.io/gofannon/assets/images/logo_1000x1260.png)
39
+ <!-- ![CI](https://github.com/The-AI-Alliance/gofannon/actions/workflows/main.yml/badge.svg) -->
40
+ ![PyPI](https://img.shields.io/pypi/v/gofannon)
41
+ ![License](https://img.shields.io/github/license/The-AI-Alliance/gofannon)
42
+ ![Issues](https://img.shields.io/github/issues/The-AI-Alliance/gofannon)
43
+ ![GitHub stars](https://img.shields.io/github/stars/The-AI-Alliance/gofannon?style=social)
44
+
45
+ # `gofannon`
46
+
47
+ **[gofannon](https://the-ai-alliance.github.io/gofannon/)** is a collection of tools designed to enhance the capabilities of
48
+ function-calling-enabled language models/agents. These tools provide additional
49
+ functionality for various tasks.
50
+
51
+
52
+ ## 🌟🌟 Features 🌟🌟
53
+
54
+ 1. Cross-Framework Compatibility (Import From/Export To Multiple Frameworks)
55
+ - **Current:** `smolagents`, LangChain, AWS Bedrock
56
+ - **Currently Being Developed:** [Up To Date List](https://github.com/The-AI-Alliance/gofannon/issues?q=is%3Aissue%20state%3Aopen%20label%3Aframework%20assignee:*)
57
+ - **In The Roadmap:** [Up To Date List](https://github.com/The-AI-Alliance/gofannon/issues?q=is%3Aissue%20state%3Aopen%20label%3Aframework%20no%3Aassignee)
58
+ 2. A Robust Collection of Tools
59
+ - List [Here](https://github.com/The-AI-Alliance/gofannon/pulls?q=is%3Apr+is%3Aclosed+label%3Atool)
60
+ - New Tools being added daily
61
+ 3. New Contributor Friendly
62
+ - [Curated contribution pathways](https://the-ai-alliance.github.io/gofannon/developers/)
63
+ - [Gamified Contributor Process](https://the-ai-alliance.github.io/gofannon/leaderboard.html)
64
+ ## 🎓🎓 Why the name `gofannon`? 🎓🎓
65
+
66
+ See [`why_the_name_gofannon`](https://the-ai-alliance.github.io/gofannon/about/the_name_gofannon/) for the rich story on why we chose to honor this Celtic Diety
67
+
68
+ ## ⚡️⚡️Quickstart ⚡️⚡️
69
+
70
+ ```bash
71
+ pip install gofannon
72
+ ```
73
+
74
+ gofannon is an ambitious upstart, things are happening fast. We have a git
75
+ action that deploys to PyPi every Monday morning, so `pip install gofannon`
76
+ will get you pretty close to the tip of the spear. But if you absolutely _must_
77
+ have the latest and greatest, this will work too:
78
+
79
+ ```bash
80
+ git+https://github.com/The-AI-Alliance/gofannon.git@main
81
+ ```
82
+
83
+ For more information, see out [quickstart guide](https://github.com/The-AI-Alliance/gofannon/blob/main/docs/quickstart.md).
84
+
85
+ ## 🏆🏆 Acknowledgments 🏆🏆
86
+
87
+ We would like to thank the open-source community for their contributions and support in making this project possible.
88
+
89
+ <a href="https://github.com/The-AI-Alliance/gofannon/graphs/contributors">
90
+ <img src="https://contrib.rocks/image?repo=The-AI-Alliance/gofannon" />
91
+ </a>
92
+
93
+ Made with [contrib.rocks](https://contrib.rocks).
94
+
95
+ ## 🗞️🗞️ Stay Up To Date 🗞️🗞️
96
+
97
+ Star `gofannon` for good karma (and to receive updates in your github feed).
98
+
99
+ ![gif showng how to star](https://the-ai-alliance.github.io/gofannon/assets/images/github-star.gif)
100
+
101
+ ## 🚲🚲 Roadmap 🚲🚲
102
+
103
+ 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).
104
+
105
+ ## 📘📘 Documentation 📘📘
106
+
107
+ 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.
108
+
109
+ ## ☎️☎️ Contact Us ☎️☎️
110
+
111
+ [Contact Information](https://the-ai-alliance.github.io/gofannon/community/contact.html)
112
+
113
+ ## 🧑‍⚖️🧑‍⚖️ License 🧑‍⚖️🧑‍⚖️
114
+
115
+ 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.
116
+
117
+
118
+
119
+
@@ -0,0 +1,81 @@
1
+ ![logo](https://the-ai-alliance.github.io/gofannon/assets/images/logo_1000x1260.png)
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](https://the-ai-alliance.github.io/gofannon/)** is a collection of tools designed to enhance the capabilities of
11
+ function-calling-enabled language models/agents. These tools provide additional
12
+ functionality for various tasks.
13
+
14
+
15
+ ## 🌟🌟 Features 🌟🌟
16
+
17
+ 1. Cross-Framework Compatibility (Import From/Export To Multiple Frameworks)
18
+ - **Current:** `smolagents`, LangChain, AWS Bedrock
19
+ - **Currently Being Developed:** [Up To Date List](https://github.com/The-AI-Alliance/gofannon/issues?q=is%3Aissue%20state%3Aopen%20label%3Aframework%20assignee:*)
20
+ - **In The Roadmap:** [Up To Date List](https://github.com/The-AI-Alliance/gofannon/issues?q=is%3Aissue%20state%3Aopen%20label%3Aframework%20no%3Aassignee)
21
+ 2. A Robust Collection of Tools
22
+ - List [Here](https://github.com/The-AI-Alliance/gofannon/pulls?q=is%3Apr+is%3Aclosed+label%3Atool)
23
+ - New Tools being added daily
24
+ 3. New Contributor Friendly
25
+ - [Curated contribution pathways](https://the-ai-alliance.github.io/gofannon/developers/)
26
+ - [Gamified Contributor Process](https://the-ai-alliance.github.io/gofannon/leaderboard.html)
27
+ ## 🎓🎓 Why the name `gofannon`? 🎓🎓
28
+
29
+ See [`why_the_name_gofannon`](https://the-ai-alliance.github.io/gofannon/about/the_name_gofannon/) for the rich story on why we chose to honor this Celtic Diety
30
+
31
+ ## ⚡️⚡️Quickstart ⚡️⚡️
32
+
33
+ ```bash
34
+ pip install gofannon
35
+ ```
36
+
37
+ gofannon is an ambitious upstart, things are happening fast. We have a git
38
+ action that deploys to PyPi every Monday morning, so `pip install gofannon`
39
+ will get you pretty close to the tip of the spear. But if you absolutely _must_
40
+ have the latest and greatest, this will work too:
41
+
42
+ ```bash
43
+ git+https://github.com/The-AI-Alliance/gofannon.git@main
44
+ ```
45
+
46
+ For more information, see out [quickstart guide](https://github.com/The-AI-Alliance/gofannon/blob/main/docs/quickstart.md).
47
+
48
+ ## 🏆🏆 Acknowledgments 🏆🏆
49
+
50
+ We would like to thank the open-source community for their contributions and support in making this project possible.
51
+
52
+ <a href="https://github.com/The-AI-Alliance/gofannon/graphs/contributors">
53
+ <img src="https://contrib.rocks/image?repo=The-AI-Alliance/gofannon" />
54
+ </a>
55
+
56
+ Made with [contrib.rocks](https://contrib.rocks).
57
+
58
+ ## 🗞️🗞️ Stay Up To Date 🗞️🗞️
59
+
60
+ Star `gofannon` for good karma (and to receive updates in your github feed).
61
+
62
+ ![gif showng how to star](https://the-ai-alliance.github.io/gofannon/assets/images/github-star.gif)
63
+
64
+ ## 🚲🚲 Roadmap 🚲🚲
65
+
66
+ 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).
67
+
68
+ ## 📘📘 Documentation 📘📘
69
+
70
+ 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.
71
+
72
+ ## ☎️☎️ Contact Us ☎️☎️
73
+
74
+ [Contact Information](https://the-ai-alliance.github.io/gofannon/community/contact.html)
75
+
76
+ ## 🧑‍⚖️🧑‍⚖️ License 🧑‍⚖️🧑‍⚖️
77
+
78
+ 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.
79
+
80
+
81
+
@@ -5,11 +5,16 @@ from typing import Any, Callable
5
5
  import json
6
6
  import logging
7
7
  from pathlib import Path
8
+
9
+ import anyio
10
+
8
11
  from ..config import ToolConfig
9
12
 
10
13
  from .smol_agents import SmolAgentsMixin
11
14
  from .langchain import LangchainMixin
12
15
  from .bedrock import BedrockMixin
16
+ from .langflow import LangflowMixin
17
+ from .mcp import MCPMixin
13
18
 
14
19
 
15
20
  @dataclass
@@ -62,7 +67,12 @@ class WorkflowContext:
62
67
  self.execution_log.append(entry)
63
68
 
64
69
 
65
- class BaseTool(SmolAgentsMixin, LangchainMixin, BedrockMixin, ABC):
70
+ class BaseTool(SmolAgentsMixin,
71
+ LangchainMixin,
72
+ BedrockMixin,
73
+ LangflowMixin,
74
+ MCPMixin,
75
+ ABC):
66
76
  def __init__(self, **kwargs):
67
77
  self.logger = logging.getLogger(
68
78
  f"{self.__class__.__module__}.{self.__class__.__name__}"
@@ -111,3 +121,6 @@ class BaseTool(SmolAgentsMixin, LangchainMixin, BedrockMixin, ABC):
111
121
  return ToolResult(success=True, output=result)
112
122
  except Exception as e:
113
123
  return ToolResult(success=False, output=None, error=str(e), retryable=True)
124
+
125
+ async def execute_async(self, arguments: dict):
126
+ return await anyio.to_thread.run_sync(self.fn, **arguments)
@@ -0,0 +1,111 @@
1
+ try:
2
+ from langflow.custom import Component
3
+ from langflow.io import MessageTextInput, IntInput, BoolInput, FloatInput, Output
4
+ from langflow.schema import Data
5
+
6
+ _HAS_LANGFLOW = True
7
+ except ImportError:
8
+ _HAS_LANGFLOW = False
9
+
10
+
11
+ class LangflowMixin:
12
+ def import_from_langflow(self, langflow_component):
13
+ """Adapt a Langflow component to a Gofannon tool"""
14
+ if not _HAS_LANGFLOW:
15
+ raise RuntimeError(
16
+ "langflow is not installed. Install with `pip install langflow`"
17
+ )
18
+
19
+ self.name = langflow_component.display_name.replace(" ", "_").lower()
20
+ self.description = langflow_component.description
21
+
22
+ # Extract parameters from component inputs
23
+ parameters = {
24
+ "type": "object",
25
+ "properties": {},
26
+ "required": []
27
+ }
28
+
29
+ for component_input in langflow_component.inputs:
30
+ if component_input.name in ["self", "context"]:
31
+ continue
32
+
33
+ param_type = "string"
34
+ if isinstance(component_input, (IntInput, FloatInput)):
35
+ param_type = "number"
36
+ elif isinstance(component_input, BoolInput):
37
+ param_type = "boolean"
38
+
39
+ parameters["properties"][component_input.name] = {
40
+ "type": param_type,
41
+ "description": component_input.info or ""
42
+ }
43
+
44
+ if component_input.required:
45
+ parameters["required"].append(component_input.name)
46
+
47
+ self.definition = {
48
+ "function": {
49
+ "name": self.name,
50
+ "description": self.description,
51
+ "parameters": parameters
52
+ }
53
+ }
54
+
55
+ # Create execution wrapper
56
+ def adapted_fn(**kwargs):
57
+ result = langflow_component.build()(**kwargs)
58
+ return result.data if isinstance(result, Data) else result
59
+
60
+ self.fn = adapted_fn
61
+
62
+ def export_to_langflow(self):
63
+ """Convert Gofannon tool to Langflow component"""
64
+ if not _HAS_LANGFLOW:
65
+ raise RuntimeError(
66
+ "langflow is not installed. Install with `pip install langflow`"
67
+ )
68
+
69
+ parameters = self.definition.get("function", {}).get("parameters", {})
70
+ param_properties = parameters.get("properties", {})
71
+ required_params = parameters.get("required", [])
72
+
73
+ # Create input fields
74
+ component_inputs = []
75
+ type_map = {
76
+ "string": MessageTextInput,
77
+ "number": FloatInput,
78
+ "integer": IntInput,
79
+ "boolean": BoolInput
80
+ }
81
+
82
+ for param_name, param_def in param_properties.items():
83
+ input_type = param_def.get("type", "string")
84
+ InputClass = type_map.get(input_type, MessageTextInput)
85
+
86
+ component_inputs.append(
87
+ InputClass(
88
+ name=param_name,
89
+ display_name=param_name.replace("_", " ").title(),
90
+ info=param_def.get("description", ""),
91
+ required=param_name in required_params,
92
+ tool_mode=True
93
+ )
94
+ )
95
+
96
+ # Define component class
97
+ class ExportedComponent(Component):
98
+ display_name = self.definition["function"]["name"].title()
99
+ description = self.definition["function"]["description"]
100
+ icon = "tool"
101
+
102
+ inputs = component_inputs
103
+ outputs = [Output(display_name="Result", name="result", method="run_tool")]
104
+
105
+ def run_tool(self, **kwargs):
106
+ result = self.tool.execute(context=None, **kwargs)
107
+ return Data(data=result.output)
108
+
109
+ # Attach tool instance to component class
110
+ ExportedComponent.tool = self
111
+ return ExportedComponent
@@ -0,0 +1,6 @@
1
+ from json import dumps
2
+
3
+ class MCPMixin:
4
+ def export_to_mcp(self, fast_mcp_server=None):
5
+ """Convert Gofannon tool definition to MCP Tool schema"""
6
+ fast_mcp_server.add_tool(fn=self.fn, name=self.name, description=dumps(self.definition))
@@ -13,7 +13,8 @@ class ToolConfig:
13
13
  'deepinfra_api_key': os.getenv('DEEPINFRA_API_KEY'),
14
14
  'arxiv_api_key': os.getenv('ARXIV_API_KEY'),
15
15
  'google_search_api_key': os.getenv('GOOGLE_SEARCH_API_KEY'),
16
- 'google_search_engine_id': os.getenv('GOOGLE_SEARCH_ENGINE_ID')
16
+ 'google_search_engine_id': os.getenv('GOOGLE_SEARCH_ENGINE_ID'),
17
+ 'nasa_apod_api_key': os.getenv('NASA_APOD_API_KEY'),
17
18
  }
18
19
 
19
20
  @classmethod
@@ -88,7 +88,8 @@ class CommitFiles(BaseTool):
88
88
  if branch in repo.heads:
89
89
  # If it does, checkout the branch and pull the latest changes
90
90
  repo.git.checkout(branch)
91
- repo.git.pull()
91
+ # Explicit pull from origin/branch to avoid tracking dependency
92
+ repo.git.pull('origin', branch)
92
93
  else:
93
94
  # If it does not exist, checkout the base branch and create a new branch
94
95
  try:
@@ -112,5 +113,6 @@ class CommitFiles(BaseTool):
112
113
  repo.index.commit(commit_msg)
113
114
 
114
115
  origin = repo.remotes.origin
115
- origin.push(branch)
116
+ # Push with tracking (still recommended)
117
+ repo.git.push('-u', 'origin', branch)
116
118
  return "Files committed and pushed successfully"
@@ -0,0 +1,68 @@
1
+ from ..base import BaseTool
2
+ from ..config import FunctionRegistry, ToolConfig
3
+ import logging
4
+ import requests
5
+
6
+ logger = logging.getLogger(__name__)
7
+
8
+ """Fetch the Astronomy Picture of the Day (APOD) from NASA's API.
9
+
10
+ This tool retrieves the daily astronomy image, including metadata such as the
11
+ title, explanation, date, and media type. It interacts with NASA's APOD API
12
+ and returns the data as a structured dictionary.
13
+
14
+ Authentication:
15
+ Requires an API key from NASA, available at https://api.nasa.gov/
16
+ The API key should be set in the environment as NASA_APOD_API_KEY
17
+ or passed as an argument during initialization.
18
+ """
19
+
20
+ @FunctionRegistry.register
21
+ class AstronomyPhotoOfTheDayTool(BaseTool):
22
+ def __init__(self, api_key=None ,name='apod'):
23
+ super().__init__()
24
+ self.name = name
25
+ self.api_key = api_key or ToolConfig.get("nasa_apod_api_key")
26
+
27
+ @property
28
+ def definition(self):
29
+ return {
30
+ "type": "function",
31
+ "function": {
32
+ "name": self.name,
33
+ "description": "Get the Astronomy Picture of the Day from NASA",
34
+ "parameters":{
35
+ "type": "object",
36
+ "properties": {},
37
+ "required": []
38
+ }
39
+ }
40
+ }
41
+
42
+ def fn(self):
43
+ logger.debug("Fetching NASA APOD data")
44
+ if not self.api_key:
45
+ logger.error("API key is missing. Cannot fetch APOD data.")
46
+ return {"error": "API key is missing. Please set it in the environment or pass it as an argument."}
47
+ url = "https://api.nasa.gov/planetary/apod"
48
+ params = {
49
+ "api_key": self.api_key
50
+ }
51
+
52
+ try:
53
+ response = requests.get(url, params=params)
54
+ response.raise_for_status()
55
+ data = response.json()
56
+
57
+ return{
58
+ "title": data.get("title", "No title available"),
59
+ "date": data.get("date", "No date available"),
60
+ "explanation": data.get("explanation", "No explanation available"),
61
+ "url": data.get("url", None),
62
+ "media_type": data.get("media_type", "unknown"),
63
+ }
64
+ except requests.exceptions.RequestException as e:
65
+ logger.error(f"Error fetching data from NASA APOD: {e}")
66
+ return {
67
+ "error": str(e)
68
+ }
File without changes
File without changes
@@ -0,0 +1,78 @@
1
+ from ..base import BaseTool
2
+ from ..config import FunctionRegistry
3
+ import logging
4
+ import requests
5
+
6
+ logger = logging.getLogger(__name__)
7
+
8
+ """Wikipedia Lookup Tool for retrieving article summaries from Wikipedia.
9
+ This class provides functionality to fetch summaries of Wikipedia articles using the Wikipedia REST API.
10
+ Attributes:
11
+ name (str): The name identifier for the tool, defaults to 'wikipedia_lookup'
12
+ Methods:
13
+ definition: Returns the OpenAI function definition schema for the tool
14
+ fn(query): Executes the Wikipedia lookup and returns article data
15
+ The tool performs the following:
16
+ 1. Accepts a search query string
17
+ 2. Makes a GET request to Wikipedia's REST API
18
+ 3. Returns a dictionary containing:
19
+ - title: The article title
20
+ - summary: The article extract/summary
21
+ - image: URL to the article's thumbnail image (if available)
22
+ - url: URL to the full Wikipedia article page
23
+ If the API request fails, it returns an error dictionary.
24
+ Example:
25
+ tool = WikipediaLookup()
26
+ result = tool.fn("Python programming")
27
+ # Returns dictionary with article data or error message
28
+ Raises:
29
+ Handles HTTP errors internally by returning error dictionary
30
+ Returns:
31
+ dict: Article data including title, summary, image URL, and article URL,
32
+ or error message if lookup fails
33
+ """
34
+
35
+ @FunctionRegistry.register
36
+ class WikipediaLookup(BaseTool):
37
+ def __init__(self, name='wikipedia_lookup'):
38
+ super().__init__()
39
+ self.name = name
40
+
41
+ @property
42
+ def definition(self):
43
+ return{
44
+ "type": "function",
45
+ "function": {
46
+ "name": self.name,
47
+ "description": "Fetches a Wikipedia summary for a given search term.",
48
+ "parameters": {
49
+ "type": "object",
50
+ "properties": {
51
+ "query": {
52
+ "type": "string",
53
+ "description": "The search term to look up on Wikipedia."
54
+ }
55
+ },
56
+ "required": ["query"]
57
+ }
58
+ }
59
+ }
60
+
61
+ def fn(self, query):
62
+ logger.debug(f"Fetching Wikipedia summary for: {query}")
63
+ base_url = "https://en.wikipedia.org/api/rest_v1/page/summary/"
64
+ response = requests.get(base_url + query.replace(" ", "_"))
65
+
66
+ if response.status_code == 200:
67
+ data = response.json()
68
+ return {
69
+ "title": data.get("title", "No title found"),
70
+ "summary": data.get("extract", "No summary found"),
71
+ "image": data.get("thumbnail", {}).get("source", None),
72
+ "url": data.get("content_urls", {}).get("desktop", {}).get("page", None)
73
+ }
74
+ else:
75
+ return{
76
+ "error": f"Failed to fetch Wikipedia summary for {query}"
77
+ }
78
+
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "gofannon"
3
- version = "0.25.13"
3
+ version = "0.25.15"
4
4
  description = "A collection of tools for LLMs"
5
5
  authors = ["Trevor Grant <trevor.d.grant@gmail.com>"]
6
6
  license = "ASFv2"
@@ -8,7 +8,7 @@ readme = "README.md"
8
8
  packages = [{include = "gofannon"}]
9
9
 
10
10
  [tool.poetry.dependencies]
11
- python = "^3.10"
11
+ python = ">=3.10,<4.0"
12
12
  openai = "^1.60.2"
13
13
  requests = "^2.32.3"
14
14
  GitPython = "^3.1.43"
@@ -16,22 +16,31 @@ python-dotenv = "^1.0.1"
16
16
  jsonschema = "^4.23.0"
17
17
  pygithub = "^2.6.1"
18
18
 
19
- pytest = { version = "^8.3.4", optional = true }
20
- langchain = { version = "^0.3.16", optional = true }
19
+ # Optional dependencies
20
+ pytest = { version = "^8.3.5", optional = true }
21
+ langchain-core = { version = "^0.3.16", optional = true, python = "<3.13" }
21
22
  pydantic = { version = "^2.10.6", optional = true }
22
23
  smolagents = { version = "^1.6.0", optional = true }
23
24
  selenium = { version = "^4.10.0", optional = true }
24
- google-api-python-client = { version = "^2.161.0", optional = true}
25
- requests-mock = {version = "^1.12.1", optional = true}
25
+ google-api-python-client = { version = "^2.154.0", optional = true }
26
+ requests-mock = { version = "^1.12.1", optional = true }
26
27
  boto3 = { version = "^1.34.97", optional = true }
28
+ anyio = { version = "^4.9.0", optional = true}
27
29
 
28
30
  [tool.poetry.extras]
29
- testing = ["pytest","requests-mock"]
30
- langchain = ["langchain", "pydantic"]
31
+ testing = ["pytest", "requests-mock"]
32
+ langchain = ["langchain-core", "pydantic"]
31
33
  smolagents = ["smolagents"]
32
34
  headless_browser = ["selenium"]
33
35
  google = ["google-api-python-client"]
34
36
  aws = ["boto3"]
37
+ langflow = []
38
+
39
+ [tool.poetry.group.dev.dependencies]
40
+ pytest = "^8.3.5"
41
+ responses = "^0.25.7"
42
+ pytest-asyncio = "0.26.0"
43
+ mcp = "1.5.0"
35
44
 
36
45
  [build-system]
37
46
  requires = ["poetry-core"]
gofannon-0.25.13/PKG-INFO DELETED
@@ -1,148 +0,0 @@
1
- Metadata-Version: 2.3
2
- Name: gofannon
3
- Version: 0.25.13
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
- ![logo](https://the-ai-alliance.github.io/gofannon/assets/images/logo_1000x1260.png)
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://the-ai-alliance.github.io/gofannon/about/the_name_gofannon/) 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
-
@@ -1,111 +0,0 @@
1
- ![logo](https://the-ai-alliance.github.io/gofannon/assets/images/logo_1000x1260.png)
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://the-ai-alliance.github.io/gofannon/about/the_name_gofannon/) 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
File without changes