zrb 1.4.2__py3-none-any.whl → 1.5.0__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.
- zrb/builtin/llm/llm_chat.py +8 -6
- zrb/builtin/llm/tool/api.py +1 -1
- zrb/builtin/llm/tool/file.py +471 -113
- zrb/builtin/llm/tool/rag.py +28 -10
- zrb/builtin/llm/tool/web.py +47 -15
- zrb/builtin/todo.py +37 -12
- zrb/config.py +4 -4
- zrb/llm_config.py +41 -14
- zrb/task/llm_task.py +29 -14
- {zrb-1.4.2.dist-info → zrb-1.5.0.dist-info}/METADATA +64 -41
- {zrb-1.4.2.dist-info → zrb-1.5.0.dist-info}/RECORD +13 -13
- {zrb-1.4.2.dist-info → zrb-1.5.0.dist-info}/WHEEL +0 -0
- {zrb-1.4.2.dist-info → zrb-1.5.0.dist-info}/entry_points.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: zrb
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.5.0
|
4
4
|
Summary: Your Automation Powerhouse
|
5
5
|
Home-page: https://github.com/state-alchemists/zrb
|
6
6
|
License: AGPL-3.0-or-later
|
@@ -13,16 +13,20 @@ Classifier: Programming Language :: Python :: 3
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.10
|
14
14
|
Classifier: Programming Language :: Python :: 3.11
|
15
15
|
Classifier: Programming Language :: Python :: 3.12
|
16
|
+
Provides-Extra: all
|
17
|
+
Provides-Extra: playwright
|
16
18
|
Provides-Extra: rag
|
17
19
|
Requires-Dist: autopep8 (>=2.0.4,<3.0.0)
|
18
20
|
Requires-Dist: beautifulsoup4 (>=4.12.3,<5.0.0)
|
19
21
|
Requires-Dist: black (>=24.10.0,<24.11.0)
|
20
|
-
Requires-Dist: chromadb (>=0.5.20,<0.6.0) ; extra == "rag"
|
22
|
+
Requires-Dist: chromadb (>=0.5.20,<0.6.0) ; extra == "rag" or extra == "all"
|
21
23
|
Requires-Dist: fastapi[standard] (>=0.115.6,<0.116.0)
|
22
24
|
Requires-Dist: fastembed (>=0.5.1,<0.6.0)
|
23
25
|
Requires-Dist: isort (>=5.13.2,<5.14.0)
|
24
26
|
Requires-Dist: libcst (>=1.5.0,<2.0.0)
|
25
|
-
Requires-Dist:
|
27
|
+
Requires-Dist: openai (>=1.10.0,<2.0.0) ; extra == "rag" or extra == "all"
|
28
|
+
Requires-Dist: pdfplumber (>=0.11.4,<0.12.0) ; extra == "rag" or extra == "all"
|
29
|
+
Requires-Dist: playwright (>=1.43.0,<2.0.0) ; extra == "playwright" or extra == "all"
|
26
30
|
Requires-Dist: psutil (>=6.1.1,<7.0.0)
|
27
31
|
Requires-Dist: pydantic-ai (>=0.0.42,<0.0.43)
|
28
32
|
Requires-Dist: python-dotenv (>=1.0.1,<2.0.0)
|
@@ -79,40 +83,47 @@ bash -c "$(curl -fsSL https://raw.githubusercontent.com/state-alchemists/zrb/mai
|
|
79
83
|
|
80
84
|
```
|
81
85
|
|
82
|
-
# 🍲 Quick Start
|
86
|
+
# 🍲 Quick Start: Build Your First Automation Workflow
|
83
87
|
|
84
|
-
|
88
|
+
Zrb empowers you to create custom automation tasks using Python. This guide shows you how to define two simple tasks: one to generate a PlantUML script from your source code and another to convert that script into a PNG image.
|
85
89
|
|
90
|
+
## 1. Create Your Task Definition File
|
91
|
+
|
92
|
+
Place a file named `zrb_init.py` in a directory that's accessible from your projects. Zrb will automatically search for this file by starting in your current directory and then moving upward (i.e., checking parent directories) until it finds one. This means if you place your `zrb_init.py` in your home directory (e.g., `/home/<your-user-name>/zrb_init.py`), the tasks defined there will be available for any project.
|
93
|
+
|
94
|
+
Add the following content to your zrb_init.py:
|
86
95
|
|
87
96
|
```python
|
88
97
|
import os
|
89
|
-
from zrb import cli,
|
90
|
-
from zrb.builtin.llm.tool.file import
|
98
|
+
from zrb import cli, LLMTask, CmdTask, StrInput, Group
|
99
|
+
from zrb.builtin.llm.tool.file import (
|
100
|
+
list_files, read_from_file, search_files, write_to_file
|
101
|
+
)
|
102
|
+
|
91
103
|
|
92
104
|
CURRENT_DIR = os.getcwd()
|
93
105
|
|
94
|
-
#
|
106
|
+
# Create a group for UML-related tasks
|
95
107
|
uml_group = cli.add_group(Group(name="uml", description="UML related tasks"))
|
96
108
|
|
97
|
-
# Generate
|
109
|
+
# Task 1: Generate a PlantUML script from your source code
|
98
110
|
make_uml_script = uml_group.add_task(
|
99
111
|
LLMTask(
|
100
112
|
name="make-script",
|
101
113
|
description="Creating plantuml diagram based on source code in current directory",
|
102
114
|
input=StrInput(name="diagram", default="state diagram"),
|
103
115
|
message=(
|
104
|
-
f"Read
|
116
|
+
f"Read all necessary files in {CURRENT_DIR}, "
|
105
117
|
"make a {ctx.input.diagram} in plantuml format. "
|
106
118
|
f"Write the script into {CURRENT_DIR}/{{ctx.input.diagram}}.uml"
|
107
119
|
),
|
108
120
|
tools=[
|
109
|
-
|
110
|
-
write_text_file,
|
121
|
+
list_files, read_from_file, search_files, write_to_file
|
111
122
|
],
|
112
123
|
)
|
113
124
|
)
|
114
125
|
|
115
|
-
#
|
126
|
+
# Task 2: Convert the PlantUML script into a PNG image
|
116
127
|
make_uml_image = uml_group.add_task(
|
117
128
|
CmdTask(
|
118
129
|
name="make-image",
|
@@ -123,63 +134,75 @@ make_uml_image = uml_group.add_task(
|
|
123
134
|
)
|
124
135
|
)
|
125
136
|
|
126
|
-
#
|
137
|
+
# Set up the dependency: the image task runs after the script is created
|
127
138
|
make_uml_script >> make_uml_image
|
128
139
|
```
|
129
140
|
|
130
|
-
|
141
|
+
**What This Does**
|
131
142
|
|
132
|
-
|
143
|
+
- **Task 1 – make-script**:
|
133
144
|
|
134
|
-
|
145
|
+
Uses an LLM to read all files in your current directory and generate a PlantUML script (e.g., `state diagram.uml`).
|
135
146
|
|
136
|
-
|
147
|
+
- **Task 2 – make-image**:
|
137
148
|
|
138
|
-
|
149
|
+
Executes a command that converts the PlantUML script into a PNG image (e.g., `state diagram.png`). This task will run only after the script has been generated.
|
139
150
|
|
140
|
-
Now, go to your project and create a state diagram:
|
141
151
|
|
142
|
-
|
143
|
-
git clone git@github.com:jjinux/gotetris.git
|
144
|
-
cd gotetris
|
145
|
-
zrb uml make-image --diagram "state diagram"
|
146
|
-
```
|
152
|
+
## 2. Run Your Tasks
|
147
153
|
|
148
|
-
|
154
|
+
After setting up your tasks, you can execute them from any project. For example:
|
149
155
|
|
150
|
-
|
151
|
-
zrb uml make-image
|
152
|
-
```
|
156
|
+
- Clone/Create a Project:
|
153
157
|
|
154
|
-
|
158
|
+
```bash
|
159
|
+
git clone git@github.com:jjinux/gotetris.git
|
160
|
+
cd gotetris
|
161
|
+
```
|
155
162
|
|
156
|
-
|
157
|
-
|
158
|
-
```
|
163
|
+
- Create a state diagram:
|
164
|
+
|
165
|
+
```bash
|
166
|
+
zrb uml make-image --diagram "state diagram"
|
167
|
+
```
|
168
|
+
|
169
|
+
- Or use the interactive mode:
|
159
170
|
|
160
|
-
|
171
|
+
```bash
|
172
|
+
zrb uml make-image
|
173
|
+
```
|
161
174
|
|
162
|
-
|
175
|
+
Zrb will prompt:
|
176
|
+
|
177
|
+
```bash
|
178
|
+
diagram [state diagram]:
|
179
|
+
```
|
180
|
+
|
181
|
+
Press **Enter** to use the default value
|
182
|
+
|
183
|
+

|
184
|
+
|
185
|
+
|
186
|
+
## 3. Try Out the Web UI
|
187
|
+
|
188
|
+
You can also serve your tasks through a user-friendly web interface:
|
163
189
|
|
164
190
|
```bash
|
165
191
|
zrb server start
|
166
192
|
```
|
167
193
|
|
168
|
-
|
194
|
+
Then open your browser and visit `http://localhost:21213`
|
169
195
|
|
170
196
|

|
171
197
|
|
172
|
-
Now, let's see how things work in detail. First, Zrb generates a `state diagram.uml` in your current directory, it then transform the UML script into a PNG image `state diagram.png`.
|
173
|
-
|
174
|
-

|
175
|
-
|
176
198
|
|
177
199
|
# 🎥 Demo & Documentation
|
178
200
|
|
179
201
|
- **Step by step guide:** [Getting started with Zrb](https://github.com/state-alchemists/zrb/blob/main/docs/recipes/getting-started/README.md).
|
180
202
|
- **Full documentation:** [Zrb Documentation](https://github.com/state-alchemists/zrb/blob/main/docs/README.md)
|
181
203
|
- **Video demo:**
|
182
|
-
|
204
|
+
|
205
|
+
[](https://www.youtube.com/watch?v=W7dgk96l__o)
|
183
206
|
|
184
207
|
|
185
208
|
# 🤝 Join the Community
|
@@ -7,13 +7,13 @@ zrb/builtin/base64.py,sha256=1YnSwASp7OEAvQcsnHZGpJEvYoI1Z2zTIJ1bCDHfcPQ,921
|
|
7
7
|
zrb/builtin/git.py,sha256=8_qVE_2lVQEVXQ9vhiw8Tn4Prj1VZB78ZjEJJS5Ab3M,5461
|
8
8
|
zrb/builtin/git_subtree.py,sha256=7BKwOkVTWDrR0DXXQ4iJyHqeR6sV5VYRt8y_rEB0EHg,3505
|
9
9
|
zrb/builtin/group.py,sha256=-phJfVpTX3_gUwS1u8-RbZUHe-X41kxDBSmrVh4rq8E,1682
|
10
|
-
zrb/builtin/llm/llm_chat.py,sha256=
|
10
|
+
zrb/builtin/llm/llm_chat.py,sha256=QFuuZJm4tonykbY1P5Vdnn2acVqwM8GcsJ0gnaNB2uo,6182
|
11
11
|
zrb/builtin/llm/previous-session.js,sha256=xMKZvJoAbrwiyHS0OoPrWuaKxWYLoyR5sguePIoCjTY,816
|
12
|
-
zrb/builtin/llm/tool/api.py,sha256=
|
12
|
+
zrb/builtin/llm/tool/api.py,sha256=U0_PhVuoDLpq4Jak5S45IHhCF1jKmfS0JC8XAnfnOhA,858
|
13
13
|
zrb/builtin/llm/tool/cli.py,sha256=to_IjkfrMGs6eLfG0cpVN9oyADWYsJQCtyluUhUdBww,253
|
14
|
-
zrb/builtin/llm/tool/file.py,sha256=
|
15
|
-
zrb/builtin/llm/tool/rag.py,sha256=
|
16
|
-
zrb/builtin/llm/tool/web.py,sha256=
|
14
|
+
zrb/builtin/llm/tool/file.py,sha256=A6x0f93oBU4JvrujVF3NQAUY6Hkrf_Iv9cfAMNsaDi4,17469
|
15
|
+
zrb/builtin/llm/tool/rag.py,sha256=pX8N_bYv4axsjhULLvvZtQYW2klZOkeQZ2Tn16083vM,6860
|
16
|
+
zrb/builtin/llm/tool/web.py,sha256=ZvIgOIMPIEfdih5I3TgVTsqTrwiKmDy60zeKHVWrVeo,4922
|
17
17
|
zrb/builtin/md5.py,sha256=0pNlrfZA0wlZlHvFHLgyqN0JZJWGKQIF5oXxO44_OJk,949
|
18
18
|
zrb/builtin/project/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
19
19
|
zrb/builtin/project/add/fastapp/fastapp_input.py,sha256=MKlWR_LxWhM_DcULCtLfL_IjTxpDnDBkn9KIqNmajFs,310
|
@@ -201,14 +201,14 @@ zrb/builtin/shell/autocomplete/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5
|
|
201
201
|
zrb/builtin/shell/autocomplete/bash.py,sha256=-7YDVV7txgJH9mAYSYN0jmvUEeDIzWFvVNY-cY0myF8,1181
|
202
202
|
zrb/builtin/shell/autocomplete/subcmd.py,sha256=WZI6cGWJcn80zSyxOHG7sCMO3Ucix3mZf4xm_xyB_Y0,606
|
203
203
|
zrb/builtin/shell/autocomplete/zsh.py,sha256=9hlq0Wt3fhRz326mAQTypEd4_4lZdrbBx_3A-Ti3mvw,1022
|
204
|
-
zrb/builtin/todo.py,sha256=
|
204
|
+
zrb/builtin/todo.py,sha256=qxQb0EjWk5Eg4lZIOIGDQVw3wz_Bb9wzG2J38b9iCig,11463
|
205
205
|
zrb/callback/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
206
206
|
zrb/callback/any_callback.py,sha256=Yhdv5UWHAZSVzj5K2JdxcVQx8x8VX8aZJEivj3NTfZc,247
|
207
207
|
zrb/callback/callback.py,sha256=hKefB_Jd1XGjPSLQdMKDsGLHPzEGO2dqrIArLl_EmD0,848
|
208
208
|
zrb/cmd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
209
209
|
zrb/cmd/cmd_result.py,sha256=L8bQJzWCpcYexIxHBNsXj2pT3BtLmWex0iJSMkvimOA,597
|
210
210
|
zrb/cmd/cmd_val.py,sha256=7Doowyg6BK3ISSGBLt-PmlhzaEkBjWWm51cED6fAUOQ,1014
|
211
|
-
zrb/config.py,sha256=
|
211
|
+
zrb/config.py,sha256=bYLagRHcReZBrfaQM3y5FaNCflDC9l8Kb6Sw49eD3-o,4023
|
212
212
|
zrb/content_transformer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
213
213
|
zrb/content_transformer/any_content_transformer.py,sha256=v8ZUbcix1GGeDQwB6OKX_1TjpY__ksxWVeqibwa_iZA,850
|
214
214
|
zrb/content_transformer/content_transformer.py,sha256=STl77wW-I69QaGzCXjvkppngYFLufow8ybPLSyAvlHs,2404
|
@@ -237,7 +237,7 @@ zrb/input/option_input.py,sha256=TQB82ko5odgzkULEizBZi0e9TIHEbIgvdP0AR3RhA74,213
|
|
237
237
|
zrb/input/password_input.py,sha256=szBojWxSP9QJecgsgA87OIYwQrY2AQ3USIKdDZY6snU,1465
|
238
238
|
zrb/input/str_input.py,sha256=NevZHX9rf1g8eMatPyy-kUX3DglrVAQpzvVpKAzf7bA,81
|
239
239
|
zrb/input/text_input.py,sha256=shvVbc2U8Is36h23M5lcW8IEwKc9FR-4uEPZZroj3rU,3377
|
240
|
-
zrb/llm_config.py,sha256=
|
240
|
+
zrb/llm_config.py,sha256=wmb0XNeaAjb5JlWRU3G-1D1Q0XCQmjjY7SEPcN3cHeA,4512
|
241
241
|
zrb/runner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
242
242
|
zrb/runner/cli.py,sha256=0mT0oO_yEhc8N4nYCJNujhgLjVykZ0B-kAOFXyAvAqM,6672
|
243
243
|
zrb/runner/common_util.py,sha256=0zhZn1Jdmr194_nsL5_L-Kn9-_NDpMTI2z6_LXUQJ-U,1369
|
@@ -300,7 +300,7 @@ zrb/task/base_task.py,sha256=SQRf37bylS586KwyW0eYDe9JZ5Hl18FP8kScHae6y3A,21251
|
|
300
300
|
zrb/task/base_trigger.py,sha256=jC722rDvodaBLeNaFghkTyv1u0QXrK6BLZUUqcmBJ7Q,4581
|
301
301
|
zrb/task/cmd_task.py,sha256=pUKRSR4DZKjbmluB6vi7cxqyhxOLfJ2czSpYeQbiDvo,10705
|
302
302
|
zrb/task/http_check.py,sha256=Gf5rOB2Se2EdizuN9rp65HpGmfZkGc-clIAlHmPVehs,2565
|
303
|
-
zrb/task/llm_task.py,sha256=
|
303
|
+
zrb/task/llm_task.py,sha256=oPLruaSCqEF2fX5xtXfXflVYMknT2U5nBqC0CObT-ug,14282
|
304
304
|
zrb/task/make_task.py,sha256=PD3b_aYazthS8LHeJsLAhwKDEgdurQZpymJDKeN60u0,2265
|
305
305
|
zrb/task/rsync_task.py,sha256=GSL9144bmp6F0EckT6m-2a1xG25AzrrWYzH4k3SVUKM,6370
|
306
306
|
zrb/task/scaffolder.py,sha256=rME18w1HJUHXgi9eTYXx_T2G4JdqDYzBoNOkdOOo5-o,6806
|
@@ -341,7 +341,7 @@ zrb/util/string/name.py,sha256=8picJfUBXNpdh64GNaHv3om23QHhUZux7DguFLrXHp8,1163
|
|
341
341
|
zrb/util/todo.py,sha256=1nDdwPc22oFoK_1ZTXyf3638Bg6sqE2yp_U4_-frHoc,16015
|
342
342
|
zrb/xcom/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
343
343
|
zrb/xcom/xcom.py,sha256=o79rxR9wphnShrcIushA0Qt71d_p3ZTxjNf7x9hJB78,1571
|
344
|
-
zrb-1.
|
345
|
-
zrb-1.
|
346
|
-
zrb-1.
|
347
|
-
zrb-1.
|
344
|
+
zrb-1.5.0.dist-info/METADATA,sha256=165bE0daRzv-SVfO2Oc04XO0fu6D1JP5uh1pdQWouwY,8557
|
345
|
+
zrb-1.5.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
346
|
+
zrb-1.5.0.dist-info/entry_points.txt,sha256=-Pg3ElWPfnaSM-XvXqCxEAa-wfVI6BEgcs386s8C8v8,46
|
347
|
+
zrb-1.5.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|