grasp_agents 0.1.10__py3-none-any.whl → 0.1.13__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,152 @@
1
+ Metadata-Version: 2.4
2
+ Name: grasp_agents
3
+ Version: 0.1.13
4
+ Summary: Grasp Agents Library
5
+ License-File: LICENSE.md
6
+ Requires-Python: <3.12,>=3.11.4
7
+ Requires-Dist: dotenv>=0.9.9
8
+ Requires-Dist: httpx<1,>=0.27.0
9
+ Requires-Dist: openai<2,>=1.68.2
10
+ Requires-Dist: pyyaml>=6.0.2
11
+ Requires-Dist: tenacity>=9.1.2
12
+ Requires-Dist: termcolor<3,>=2.4.0
13
+ Requires-Dist: tqdm<5,>=4.66.2
14
+ Description-Content-Type: text/markdown
15
+
16
+ # Grasp Agents
17
+
18
+ <br/>
19
+ <img src="./.assets/grasp.svg" alt="Grasp Agents" width="320" />
20
+ <br/>
21
+ <br/>
22
+
23
+ [![PyPI version](https://badge.fury.io/py/grasp_agents.svg)](https://badge.fury.io/py/grasp-agents)
24
+ [![License: MIT](https://img.shields.io/badge/license-MIT-yellow?style=flat-square)](https://mit-license.org/)
25
+ [![PyPI downloads](https://img.shields.io/pypi/dm/grasp-agents?style=flat-square)](https://pypi.org/project/grasp-agents/)
26
+ [![GitHub Stars](https://img.shields.io/github/stars/grasp-technologies/grasp-agents?style=social)](https://github.com/grasp-technologies/grasp-agents/stargazers)
27
+ [![GitHub Forks](https://img.shields.io/github/forks/grasp-technologies/grasp-agents?style=social)](https://github.com/grasp-technologies/grasp-agents/network/members)
28
+
29
+ ## Overview
30
+
31
+ **Grasp Agents** is a modular Python framework for building agentic AI pipelines and applications. It provides reusable agent classes, message handling, LLM integration, memory, and orchestration utilities. The framework is designed for flexibility, composability, and clarity, enabling rapid prototyping and robust development of multi-agent systems.
32
+
33
+ ## Features
34
+
35
+ - Modular agent base classes
36
+ - Message and memory management
37
+ - LLM and tool orchestration
38
+ - Logging and usage tracking
39
+ - Extensible architecture
40
+
41
+ ## Project Structure
42
+
43
+ - `src/grasp_agents/` — Core framework modules
44
+ - `base_agent.py`, `llm_agent.py`, `comm_agent.py`: Agent classes
45
+ - `agent_message.py`, `agent_message_pool.py`: Messaging
46
+ - `memory.py`: Memory management
47
+ - `cloud_llm.py`, `llm.py`: LLM integration
48
+ - `tool_orchestrator.py`: Tool orchestration
49
+ - `usage_tracker.py`, `grasp_logging.py`: Usage and logging
50
+ - `data_retrieval/`, `openai/`, `typing/`, `workflow/`: Extensions and utilities
51
+ - `configs/` — Configuration files
52
+ - `data/` — Logs and datasets
53
+
54
+ ## Quickstart & Installation Variants (UV Package manager)
55
+
56
+ ### Option 1: UV Package Manager Project
57
+
58
+ > **Note:** You can check this sample project code in the [src/grasp_agents/examples/demo/uv](src/grasp_agents/examples/demo/uv) folder. Feel free to copy and paste the code from there to a separate project. There are also [examples](src/grasp_agents/examples/demo/) for other package managers.
59
+
60
+ #### 1. Prerequisites
61
+
62
+ Install the [UV Package Manager](https://github.com/astral-sh/uv):
63
+
64
+ ```bash
65
+ curl -LsSf https://astral.sh/uv/install.sh | sh
66
+ ```
67
+
68
+ #### 2. Create Project & Install Dependencies
69
+
70
+ ```bash
71
+ mkdir my-test-uv-app
72
+ cd my-test-uv-app
73
+ uv init .
74
+ ```
75
+
76
+ Create and activate a virtual environment:
77
+
78
+ ```bash
79
+ uv venv
80
+ source .venv/bin/activate
81
+ ```
82
+
83
+ Add and sync dependencies:
84
+
85
+ ```bash
86
+ uv add grasp_agents
87
+ uv sync
88
+ ```
89
+
90
+ #### 3. Example Usage
91
+
92
+ Create a file, e.g., `hello.py`:
93
+
94
+ Ensure you have a `.env` file with your OpenAI and Google AI Studio API keys set
95
+
96
+ ```
97
+ OPENAI_API_KEY=your_openai_api_key
98
+ GOOGLE_AI_STUDIO_API_KEY=your_google_ai_studio_api_key
99
+ ```
100
+
101
+ ```python
102
+ import asyncio
103
+ from typing import Any
104
+
105
+ from grasp_agents.llm_agent import LLMAgent
106
+ from grasp_agents.openai.openai_llm import (
107
+ OpenAILLM,
108
+ OpenAILLMSettings,
109
+ )
110
+ from grasp_agents.typing.io import (
111
+ AgentPayload,
112
+ )
113
+ from grasp_agents.run_context import RunContextWrapper
114
+
115
+ from dotenv import load_dotenv
116
+
117
+ load_dotenv()
118
+
119
+ class Response(AgentPayload):
120
+ response: str
121
+
122
+
123
+ chatbot = LLMAgent[Any, Response, None](
124
+ agent_id="chatbot",
125
+ llm=OpenAILLM(
126
+ model_name="gpt-4o",
127
+ llm_settings=OpenAILLMSettings(),
128
+ ),
129
+ sys_prompt=None,
130
+ out_schema=Response,
131
+ )
132
+
133
+
134
+ @chatbot.parse_output_handler
135
+ def output_handler(conversation, ctx, **kwargs) -> Response:
136
+ return Response(response=conversation[-1].content)
137
+
138
+
139
+ async def main():
140
+ ctx = RunContextWrapper(print_messages=True)
141
+ out = await chatbot.run("Hello, agent!", ctx=ctx)
142
+ print(out.payloads[0].response)
143
+
144
+
145
+ asyncio.run(main())
146
+ ```
147
+
148
+ Run your script:
149
+
150
+ ```bash
151
+ uv run hello.py
152
+ ```
@@ -38,8 +38,7 @@ grasp_agents/workflow/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
38
38
  grasp_agents/workflow/looped_agent.py,sha256=YBOgOIvy3_NwKvEoGgzQJ2fY9SNG66MQk6obSBGWvCc,3896
39
39
  grasp_agents/workflow/sequential_agent.py,sha256=yDt2nA-b1leVByD8jsKrWD6bHe0o9z33jrOJGOLwbyk,2004
40
40
  grasp_agents/workflow/workflow_agent.py,sha256=9U94IQ39Vb1W_5u8aoqHb65ikdarEhEJkexDz8xwHD4,2294
41
- grasp_agents-0.1.10.dist-info/METADATA,sha256=XOMAmMxZc3EP2fKPSME19AAufaakNKdh0NGmVC8Q-cY,7411
42
- grasp_agents-0.1.10.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
43
- grasp_agents-0.1.10.dist-info/licenses/LICENSE,sha256=GRDob7--af0SOT8BRgu7Ds1NqhunPyxGjyETcCk-o7s,1062
44
- grasp_agents-0.1.10.dist-info/licenses/LICENSE.md,sha256=Kfeo0gdlLS6tLQiWwO9UWhjp9-f93a5kShSiBp2FG-c,1201
45
- grasp_agents-0.1.10.dist-info/RECORD,,
41
+ grasp_agents-0.1.13.dist-info/METADATA,sha256=oIAw7WeZopDvWOFIQLo-PmSsnlDtHYVtSceKI0J5GEU,4272
42
+ grasp_agents-0.1.13.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
43
+ grasp_agents-0.1.13.dist-info/licenses/LICENSE.md,sha256=Kfeo0gdlLS6tLQiWwO9UWhjp9-f93a5kShSiBp2FG-c,1201
44
+ grasp_agents-0.1.13.dist-info/RECORD,,
@@ -1,318 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: grasp_agents
3
- Version: 0.1.10
4
- Summary: Grasp Agents Library
5
- License-File: LICENSE
6
- License-File: LICENSE.md
7
- Requires-Python: <3.12,>=3.11.4
8
- Requires-Dist: dotenv>=0.9.9
9
- Requires-Dist: httpx<1,>=0.27.0
10
- Requires-Dist: openai<2,>=1.68.2
11
- Requires-Dist: pyyaml>=6.0.2
12
- Requires-Dist: tenacity>=9.1.2
13
- Requires-Dist: termcolor<3,>=2.4.0
14
- Requires-Dist: tqdm<5,>=4.66.2
15
- Description-Content-Type: text/markdown
16
-
17
- # Grasp Agents
18
-
19
- <br/>
20
- <img src="./.assets/grasp.png" alt="Grasp Agents" width="320" />
21
- <br/>
22
- <br/>
23
-
24
- [![PyPI version](https://badge.fury.io/py/grasp_agents.svg)](https://badge.fury.io/py/grasp_agents)
25
- [![Python Versions](https://img.shields.io/pypi/pyversions/grasp_agents?style=flat-square)](https://pypi.org/project/grasp_agents/)
26
- [![License: MIT](https://img.shields.io/badge/license-MIT-yellow?style=flat-square)](https://mit-license.org/)
27
-
28
- ## Overview
29
-
30
- **Grasp Agents** is a modular Python framework for building agentic AI pipelines and applications. It provides reusable agent classes, message handling, LLM integration, memory, and orchestration utilities. The framework is designed for flexibility, composability, and clarity, enabling rapid prototyping and robust development of multi-agent systems.
31
-
32
- ## Features
33
-
34
- - Modular agent base classes
35
- - Message and memory management
36
- - LLM and tool orchestration
37
- - Logging and usage tracking
38
- - Extensible architecture
39
-
40
- ## Project Structure
41
-
42
- - `src/grasp_agents/` — Core framework modules
43
- - `base_agent.py`, `llm_agent.py`, `comm_agent.py`: Agent classes
44
- - `agent_message.py`, `agent_message_pool.py`: Messaging
45
- - `memory.py`: Memory management
46
- - `cloud_llm.py`, `llm.py`: LLM integration
47
- - `tool_orchestrator.py`: Tool orchestration
48
- - `usage_tracker.py`, `grasp_logging.py`: Usage and logging
49
- - `data_retrieval/`, `openai/`, `typing/`, `workflow/`: Extensions and utilities
50
- - `configs/` — Configuration files
51
- - `data/` — Logs and datasets
52
-
53
- ## Quickstart & Installation Variants
54
-
55
- ### Option 1: UV Package Manager Project
56
-
57
- > **Note:** You can check this sample project code in the [src/grasp_agents/examples/demo/uv](src/grasp_agents/examples/demo/uv) folder. Feel free to copy and paste the code from there to a separate project.
58
-
59
- #### 1. Prerequisites
60
-
61
- Install the [UV Package Manager](https://github.com/astral-sh/uv):
62
-
63
- ```bash
64
- curl -LsSf https://astral.sh/uv/install.sh | sh
65
- ```
66
-
67
- #### 2. Create Project & Install Dependencies
68
-
69
- ```bash
70
- mkdir my-test-uv-app
71
- cd my-test-uv-app
72
- uv init .
73
- ```
74
-
75
- Create and activate a virtual environment:
76
-
77
- ```bash
78
- uv venv
79
- source .venv/bin/activate
80
- ```
81
-
82
- Add and sync dependencies:
83
-
84
- ```bash
85
- uv add grasp_agents
86
- uv sync
87
- ```
88
-
89
- #### 3. Example Usage
90
-
91
- Create a file, e.g., `hello.py`:
92
-
93
- Ensure you have a `.env` file with your OpenAI and Google AI Studio API keys set
94
-
95
- ```
96
- OPENAI_API_KEY=your_openai_api_key
97
- GOOGLE_AI_STUDIO_API_KEY=your_google_ai_studio_api_key
98
- ```
99
-
100
- ```python
101
- import asyncio
102
- from typing import Any
103
-
104
- from grasp_agents.llm_agent import LLMAgent
105
- from grasp_agents.openai.openai_llm import (
106
- OpenAILLM,
107
- OpenAILLMSettings,
108
- )
109
- from grasp_agents.typing.io import (
110
- AgentPayload,
111
- )
112
- from grasp_agents.run_context import RunContextWrapper
113
-
114
- from dotenv import load_dotenv
115
-
116
- load_dotenv()
117
-
118
- class Response(AgentPayload):
119
- response: str
120
-
121
-
122
- chatbot = LLMAgent[Any, Response, None](
123
- agent_id="chatbot",
124
- llm=OpenAILLM(
125
- model_name="gpt-4o",
126
- llm_settings=OpenAILLMSettings(),
127
- ),
128
- sys_prompt=None,
129
- out_schema=Response,
130
- )
131
-
132
-
133
- @chatbot.parse_output_handler
134
- def output_handler(conversation, ctx, **kwargs) -> Response:
135
- return Response(response=conversation[-1].content)
136
-
137
-
138
- async def main():
139
- ctx = RunContextWrapper(print_messages=True)
140
- out = await chatbot.run("Hello, agent!", ctx=ctx)
141
- print(out.payloads[0].response)
142
-
143
-
144
- asyncio.run(main())
145
- ```
146
-
147
- Run your script:
148
-
149
- ```bash
150
- uv run hello.py
151
- ```
152
-
153
- ---
154
-
155
- ### Option 2: PIP-only (requirements.txt-based) Project
156
-
157
- > **Note:** You can check this sample project code in the [src/grasp_agents/examples/demo/pip](src/grasp_agents/examples/demo/pip) folder. Feel free to copy and paste the code from there to a separate project.
158
-
159
- #### 1. Create Project Folder
160
-
161
- ```bash
162
- mkdir my-test-pip-app
163
- cd my-test-pip-app
164
- ```
165
-
166
- #### 2. Install Python 3.11.9 (Recommended)
167
-
168
- If using [pyenv](https://github.com/pyenv/pyenv):
169
-
170
- ```bash
171
- brew install pyenv
172
- pyenv install 3.11.9
173
- pyenv local 3.11.9
174
- ```
175
-
176
- Open a new terminal after setting the Python version.
177
-
178
- #### 3. Create & Activate Virtual Environment
179
-
180
- ```bash
181
- python -m venv .venv
182
- source .venv/bin/activate
183
- ```
184
-
185
- #### 4. Install Grasp Agents SDK
186
-
187
- If you have a `requirements.txt` file:
188
-
189
- ```bash
190
- pip install -r requirements.txt
191
- ```
192
-
193
- Or install directly:
194
-
195
- ```bash
196
- pip install grasp-agents
197
- ```
198
-
199
- #### 5. Example Usage
200
-
201
- Create a file, e.g., `hello.py`, and use the same code as above.
202
-
203
- #### 6. Run the App
204
-
205
- ```bash
206
- python hello.py
207
- ```
208
-
209
- ---
210
-
211
- ### Option 3: Poetry-based Project
212
-
213
- > **Note:** You can check this sample project code in the [src/grasp_agents/examples/demo/poetry](src/grasp_agents/examples/demo/poetry) folder. Feel free to copy and paste the code from there to a separate project.
214
-
215
- #### 1. Create Project Folder
216
-
217
- ```bash
218
- mkdir my-test-poetry-app
219
- cd my-test-poetry-app
220
- ```
221
-
222
- #### 2. Install Python 3.11.9 via pyenv
223
-
224
- ```bash
225
- brew install pyenv
226
- pyenv install 3.11.9
227
- pyenv local 3.11.9
228
- ```
229
-
230
- #### 3. Install Poetry Package Manager
231
-
232
- If you don't have Poetry, install it:
233
-
234
- ```bash
235
- curl -sSL https://install.python-poetry.org | python3 -
236
- ```
237
-
238
- Open a new terminal after installing Poetry.
239
-
240
- #### 4. Create and Activate a Virtual Environment
241
-
242
- ```bash
243
- python -m venv .venv
244
- source .venv/bin/activate
245
- ```
246
-
247
- #### 5. Make Poetry Use the Virtual Environment's Python
248
-
249
- ```bash
250
- poetry env use $(which python)
251
- ```
252
-
253
- #### 6. Install the Grasp Agents SDK
254
-
255
- ```bash
256
- poetry install
257
- ```
258
-
259
- #### 7. Example Usage
260
-
261
- Create a file, e.g., `hello.py`, and use the same code as above.
262
-
263
- #### 8. Environment Variables
264
-
265
- Ensure you have a `.env` file with your OpenAI API key set:
266
-
267
- ```
268
- OPENAI_API_KEY=your_openai_api_key
269
- ```
270
-
271
- #### 9. Run the App
272
-
273
- ```bash
274
- poetry run python hello.py
275
- ```
276
-
277
- ## Development
278
-
279
- To develop and test the library locally, follow these steps:
280
-
281
- ### 1. Install UV Package Manager
282
-
283
- Make sure [UV](https://github.com/astral-sh/uv) is installed on your system:
284
-
285
- ```bash
286
- curl -LsSf https://astral.sh/uv/install.sh | sh
287
- ```
288
-
289
- ### 2. Install Dependencies
290
-
291
- Create a new virtual environment and install dependencies:
292
-
293
- ```bash
294
- uv venv
295
- source .venv/bin/activate
296
- uv sync
297
- ```
298
-
299
- ### 3. Test Example for VS Code
300
-
301
- - Install the [Jupyter Notebook extension](https://marketplace.visualstudio.com/items/?itemName=ms-toolsai.jupyter).
302
-
303
- - Ensure you have a `.env` file with your OpenAI and Google AI Studio API keys set (see [.env.example](.env.example)).
304
-
305
- ```
306
- OPENAI_API_KEY=your_openai_api_key
307
- GOOGLE_AI_STUDIO_API_KEY=your_google_ai_studio_api_key
308
- ```
309
-
310
- - Open [src/grasp_agents/examples/notebooks/agents_demo.ipynb](src/grasp_agents/examples/notebooks/agents_demo.ipynb).
311
-
312
- You're now ready to run and experiment with the example notebook.
313
-
314
- ### 4. Recommended VS Code Extensions
315
-
316
- - [Ruff](https://marketplace.visualstudio.com/items/?itemName=charliermarsh.ruff) -- for formatting and code analysis
317
- - [Pylint](https://marketplace.visualstudio.com/items/?itemName=ms-python.pylint) -- for linting
318
- - [Pylance](https://marketplace.visualstudio.com/items/?itemName=ms-python.vscode-pylance) -- for type checking
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Grasp
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.