zrb 1.9.4__py3-none-any.whl → 1.9.6__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.
Files changed (54) hide show
  1. zrb/__init__.py +8 -8
  2. zrb/__main__.py +1 -1
  3. zrb/builtin/__init__.py +0 -50
  4. zrb/builtin/llm/chat_session.py +1 -1
  5. zrb/builtin/llm/history.py +1 -1
  6. zrb/builtin/llm/llm_ask.py +3 -3
  7. zrb/builtin/llm/tool/api.py +19 -9
  8. zrb/builtin/llm/tool/cli.py +11 -5
  9. zrb/builtin/llm/tool/code.py +20 -20
  10. zrb/builtin/llm/tool/file.py +107 -155
  11. zrb/builtin/llm/tool/rag.py +28 -5
  12. zrb/builtin/llm/tool/sub_agent.py +12 -14
  13. zrb/builtin/llm/tool/web.py +46 -14
  14. zrb/builtin/todo.py +1 -1
  15. zrb/{llm_config.py → config/llm_config.py} +143 -158
  16. zrb/{llm_rate_limitter.py → config/llm_rate_limitter.py} +1 -1
  17. zrb/{runner → config}/web_auth_config.py +1 -1
  18. zrb/context/shared_context.py +1 -1
  19. zrb/input/text_input.py +1 -1
  20. zrb/runner/cli.py +2 -2
  21. zrb/runner/web_app.py +2 -2
  22. zrb/runner/web_route/docs_route.py +1 -1
  23. zrb/runner/web_route/error_page/serve_default_404.py +1 -1
  24. zrb/runner/web_route/error_page/show_error_page.py +1 -1
  25. zrb/runner/web_route/home_page/home_page_route.py +2 -2
  26. zrb/runner/web_route/login_api_route.py +1 -1
  27. zrb/runner/web_route/login_page/login_page_route.py +2 -2
  28. zrb/runner/web_route/logout_api_route.py +1 -1
  29. zrb/runner/web_route/logout_page/logout_page_route.py +2 -2
  30. zrb/runner/web_route/node_page/group/show_group_page.py +1 -1
  31. zrb/runner/web_route/node_page/node_page_route.py +1 -1
  32. zrb/runner/web_route/node_page/task/show_task_page.py +1 -1
  33. zrb/runner/web_route/refresh_token_api_route.py +1 -1
  34. zrb/runner/web_route/static/static_route.py +1 -1
  35. zrb/runner/web_route/task_input_api_route.py +1 -1
  36. zrb/runner/web_route/task_session_api_route.py +1 -1
  37. zrb/runner/web_util/cookie.py +1 -1
  38. zrb/runner/web_util/token.py +1 -1
  39. zrb/runner/web_util/user.py +1 -1
  40. zrb/session_state_logger/session_state_logger_factory.py +1 -1
  41. zrb/task/cmd_task.py +1 -1
  42. zrb/task/llm/agent.py +1 -1
  43. zrb/task/llm/config.py +1 -1
  44. zrb/task/llm/context_enrichment.py +2 -2
  45. zrb/task/llm/history_summarization.py +2 -2
  46. zrb/task/llm/prompt.py +1 -1
  47. zrb/task/llm_task.py +1 -1
  48. zrb/util/init_path.py +1 -1
  49. zrb-1.9.6.dist-info/METADATA +250 -0
  50. {zrb-1.9.4.dist-info → zrb-1.9.6.dist-info}/RECORD +53 -53
  51. zrb-1.9.4.dist-info/METADATA +0 -245
  52. /zrb/{config.py → config/config.py} +0 -0
  53. {zrb-1.9.4.dist-info → zrb-1.9.6.dist-info}/WHEEL +0 -0
  54. {zrb-1.9.4.dist-info → zrb-1.9.6.dist-info}/entry_points.txt +0 -0
@@ -1,245 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: zrb
3
- Version: 1.9.4
4
- Summary: Your Automation Powerhouse
5
- Home-page: https://github.com/state-alchemists/zrb
6
- License: AGPL-3.0-or-later
7
- Keywords: Automation,Task Runner,Code Generator,Monorepo,Low Code
8
- Author: Go Frendi Gunawan
9
- Author-email: gofrendiasgard@gmail.com
10
- Requires-Python: >=3.10.0,<4.0.0
11
- Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
12
- Classifier: Programming Language :: Python :: 3
13
- Classifier: Programming Language :: Python :: 3.10
14
- Classifier: Programming Language :: Python :: 3.11
15
- Classifier: Programming Language :: Python :: 3.12
16
- Provides-Extra: all
17
- Provides-Extra: playwright
18
- Provides-Extra: rag
19
- Requires-Dist: beautifulsoup4 (>=4.13.3,<5.0.0)
20
- Requires-Dist: black (>=25.1.0,<25.2.0)
21
- Requires-Dist: chromadb (>=0.6.3,<0.7.0) ; extra == "rag" or extra == "all"
22
- Requires-Dist: fastapi[standard] (>=0.115.14,<0.116.0)
23
- Requires-Dist: isort (>=6.0.1,<6.1.0)
24
- Requires-Dist: libcst (>=1.7.0,<2.0.0)
25
- Requires-Dist: openai (>=1.86.0,<2.0.0) ; extra == "rag" or extra == "all"
26
- Requires-Dist: pdfplumber (>=0.11.6,<0.12.0) ; extra == "rag" or extra == "all"
27
- Requires-Dist: playwright (>=1.53.0,<2.0.0) ; extra == "playwright" or extra == "all"
28
- Requires-Dist: prompt-toolkit (>=3.0.51,<4.0.0)
29
- Requires-Dist: psutil (>=7.0.0,<8.0.0)
30
- Requires-Dist: pydantic-ai (>=0.3.4,<0.4.0)
31
- Requires-Dist: pyjwt (>=2.10.1,<3.0.0)
32
- Requires-Dist: python-dotenv (>=1.1.1,<2.0.0)
33
- Requires-Dist: python-jose[cryptography] (>=3.4.0,<4.0.0)
34
- Requires-Dist: requests (>=2.32.4,<3.0.0)
35
- Requires-Dist: rich (>=14.0.0,<15.0.0)
36
- Requires-Dist: tiktoken (>=0.8.0,<0.9.0)
37
- Requires-Dist: ulid-py (>=1.1.0,<2.0.0)
38
- Project-URL: Documentation, https://github.com/state-alchemists/zrb
39
- Project-URL: Repository, https://github.com/state-alchemists/zrb
40
- Description-Content-Type: text/markdown
41
-
42
- ![](https://raw.githubusercontent.com/state-alchemists/zrb/main/_images/zrb/android-chrome-192x192.png)
43
-
44
- [Documentation](https://github.com/state-alchemists/zrb/blob/main/docs/README.md)
45
-
46
- # 🤖 Zrb: Your Automation Powerhouse
47
-
48
- Zrb simplifies the creation and execution of automation tasks. It allows you to define tasks using Python classes or functions, organize them into groups, and run them via a command-line interface or a web UI. Zrb handles task dependencies, inputs, environment variables, and inter-task communication, allowing you to focus on the logic of your automation.
49
-
50
- ## 🚀 Why Zrb?
51
-
52
- Zrb stands out by offering:
53
- * **Python-Native Automation:** Write tasks in a familiar and powerful language.
54
- * **LLM Integration:** Easily incorporate AI capabilities into your workflows.
55
- * **Structured Workflows:** Define dependencies and organize tasks logically.
56
- * **Flexible Execution:** Run tasks from the CLI or a web browser.
57
- * **Extensibility:** Customize and build upon the Zrb framework.
58
-
59
- ## 🔥 Key Features
60
-
61
- - **LLM Integration:** Leverage state-of-the-art language models to generate code, diagrams, and documentation.
62
- - **Task Chaining:** Easily define dependencies between tasks to create complex workflows.
63
- - **CLI & Server Mode:** Run tasks directly from the command line or through a user-friendly web UI.
64
- - **Flexible Input Handling:** Defaults, prompts, and command-line parameters to suit any workflow.
65
- * **Environment Variables:** Manage configuration using environment variables, loaded from the system, `.env` files, or task definitions.
66
- * **Cross-Communication (XCom):** Safely exchange small amounts of data between tasks.
67
- - **Extensible & Open Source:** Contribute, customize, or extend Zrb to fit your unique needs.
68
-
69
-
70
- # 🛠️ Installation
71
-
72
- The easiest way to install Zrb is using pip:
73
-
74
- ```bash
75
- pip install zrb
76
- # pip install --pre zrb
77
- ```
78
-
79
- Alternatively, you can use Zrb installation script which handles prerequisites:
80
-
81
- ```bash
82
- bash -c "$(curl -fsSL https://raw.githubusercontent.com/state-alchemists/zrb/main/install.sh)"
83
- ```
84
-
85
- For more installation option like running Zrb on your **Android Device 📱** or **as a Container 🐋**, you can check the [installation and configuration guide](https://github.com/state-alchemists/zrb/blob/main/docs/installation-and-configuration/README.md).
86
-
87
- # 🍲 Quick Start: Build Your First Automation Workflow
88
-
89
- This guide shows you how to define two simple tasks:
90
-
91
- - One to generate a Mermaid Diagram Script from your source code.
92
- - And another one to convert that script into a PNG image.
93
-
94
- > **Note:** This assume you have an `OPENAI_API_KEY` and a Mermaid CLI installed (i.e., `npm install -g @mermaid-js/mermaid-cli`)
95
- > If you want to use other LLM Provider (e.g., Deepseek, Ollama, etc.), you can refer to [Zrb LLM Integration guide](https://github.com/state-alchemists/zrb/blob/main/docs/installation-and-configuration/configuration/llm-integration.md)
96
-
97
- ## 1. Create Your Task Definition File
98
-
99
- Place a file named `zrb_init.py` in a directory that's accessible from your projects.
100
-
101
- 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.
102
-
103
- 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 inside your home directory.
104
-
105
- Add the following content to your zrb_init.py:
106
-
107
- ```python
108
- from zrb import cli, LLMTask, CmdTask, StrInput, Group
109
- from zrb.builtin.llm.tool.code import analyze_repo
110
- from zrb.builtin.llm.tool.file import write_to_file
111
-
112
-
113
- # Create a group for Mermaid-related tasks
114
- mermaid_group = cli.add_group(Group(name="mermaid", description="🧜 Mermaid diagram related tasks"))
115
-
116
- # Task 1: Generate a Mermaid script from your source code
117
- make_mermaid_script = mermaid_group.add_task(
118
- LLMTask(
119
- name="make-script",
120
- description="Creating mermaid diagram based on source code in current directory",
121
- input=[
122
- StrInput(name="dir", default="./"),
123
- StrInput(name="diagram", default="state-diagram"),
124
- ],
125
- message=(
126
- "Read all necessary files in {ctx.input.dir}, "
127
- "make a {ctx.input.diagram} in mermaid format. "
128
- "Write the script into `{ctx.input.dir}/{ctx.input.diagram}.mmd`"
129
- ),
130
- tools=[
131
- analyze_repo, write_to_file
132
- ],
133
- )
134
- )
135
-
136
- # Task 2: Convert the Mermaid script into a PNG image
137
- make_mermaid_image = mermaid_group.add_task(
138
- CmdTask(
139
- name="make-image",
140
- description="Creating png based on source code in current directory",
141
- input=[
142
- StrInput(name="dir", default="./"),
143
- StrInput(name="diagram", default="state-diagram"),
144
- ],
145
- cmd="mmdc -i '{ctx.input.diagram}.mmd' -o '{ctx.input.diagram}.png'",
146
- cwd="{ctx.input.dir}",
147
- )
148
- )
149
-
150
- # Set up the dependency: the image task runs after the script is created
151
- make_mermaid_script >> make_mermaid_image
152
- ```
153
-
154
- **What This Does**
155
-
156
- - **Task 1 – make-script**:
157
-
158
- Uses an LLM to read all files in your current directory and generate a [Mermaid Diagram Script](https://mermaid.js.org/) (e.g., `state diagram.mmd`).
159
-
160
- - **Task 2 – make-image**:
161
-
162
- Executes a command that converts the Mermaid Diagram Script into a PNG image (e.g., `state diagram.png`). This task will run only after the script has been generated.
163
-
164
-
165
- ## 2. Run Your Tasks
166
-
167
- After setting up your tasks, you can execute them from any project. For example:
168
-
169
- - Clone/Create a Project:
170
-
171
- ```bash
172
- git clone git@github.com:jjinux/gotetris.git
173
- cd gotetris
174
- ```
175
-
176
- - Create a state diagram:
177
-
178
- ```bash
179
- zrb mermaid make-image --diagram "state diagram" --dir ./
180
- ```
181
-
182
- - Or use the interactive mode:
183
-
184
- ```bash
185
- zrb mermaid make-image
186
- ```
187
-
188
- Zrb will prompt:
189
-
190
- ```
191
- dir [./]:
192
- diagram [state diagram]:
193
- ```
194
-
195
- Press **Enter** to use the default value
196
-
197
- - And you have your State Diagram ready :)
198
-
199
- ![State Diagram](https://raw.githubusercontent.com/state-alchemists/zrb/main/_images/state-diagram.png)
200
-
201
-
202
- ## 3. Try Out the Web UI
203
-
204
- You can also serve your tasks through a user-friendly web interface:
205
-
206
- ```bash
207
- zrb server start
208
- ```
209
-
210
- Then open your browser and visit `http://localhost:21213`
211
-
212
- ![Zrb Web UI](https://raw.githubusercontent.com/state-alchemists/zrb/main/_images/zrb-web-ui.png)
213
-
214
- # 🎥 Demo & Documentation
215
-
216
- - **Go Further By Visiting Our Documentation:** [Zrb Documentation](https://github.com/state-alchemists/zrb/blob/main/docs/README.md)
217
- - **Video Demo:**
218
-
219
- [![Video Title](https://img.youtube.com/vi/W7dgk96l__o/0.jpg)](https://www.youtube.com/watch?v=W7dgk96l__o)
220
-
221
-
222
- # 🤝 Join the Community
223
-
224
- - **Bug Reports & Feature Requests:** Create an [issue](https://github.com/state-alchemists/zrb/issues) on Zrb's GitHub Repositories and include:
225
- - Your Zrb version (i.e., `zrb version`).
226
- - Steps you’ve taken and what you expected versus what happened
227
- - **Contributions:** We welcome pull requests! Check out our [contribution guidelines](https://github.com/state-alchemists/zrb/pulls).
228
-
229
-
230
- # ☕ Support The Project
231
-
232
- If you find Zrb valuable, please consider donating:
233
-
234
- [![](https://raw.githubusercontent.com/state-alchemists/zrb/main/_images/donator.png)](https://stalchmst.com)
235
-
236
- # 🎉 Fun Fact
237
-
238
- Did you know?
239
-
240
- Zrb is named after `Zaruba`, a powerful support tool from the Garo universe!
241
-
242
- > Madou Ring Zaruba (魔導輪ザルバ, Madōrin Zaruba) is a Madougu which supports bearers of the Garo Armor. [(Garo Wiki | Fandom)](https://garo.fandom.com/wiki/Zaruba)
243
-
244
- ![Madou Ring Zaruba on Kouga's Hand](https://raw.githubusercontent.com/state-alchemists/zrb/main/_images/madou-ring-zaruba.jpg)
245
-
File without changes
File without changes