gemini-agent-framework 0.1.10__py3-none-any.whl → 0.1.12__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.
- gemini_agent/__init__.py +4 -4
- gemini_agent/agent.py +593 -513
- gemini_agent_framework-0.1.12.dist-info/METADATA +165 -0
- gemini_agent_framework-0.1.12.dist-info/RECORD +6 -0
- gemini_agent_framework-0.1.12.dist-info/licenses/LICENSE +21 -0
- gemini_agent_framework-0.1.10.dist-info/METADATA +0 -76
- gemini_agent_framework-0.1.10.dist-info/RECORD +0 -5
- {gemini_agent_framework-0.1.10.dist-info → gemini_agent_framework-0.1.12.dist-info}/WHEEL +0 -0
@@ -0,0 +1,165 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: gemini-agent-framework
|
3
|
+
Version: 0.1.12
|
4
|
+
Summary: A framework for building agents that use Gemini's function calling capabilities
|
5
|
+
Project-URL: Homepage, https://github.com/m7mdony/gemini-agent-framework
|
6
|
+
Project-URL: Documentation, https://github.com/m7mdony/gemini-agent-framework/wiki
|
7
|
+
Project-URL: Repository, https://github.com/m7mdony/gemini-agent-framework.git
|
8
|
+
Project-URL: Issues, https://github.com/m7mdony/gemini-agent-framework/issues
|
9
|
+
Author-email: Mohamed Baathman <mohamed.baathman2001@gmail.com>
|
10
|
+
License-Expression: MIT
|
11
|
+
License-File: LICENSE
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
13
|
+
Classifier: Intended Audience :: Developers
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
16
|
+
Classifier: Programming Language :: Python :: 3.8
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
20
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
21
|
+
Requires-Python: >=3.8
|
22
|
+
Requires-Dist: python-dotenv>=1.0.0
|
23
|
+
Requires-Dist: requests>=2.31.0
|
24
|
+
Provides-Extra: dev
|
25
|
+
Requires-Dist: black>=23.0.0; extra == 'dev'
|
26
|
+
Requires-Dist: flake8>=6.0.0; extra == 'dev'
|
27
|
+
Requires-Dist: isort>=5.0.0; extra == 'dev'
|
28
|
+
Requires-Dist: mypy>=1.0.0; extra == 'dev'
|
29
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
|
30
|
+
Requires-Dist: pytest>=7.0.0; extra == 'dev'
|
31
|
+
Description-Content-Type: text/markdown
|
32
|
+
|
33
|
+
# Gemini Agent Framework
|
34
|
+
|
35
|
+
A powerful Python framework for building intelligent agents using Google's Gemini API. This framework simplifies the creation of agents that can break down complex tasks into sequential steps using available tools, with support for function calling, variable management, and structured responses.
|
36
|
+
|
37
|
+
## Features
|
38
|
+
|
39
|
+
- 🛠️ **Easy Tool Definition**: Define tools using simple decorators
|
40
|
+
- 🔄 **Sequential Task Breakdown**: Automatically breaks down complex tasks into manageable steps
|
41
|
+
- 📦 **Variable Management**: Store and manage variables with metadata
|
42
|
+
- 🎯 **Structured Responses**: Define response structures for consistent outputs
|
43
|
+
- 🔍 **Intermediate Results**: Access and manage intermediate results
|
44
|
+
- 🛡️ **Error Handling**: Built-in error handling and recovery mechanisms
|
45
|
+
- 🔌 **Extensible**: Easy to extend with custom tools and functionality
|
46
|
+
|
47
|
+
## Installation
|
48
|
+
|
49
|
+
```bash
|
50
|
+
pip install gemini-agent-framework
|
51
|
+
```
|
52
|
+
|
53
|
+
## Quick Start
|
54
|
+
|
55
|
+
```python
|
56
|
+
from gemini_agent import Agent
|
57
|
+
from dotenv import load_dotenv
|
58
|
+
|
59
|
+
load_dotenv()
|
60
|
+
|
61
|
+
# Define your tools
|
62
|
+
@Agent.description("Multiplies two numbers.")
|
63
|
+
@Agent.parameters({
|
64
|
+
'a': {'type': int, 'description': 'The first number'},
|
65
|
+
'b': {'type': int, 'description': 'The second number'}
|
66
|
+
})
|
67
|
+
def multiply(a: int, b: int) -> int:
|
68
|
+
return a * b
|
69
|
+
|
70
|
+
# Create an agent instance
|
71
|
+
agent = Agent(api_key="your-api-key", tools=[multiply])
|
72
|
+
|
73
|
+
# Use the agent
|
74
|
+
response = agent.prompt("Multiply 3 and 7")
|
75
|
+
print(response) # Should output 21
|
76
|
+
```
|
77
|
+
|
78
|
+
## Advanced Usage
|
79
|
+
|
80
|
+
### Variable Management
|
81
|
+
|
82
|
+
```python
|
83
|
+
# Store variables with metadata
|
84
|
+
agent.set_variable("user_name", "John", "The current user's name", str)
|
85
|
+
agent.set_variable("last_login", datetime.now(), "Last login timestamp", datetime)
|
86
|
+
|
87
|
+
# Retrieve variables
|
88
|
+
name = agent.get_variable("user_name")
|
89
|
+
```
|
90
|
+
|
91
|
+
### Structured Responses
|
92
|
+
|
93
|
+
```python
|
94
|
+
response_structure = {
|
95
|
+
"result": {"type": "number"},
|
96
|
+
"explanation": {"type": "string"}
|
97
|
+
}
|
98
|
+
|
99
|
+
response = agent.prompt(
|
100
|
+
"Calculate 5 * 7 and explain the process",
|
101
|
+
response_structure=response_structure
|
102
|
+
)
|
103
|
+
```
|
104
|
+
|
105
|
+
### Custom System Prompts
|
106
|
+
|
107
|
+
```python
|
108
|
+
system_prompt = """
|
109
|
+
You are a helpful assistant that specializes in mathematical calculations.
|
110
|
+
Always show your work and explain your reasoning.
|
111
|
+
"""
|
112
|
+
|
113
|
+
response = agent.prompt(
|
114
|
+
"Solve 15 * 23",
|
115
|
+
system_prompt=system_prompt
|
116
|
+
)
|
117
|
+
```
|
118
|
+
|
119
|
+
## Documentation
|
120
|
+
|
121
|
+
For detailed documentation, please visit our [documentation site](https://github.com/m7mdony/gemini-agent-framework/wiki).
|
122
|
+
|
123
|
+
### Key Topics
|
124
|
+
|
125
|
+
- [API Reference](https://m7mdony.github.io/gemini-agent-framework/api_refrences/)
|
126
|
+
- [Tutorials](https://m7mdony.github.io/gemini-agent-framework/tutorials/)
|
127
|
+
- [Best Practices](https://m7mdony.github.io/gemini-agent-framework/best_practices/)
|
128
|
+
- [Architecture Overview](https://m7mdony.github.io/gemini-agent-framework/architecture/)
|
129
|
+
|
130
|
+
## Contributing
|
131
|
+
|
132
|
+
We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details.
|
133
|
+
|
134
|
+
### Development Setup
|
135
|
+
|
136
|
+
1. Clone the repository
|
137
|
+
2. Install development dependencies:
|
138
|
+
```bash
|
139
|
+
pip install -e ".[dev]"
|
140
|
+
```
|
141
|
+
3. Run tests:
|
142
|
+
```bash
|
143
|
+
pytest
|
144
|
+
```
|
145
|
+
|
146
|
+
## License
|
147
|
+
|
148
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
149
|
+
|
150
|
+
## Support
|
151
|
+
|
152
|
+
- [GitHub Issues](https://github.com/m7mdony/gemini-agent-framework/issues)
|
153
|
+
|
154
|
+
## Citation
|
155
|
+
|
156
|
+
If you use this framework in your research, please cite:
|
157
|
+
|
158
|
+
```bibtex
|
159
|
+
@software{gemini_agent_framework,
|
160
|
+
author = {Mohamed Baathman},
|
161
|
+
title = {Gemini Agent Framework},
|
162
|
+
year = {2025},
|
163
|
+
url = {https://github.com/m7mdony/gemini-agent-framework}
|
164
|
+
}
|
165
|
+
```
|
@@ -0,0 +1,6 @@
|
|
1
|
+
gemini_agent/__init__.py,sha256=huzUkDtkZ8p2huUAyUUvGsVkxicgsmFaODAG8CiwMmQ,69
|
2
|
+
gemini_agent/agent.py,sha256=eY9Vjbew4N1dbY31oK37UVRb4a9w-StUUjCuAYCF8N8,26740
|
3
|
+
gemini_agent_framework-0.1.12.dist-info/METADATA,sha256=q1jN4pSaNw-JB1mlVxHZmfdrasQkG5YktxDmCuKLvBU,5044
|
4
|
+
gemini_agent_framework-0.1.12.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
5
|
+
gemini_agent_framework-0.1.12.dist-info/licenses/LICENSE,sha256=NHp9eKeWbB-Fp6Ff24BXSemJOa6UEZa9IAp9U7O9oBM,1073
|
6
|
+
gemini_agent_framework-0.1.12.dist-info/RECORD,,
|
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2024 Mohamed Baathman
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
@@ -1,76 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.4
|
2
|
-
Name: gemini-agent-framework
|
3
|
-
Version: 0.1.10
|
4
|
-
Summary: A framework for building agents that use Gemini's function calling capabilities
|
5
|
-
Project-URL: Homepage, https://github.com/m7mdony/gemini-agent-framework
|
6
|
-
Project-URL: Documentation, https://github.com/m7mdony/gemini-agent-framework#readme
|
7
|
-
Project-URL: Repository, https://github.com/m7mdony/gemini-agent-framework.git
|
8
|
-
Author-email: Mohamed Baathman <mohamed.baathman2001@gmail.com>
|
9
|
-
License-Expression: MIT
|
10
|
-
Classifier: Development Status :: 3 - Alpha
|
11
|
-
Classifier: Intended Audience :: Developers
|
12
|
-
Classifier: License :: OSI Approved :: MIT License
|
13
|
-
Classifier: Programming Language :: Python :: 3
|
14
|
-
Classifier: Programming Language :: Python :: 3.8
|
15
|
-
Classifier: Programming Language :: Python :: 3.9
|
16
|
-
Classifier: Programming Language :: Python :: 3.10
|
17
|
-
Classifier: Programming Language :: Python :: 3.11
|
18
|
-
Requires-Python: >=3.8
|
19
|
-
Requires-Dist: python-dotenv>=1.0.0
|
20
|
-
Requires-Dist: requests>=2.31.0
|
21
|
-
Description-Content-Type: text/markdown
|
22
|
-
|
23
|
-
# Gemini Agent Framework
|
24
|
-
|
25
|
-
A Python framework for building agents that use Gemini's function calling capabilities. This framework allows you to easily create agents that can break down complex tasks into sequential steps using available tools.
|
26
|
-
|
27
|
-
## Installation
|
28
|
-
|
29
|
-
```bash
|
30
|
-
pip install gemini-agent-framework
|
31
|
-
```
|
32
|
-
|
33
|
-
## Quick Start
|
34
|
-
|
35
|
-
```python
|
36
|
-
from gemini_agent import Agent
|
37
|
-
from dotenv import load_dotenv
|
38
|
-
|
39
|
-
load_dotenv()
|
40
|
-
|
41
|
-
# Define your tools
|
42
|
-
@Agent.description("Multiplies two numbers.")
|
43
|
-
@Agent.parameters({
|
44
|
-
'a': {'type': int, 'description': 'The first number'},
|
45
|
-
'b': {'type': int, 'description': 'The second number'}
|
46
|
-
})
|
47
|
-
def multiply(a: int, b: int) -> int:
|
48
|
-
return a * b
|
49
|
-
|
50
|
-
# Create an agent instance
|
51
|
-
agent = Agent(api_key="your-api-key", tools=[multiply])
|
52
|
-
|
53
|
-
# Use the agent
|
54
|
-
response = agent.prompt("Multiply 3 and 7")
|
55
|
-
print(response) # Should output 21
|
56
|
-
```
|
57
|
-
|
58
|
-
## Features
|
59
|
-
|
60
|
-
- Easy tool definition using decorators
|
61
|
-
- Automatic sequential task breakdown
|
62
|
-
- Support for structured responses
|
63
|
-
- Intermediate result handling
|
64
|
-
- Error handling and recovery
|
65
|
-
|
66
|
-
## Documentation
|
67
|
-
|
68
|
-
For more detailed documentation, please visit the [documentation page](https://github.com/yourusername/gemini-agent-framework#readme).
|
69
|
-
|
70
|
-
## Contributing
|
71
|
-
|
72
|
-
Contributions are welcome! Please feel free to submit a Pull Request.
|
73
|
-
|
74
|
-
## License
|
75
|
-
|
76
|
-
This project is licensed under the MIT License - see the LICENSE file for details.
|
@@ -1,5 +0,0 @@
|
|
1
|
-
gemini_agent/__init__.py,sha256=rNKD-jP6y-Csd5s_LT_qIzwvteYe_23cYqoKf8vmyf0,72
|
2
|
-
gemini_agent/agent.py,sha256=OINAAAw7VEUKS4NY5N-GItrt0McQVseRXyXv5Rw43AM,25883
|
3
|
-
gemini_agent_framework-0.1.10.dist-info/METADATA,sha256=4lXbmc0Zm9NDhv8xbYe3tuMqkRnReuaB3xf4E1aqgI0,2387
|
4
|
-
gemini_agent_framework-0.1.10.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
5
|
-
gemini_agent_framework-0.1.10.dist-info/RECORD,,
|
File without changes
|