grasp_agents 0.1.7__tar.gz → 0.1.10__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 (48) hide show
  1. grasp_agents-0.1.10/LICENSE.md +13 -0
  2. grasp_agents-0.1.10/PKG-INFO +318 -0
  3. grasp_agents-0.1.10/README.md +302 -0
  4. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/pyproject.toml +4 -1
  5. grasp_agents-0.1.7/PKG-INFO +0 -203
  6. grasp_agents-0.1.7/README.md +0 -190
  7. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/.gitignore +0 -0
  8. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/LICENSE +0 -0
  9. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/agent_message.py +0 -0
  10. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/agent_message_pool.py +0 -0
  11. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/base_agent.py +0 -0
  12. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/cloud_llm.py +0 -0
  13. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/comm_agent.py +0 -0
  14. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/costs_dict.yaml +0 -0
  15. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/data_retrieval/__init__.py +0 -0
  16. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/data_retrieval/rate_limiter_chunked.py +0 -0
  17. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/data_retrieval/types.py +0 -0
  18. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/data_retrieval/utils.py +0 -0
  19. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/grasp_logging.py +0 -0
  20. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/http_client.py +0 -0
  21. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/llm.py +0 -0
  22. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/llm_agent.py +0 -0
  23. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/llm_agent_state.py +0 -0
  24. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/memory.py +0 -0
  25. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/openai/__init__.py +0 -0
  26. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/openai/completion_converters.py +0 -0
  27. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/openai/content_converters.py +0 -0
  28. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/openai/converters.py +0 -0
  29. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/openai/message_converters.py +0 -0
  30. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/openai/openai_llm.py +0 -0
  31. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/openai/tool_converters.py +0 -0
  32. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/printer.py +0 -0
  33. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/prompt_builder.py +0 -0
  34. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/run_context.py +0 -0
  35. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/tool_orchestrator.py +0 -0
  36. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/typing/__init__.py +0 -0
  37. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/typing/completion.py +0 -0
  38. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/typing/content.py +0 -0
  39. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/typing/converters.py +0 -0
  40. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/typing/io.py +0 -0
  41. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/typing/message.py +0 -0
  42. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/typing/tool.py +0 -0
  43. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/usage_tracker.py +0 -0
  44. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/utils.py +0 -0
  45. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/workflow/__init__.py +0 -0
  46. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/workflow/looped_agent.py +0 -0
  47. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/workflow/sequential_agent.py +0 -0
  48. {grasp_agents-0.1.7 → grasp_agents-0.1.10}/src/grasp_agents/workflow/workflow_agent.py +0 -0
@@ -0,0 +1,13 @@
1
+ Grasp Agents itself is [MIT](https://mit-license.org/)-licensed.
2
+
3
+ Package production dependencies are licensed under the following terms:
4
+
5
+ | Name | Version | License | URL |
6
+ | --------- | ------- | ------------------------------------------------- | --------------------------------------- |
7
+ | PyYAML | 6.0.2 | MIT License | https://pyyaml.org/ |
8
+ | dotenv | 0.9.9 | BSD-3-Clause license | https://github.com/pedroburon/dotenv |
9
+ | httpx | 0.28.1 | BSD License | https://github.com/encode/httpx |
10
+ | openai | 1.77.0 | Apache Software License | https://github.com/openai/openai-python |
11
+ | tenacity | 9.1.2 | Apache Software License | https://github.com/jd/tenacity |
12
+ | termcolor | 2.5.0 | MIT License | https://github.com/termcolor/termcolor |
13
+ | tqdm | 4.67.1 | MIT License; Mozilla Public License 2.0 (MPL 2.0) | https://tqdm.github.io |
@@ -0,0 +1,318 @@
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
@@ -0,0 +1,302 @@
1
+ # Grasp Agents
2
+
3
+ <br/>
4
+ <img src="./.assets/grasp.png" alt="Grasp Agents" width="320" />
5
+ <br/>
6
+ <br/>
7
+
8
+ [![PyPI version](https://badge.fury.io/py/grasp_agents.svg)](https://badge.fury.io/py/grasp_agents)
9
+ [![Python Versions](https://img.shields.io/pypi/pyversions/grasp_agents?style=flat-square)](https://pypi.org/project/grasp_agents/)
10
+ [![License: MIT](https://img.shields.io/badge/license-MIT-yellow?style=flat-square)](https://mit-license.org/)
11
+
12
+ ## Overview
13
+
14
+ **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.
15
+
16
+ ## Features
17
+
18
+ - Modular agent base classes
19
+ - Message and memory management
20
+ - LLM and tool orchestration
21
+ - Logging and usage tracking
22
+ - Extensible architecture
23
+
24
+ ## Project Structure
25
+
26
+ - `src/grasp_agents/` — Core framework modules
27
+ - `base_agent.py`, `llm_agent.py`, `comm_agent.py`: Agent classes
28
+ - `agent_message.py`, `agent_message_pool.py`: Messaging
29
+ - `memory.py`: Memory management
30
+ - `cloud_llm.py`, `llm.py`: LLM integration
31
+ - `tool_orchestrator.py`: Tool orchestration
32
+ - `usage_tracker.py`, `grasp_logging.py`: Usage and logging
33
+ - `data_retrieval/`, `openai/`, `typing/`, `workflow/`: Extensions and utilities
34
+ - `configs/` — Configuration files
35
+ - `data/` — Logs and datasets
36
+
37
+ ## Quickstart & Installation Variants
38
+
39
+ ### Option 1: UV Package Manager Project
40
+
41
+ > **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.
42
+
43
+ #### 1. Prerequisites
44
+
45
+ Install the [UV Package Manager](https://github.com/astral-sh/uv):
46
+
47
+ ```bash
48
+ curl -LsSf https://astral.sh/uv/install.sh | sh
49
+ ```
50
+
51
+ #### 2. Create Project & Install Dependencies
52
+
53
+ ```bash
54
+ mkdir my-test-uv-app
55
+ cd my-test-uv-app
56
+ uv init .
57
+ ```
58
+
59
+ Create and activate a virtual environment:
60
+
61
+ ```bash
62
+ uv venv
63
+ source .venv/bin/activate
64
+ ```
65
+
66
+ Add and sync dependencies:
67
+
68
+ ```bash
69
+ uv add grasp_agents
70
+ uv sync
71
+ ```
72
+
73
+ #### 3. Example Usage
74
+
75
+ Create a file, e.g., `hello.py`:
76
+
77
+ Ensure you have a `.env` file with your OpenAI and Google AI Studio API keys set
78
+
79
+ ```
80
+ OPENAI_API_KEY=your_openai_api_key
81
+ GOOGLE_AI_STUDIO_API_KEY=your_google_ai_studio_api_key
82
+ ```
83
+
84
+ ```python
85
+ import asyncio
86
+ from typing import Any
87
+
88
+ from grasp_agents.llm_agent import LLMAgent
89
+ from grasp_agents.openai.openai_llm import (
90
+ OpenAILLM,
91
+ OpenAILLMSettings,
92
+ )
93
+ from grasp_agents.typing.io import (
94
+ AgentPayload,
95
+ )
96
+ from grasp_agents.run_context import RunContextWrapper
97
+
98
+ from dotenv import load_dotenv
99
+
100
+ load_dotenv()
101
+
102
+ class Response(AgentPayload):
103
+ response: str
104
+
105
+
106
+ chatbot = LLMAgent[Any, Response, None](
107
+ agent_id="chatbot",
108
+ llm=OpenAILLM(
109
+ model_name="gpt-4o",
110
+ llm_settings=OpenAILLMSettings(),
111
+ ),
112
+ sys_prompt=None,
113
+ out_schema=Response,
114
+ )
115
+
116
+
117
+ @chatbot.parse_output_handler
118
+ def output_handler(conversation, ctx, **kwargs) -> Response:
119
+ return Response(response=conversation[-1].content)
120
+
121
+
122
+ async def main():
123
+ ctx = RunContextWrapper(print_messages=True)
124
+ out = await chatbot.run("Hello, agent!", ctx=ctx)
125
+ print(out.payloads[0].response)
126
+
127
+
128
+ asyncio.run(main())
129
+ ```
130
+
131
+ Run your script:
132
+
133
+ ```bash
134
+ uv run hello.py
135
+ ```
136
+
137
+ ---
138
+
139
+ ### Option 2: PIP-only (requirements.txt-based) Project
140
+
141
+ > **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.
142
+
143
+ #### 1. Create Project Folder
144
+
145
+ ```bash
146
+ mkdir my-test-pip-app
147
+ cd my-test-pip-app
148
+ ```
149
+
150
+ #### 2. Install Python 3.11.9 (Recommended)
151
+
152
+ If using [pyenv](https://github.com/pyenv/pyenv):
153
+
154
+ ```bash
155
+ brew install pyenv
156
+ pyenv install 3.11.9
157
+ pyenv local 3.11.9
158
+ ```
159
+
160
+ Open a new terminal after setting the Python version.
161
+
162
+ #### 3. Create & Activate Virtual Environment
163
+
164
+ ```bash
165
+ python -m venv .venv
166
+ source .venv/bin/activate
167
+ ```
168
+
169
+ #### 4. Install Grasp Agents SDK
170
+
171
+ If you have a `requirements.txt` file:
172
+
173
+ ```bash
174
+ pip install -r requirements.txt
175
+ ```
176
+
177
+ Or install directly:
178
+
179
+ ```bash
180
+ pip install grasp-agents
181
+ ```
182
+
183
+ #### 5. Example Usage
184
+
185
+ Create a file, e.g., `hello.py`, and use the same code as above.
186
+
187
+ #### 6. Run the App
188
+
189
+ ```bash
190
+ python hello.py
191
+ ```
192
+
193
+ ---
194
+
195
+ ### Option 3: Poetry-based Project
196
+
197
+ > **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.
198
+
199
+ #### 1. Create Project Folder
200
+
201
+ ```bash
202
+ mkdir my-test-poetry-app
203
+ cd my-test-poetry-app
204
+ ```
205
+
206
+ #### 2. Install Python 3.11.9 via pyenv
207
+
208
+ ```bash
209
+ brew install pyenv
210
+ pyenv install 3.11.9
211
+ pyenv local 3.11.9
212
+ ```
213
+
214
+ #### 3. Install Poetry Package Manager
215
+
216
+ If you don't have Poetry, install it:
217
+
218
+ ```bash
219
+ curl -sSL https://install.python-poetry.org | python3 -
220
+ ```
221
+
222
+ Open a new terminal after installing Poetry.
223
+
224
+ #### 4. Create and Activate a Virtual Environment
225
+
226
+ ```bash
227
+ python -m venv .venv
228
+ source .venv/bin/activate
229
+ ```
230
+
231
+ #### 5. Make Poetry Use the Virtual Environment's Python
232
+
233
+ ```bash
234
+ poetry env use $(which python)
235
+ ```
236
+
237
+ #### 6. Install the Grasp Agents SDK
238
+
239
+ ```bash
240
+ poetry install
241
+ ```
242
+
243
+ #### 7. Example Usage
244
+
245
+ Create a file, e.g., `hello.py`, and use the same code as above.
246
+
247
+ #### 8. Environment Variables
248
+
249
+ Ensure you have a `.env` file with your OpenAI API key set:
250
+
251
+ ```
252
+ OPENAI_API_KEY=your_openai_api_key
253
+ ```
254
+
255
+ #### 9. Run the App
256
+
257
+ ```bash
258
+ poetry run python hello.py
259
+ ```
260
+
261
+ ## Development
262
+
263
+ To develop and test the library locally, follow these steps:
264
+
265
+ ### 1. Install UV Package Manager
266
+
267
+ Make sure [UV](https://github.com/astral-sh/uv) is installed on your system:
268
+
269
+ ```bash
270
+ curl -LsSf https://astral.sh/uv/install.sh | sh
271
+ ```
272
+
273
+ ### 2. Install Dependencies
274
+
275
+ Create a new virtual environment and install dependencies:
276
+
277
+ ```bash
278
+ uv venv
279
+ source .venv/bin/activate
280
+ uv sync
281
+ ```
282
+
283
+ ### 3. Test Example for VS Code
284
+
285
+ - Install the [Jupyter Notebook extension](https://marketplace.visualstudio.com/items/?itemName=ms-toolsai.jupyter).
286
+
287
+ - Ensure you have a `.env` file with your OpenAI and Google AI Studio API keys set (see [.env.example](.env.example)).
288
+
289
+ ```
290
+ OPENAI_API_KEY=your_openai_api_key
291
+ GOOGLE_AI_STUDIO_API_KEY=your_google_ai_studio_api_key
292
+ ```
293
+
294
+ - Open [src/grasp_agents/examples/notebooks/agents_demo.ipynb](src/grasp_agents/examples/notebooks/agents_demo.ipynb).
295
+
296
+ You're now ready to run and experiment with the example notebook.
297
+
298
+ ### 4. Recommended VS Code Extensions
299
+
300
+ - [Ruff](https://marketplace.visualstudio.com/items/?itemName=charliermarsh.ruff) -- for formatting and code analysis
301
+ - [Pylint](https://marketplace.visualstudio.com/items/?itemName=ms-python.pylint) -- for linting
302
+ - [Pylance](https://marketplace.visualstudio.com/items/?itemName=ms-python.vscode-pylance) -- for type checking
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "grasp_agents"
3
- version = "0.1.7"
3
+ version = "0.1.10"
4
4
  description = "Grasp Agents Library"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11.4,<3.12"
@@ -10,6 +10,8 @@ dependencies = [
10
10
  "tenacity>=9.1.2",
11
11
  "termcolor>=2.4.0,<3",
12
12
  "tqdm>=4.66.2,<5",
13
+ "dotenv>=0.9.9",
14
+ "pyyaml>=6.0.2",
13
15
  ]
14
16
 
15
17
  [dependency-groups]
@@ -25,6 +27,7 @@ dev = [
25
27
  "twine>=5.1.1,<6",
26
28
  "ruff>=0.11.8",
27
29
  "pyright>=1.1.400",
30
+ "pip-licenses>=5.0.0",
28
31
  ]
29
32
 
30
33
  [build-system]
@@ -1,203 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: grasp_agents
3
- Version: 0.1.7
4
- Summary: Grasp Agents Library
5
- License-File: LICENSE
6
- Requires-Python: <3.12,>=3.11.4
7
- Requires-Dist: httpx<1,>=0.27.0
8
- Requires-Dist: openai<2,>=1.68.2
9
- Requires-Dist: tenacity>=9.1.2
10
- Requires-Dist: termcolor<3,>=2.4.0
11
- Requires-Dist: tqdm<5,>=4.66.2
12
- Description-Content-Type: text/markdown
13
-
14
- # grasp_agents
15
-
16
- <br/>
17
- <img src="./.assets/grasp.svg" alt="Grasp Agents" width="320" />
18
- <br/>
19
- <br/>
20
-
21
- [![PyPI version](https://badge.fury.io/py/grasp_agents.svg)](https://badge.fury.io/py/grasp_agents)
22
- [![Python Versions](https://img.shields.io/pypi/pyversions/grasp_agents?style=flat-square)](https://pypi.org/project/grasp_agents/)
23
- [![License: MIT](https://img.shields.io/badge/license-MIT-yellow?style=flat-square)](LICENSE)
24
-
25
- ## Overview
26
-
27
- 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.
28
-
29
- ## Features
30
-
31
- - Modular agent base classes
32
- - Message and memory management
33
- - LLM and tool orchestration
34
- - Logging and usage tracking
35
- - Extensible architecture
36
-
37
- ## Project Structure
38
-
39
- - `src/grasp_agents/` — Core framework modules
40
- - `base_agent.py`, `llm_agent.py`, `comm_agent.py`: Agent classes
41
- - `agent_message.py`, `agent_message_pool.py`: Messaging
42
- - `memory.py`: Memory management
43
- - `cloud_llm.py`, `llm.py`: LLM integration
44
- - `tool_orchestrator.py`: Tool orchestration
45
- - `usage_tracker.py`, `grasp_logging.py`: Usage and logging
46
- - `data_retrieval/`, `openai/`, `typing/`, `workflow/`: Extensions and utilities
47
- - `configs/` — Configuration files
48
- - `data/` — Logs and datasets
49
-
50
- ## Quickstart & Installation Variants
51
-
52
- ### Option 1: UV Package Manager Project
53
-
54
- #### 1. Prerequisites
55
-
56
- Install the [UV Package Manager](https://github.com/astral-sh/uv):
57
-
58
- ```bash
59
- curl -LsSf https://astral.sh/uv/install.sh | sh
60
- ```
61
-
62
- #### 2. Create Project & Install Dependencies
63
-
64
- ```bash
65
- mkdir my-test-uv-app
66
- cd my-test-uv-app
67
- uv init .
68
- ```
69
-
70
- Create and activate a virtual environment:
71
-
72
- ```bash
73
- uv venv
74
- source .venv/bin/activate
75
- ```
76
-
77
- Add and sync dependencies:
78
-
79
- ```bash
80
- uv add grasp_agents
81
- uv sync
82
- ```
83
-
84
- #### 3. Example Usage
85
-
86
- Create a file, e.g., `hello.py`:
87
-
88
- ```python
89
- from grasp_agents.llm_agent import LLMAgent
90
- from grasp_agents.base_agent import BaseAgentConfig
91
-
92
- agent = LLMAgent(
93
- config=BaseAgentConfig(
94
- model="gpt-4o-mini",
95
- memory=None, # or your memory implementation
96
- )
97
- )
98
-
99
- response = agent.run("Hello, agent!")
100
- print(response)
101
- ```
102
-
103
- Run your script:
104
-
105
- ```bash
106
- python hello.py
107
- ```
108
-
109
- ---
110
-
111
- ### Option 2: PIP-only (requirements.txt-based) Project
112
-
113
- #### 1. Create Project Folder
114
-
115
- ```bash
116
- mkdir my-test-pip-app
117
- cd my-test-pip-app
118
- ```
119
-
120
- #### 2. Install Python 3.11.9 (Recommended)
121
-
122
- If using [pyenv](https://github.com/pyenv/pyenv):
123
-
124
- ```bash
125
- brew install pyenv
126
- pyenv install 3.11.9
127
- pyenv local 3.11.9
128
- ```
129
-
130
- Open a new terminal after setting the Python version.
131
-
132
- #### 3. Create & Activate Virtual Environment
133
-
134
- ```bash
135
- python -m venv .venv
136
- source .venv/bin/activate
137
- ```
138
-
139
- If you see `ModuleNotFoundError: No module named 'yaml'`, run:
140
-
141
- ```bash
142
- pip install pyyaml
143
- ```
144
-
145
- #### 4. Install Grasp Agents SDK
146
-
147
- If you have a `requirements.txt`:
148
-
149
- ```bash
150
- pip install -r requirements.txt
151
- ```
152
-
153
- Or install directly:
154
-
155
- ```bash
156
- pip install grasp-agents
157
- ```
158
-
159
- #### 5. Example Usage
160
-
161
- Create a file, e.g., `hello.py`, and use the same code as above.
162
-
163
- #### 6. Run the App
164
-
165
- ```bash
166
- python hello.py
167
- ```
168
-
169
- ---
170
-
171
- ## License
172
-
173
- MIT License. See [LICENSE](LICENSE) for details.
174
-
175
- ## Development
176
-
177
- To develop and test the library locally, follow these steps:
178
-
179
- ### 1. Install UV Package Manager
180
-
181
- Make sure [UV](https://github.com/astral-sh/uv) is installed on your system:
182
-
183
- ```bash
184
- curl -LsSf https://astral.sh/uv/install.sh | sh
185
- ```
186
-
187
- ### 2. Install Dependencies
188
-
189
- Create a new virtual environment and install dependencies:
190
-
191
- ```bash
192
- uv venv
193
- source .venv/bin/activate
194
- uv sync
195
- ```
196
-
197
- ### 3. Test Example
198
-
199
- - Install the Jupyter Notebook extension for VS Code.
200
- - Open `src/grasp_agents/examples/notebooks/agents_demo.ipynb` in VS Code.
201
- - Ensure you have a `.env` file with your OpenAI and Google AI Studio API keys set (see `.env.example`).
202
-
203
- You're now ready to run and experiment with the example notebook.
@@ -1,190 +0,0 @@
1
- # grasp_agents
2
-
3
- <br/>
4
- <img src="./.assets/grasp.svg" alt="Grasp Agents" width="320" />
5
- <br/>
6
- <br/>
7
-
8
- [![PyPI version](https://badge.fury.io/py/grasp_agents.svg)](https://badge.fury.io/py/grasp_agents)
9
- [![Python Versions](https://img.shields.io/pypi/pyversions/grasp_agents?style=flat-square)](https://pypi.org/project/grasp_agents/)
10
- [![License: MIT](https://img.shields.io/badge/license-MIT-yellow?style=flat-square)](LICENSE)
11
-
12
- ## Overview
13
-
14
- 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.
15
-
16
- ## Features
17
-
18
- - Modular agent base classes
19
- - Message and memory management
20
- - LLM and tool orchestration
21
- - Logging and usage tracking
22
- - Extensible architecture
23
-
24
- ## Project Structure
25
-
26
- - `src/grasp_agents/` — Core framework modules
27
- - `base_agent.py`, `llm_agent.py`, `comm_agent.py`: Agent classes
28
- - `agent_message.py`, `agent_message_pool.py`: Messaging
29
- - `memory.py`: Memory management
30
- - `cloud_llm.py`, `llm.py`: LLM integration
31
- - `tool_orchestrator.py`: Tool orchestration
32
- - `usage_tracker.py`, `grasp_logging.py`: Usage and logging
33
- - `data_retrieval/`, `openai/`, `typing/`, `workflow/`: Extensions and utilities
34
- - `configs/` — Configuration files
35
- - `data/` — Logs and datasets
36
-
37
- ## Quickstart & Installation Variants
38
-
39
- ### Option 1: UV Package Manager Project
40
-
41
- #### 1. Prerequisites
42
-
43
- Install the [UV Package Manager](https://github.com/astral-sh/uv):
44
-
45
- ```bash
46
- curl -LsSf https://astral.sh/uv/install.sh | sh
47
- ```
48
-
49
- #### 2. Create Project & Install Dependencies
50
-
51
- ```bash
52
- mkdir my-test-uv-app
53
- cd my-test-uv-app
54
- uv init .
55
- ```
56
-
57
- Create and activate a virtual environment:
58
-
59
- ```bash
60
- uv venv
61
- source .venv/bin/activate
62
- ```
63
-
64
- Add and sync dependencies:
65
-
66
- ```bash
67
- uv add grasp_agents
68
- uv sync
69
- ```
70
-
71
- #### 3. Example Usage
72
-
73
- Create a file, e.g., `hello.py`:
74
-
75
- ```python
76
- from grasp_agents.llm_agent import LLMAgent
77
- from grasp_agents.base_agent import BaseAgentConfig
78
-
79
- agent = LLMAgent(
80
- config=BaseAgentConfig(
81
- model="gpt-4o-mini",
82
- memory=None, # or your memory implementation
83
- )
84
- )
85
-
86
- response = agent.run("Hello, agent!")
87
- print(response)
88
- ```
89
-
90
- Run your script:
91
-
92
- ```bash
93
- python hello.py
94
- ```
95
-
96
- ---
97
-
98
- ### Option 2: PIP-only (requirements.txt-based) Project
99
-
100
- #### 1. Create Project Folder
101
-
102
- ```bash
103
- mkdir my-test-pip-app
104
- cd my-test-pip-app
105
- ```
106
-
107
- #### 2. Install Python 3.11.9 (Recommended)
108
-
109
- If using [pyenv](https://github.com/pyenv/pyenv):
110
-
111
- ```bash
112
- brew install pyenv
113
- pyenv install 3.11.9
114
- pyenv local 3.11.9
115
- ```
116
-
117
- Open a new terminal after setting the Python version.
118
-
119
- #### 3. Create & Activate Virtual Environment
120
-
121
- ```bash
122
- python -m venv .venv
123
- source .venv/bin/activate
124
- ```
125
-
126
- If you see `ModuleNotFoundError: No module named 'yaml'`, run:
127
-
128
- ```bash
129
- pip install pyyaml
130
- ```
131
-
132
- #### 4. Install Grasp Agents SDK
133
-
134
- If you have a `requirements.txt`:
135
-
136
- ```bash
137
- pip install -r requirements.txt
138
- ```
139
-
140
- Or install directly:
141
-
142
- ```bash
143
- pip install grasp-agents
144
- ```
145
-
146
- #### 5. Example Usage
147
-
148
- Create a file, e.g., `hello.py`, and use the same code as above.
149
-
150
- #### 6. Run the App
151
-
152
- ```bash
153
- python hello.py
154
- ```
155
-
156
- ---
157
-
158
- ## License
159
-
160
- MIT License. See [LICENSE](LICENSE) for details.
161
-
162
- ## Development
163
-
164
- To develop and test the library locally, follow these steps:
165
-
166
- ### 1. Install UV Package Manager
167
-
168
- Make sure [UV](https://github.com/astral-sh/uv) is installed on your system:
169
-
170
- ```bash
171
- curl -LsSf https://astral.sh/uv/install.sh | sh
172
- ```
173
-
174
- ### 2. Install Dependencies
175
-
176
- Create a new virtual environment and install dependencies:
177
-
178
- ```bash
179
- uv venv
180
- source .venv/bin/activate
181
- uv sync
182
- ```
183
-
184
- ### 3. Test Example
185
-
186
- - Install the Jupyter Notebook extension for VS Code.
187
- - Open `src/grasp_agents/examples/notebooks/agents_demo.ipynb` in VS Code.
188
- - Ensure you have a `.env` file with your OpenAI and Google AI Studio API keys set (see `.env.example`).
189
-
190
- You're now ready to run and experiment with the example notebook.
File without changes
File without changes