zrb 1.8.0__py3-none-any.whl → 1.8.2__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/tool/rag.py +0 -11
- zrb/config.py +1 -5
- zrb/llm_config.py +7 -18
- zrb/task/llm/prompt.py +1 -13
- zrb/util/file.py +22 -4
- {zrb-1.8.0.dist-info → zrb-1.8.2.dist-info}/METADATA +28 -2
- {zrb-1.8.0.dist-info → zrb-1.8.2.dist-info}/RECORD +9 -9
- {zrb-1.8.0.dist-info → zrb-1.8.2.dist-info}/WHEEL +0 -0
- {zrb-1.8.0.dist-info → zrb-1.8.2.dist-info}/entry_points.txt +0 -0
zrb/builtin/llm/tool/rag.py
CHANGED
@@ -203,15 +203,4 @@ def _read_txt_content(file_path: str, file_reader: list[RAGFileReader]):
|
|
203
203
|
for reader in file_reader:
|
204
204
|
if reader.is_match(file_path):
|
205
205
|
return reader.read(file_path)
|
206
|
-
if file_path.lower().endswith(".pdf"):
|
207
|
-
return _read_pdf(file_path)
|
208
206
|
return read_file(file_path)
|
209
|
-
|
210
|
-
|
211
|
-
def _read_pdf(file_path: str) -> str:
|
212
|
-
import pdfplumber
|
213
|
-
|
214
|
-
with pdfplumber.open(file_path) as pdf:
|
215
|
-
return "\n".join(
|
216
|
-
page.extract_text() for page in pdf.pages if page.extract_text()
|
217
|
-
)
|
zrb/config.py
CHANGED
@@ -14,7 +14,7 @@ _DEFAULT_BANNER = """
|
|
14
14
|
zzzzz rr bbbbbb {VERSION} Janggala
|
15
15
|
_ _ . . . _ . _ . . .
|
16
16
|
Your Automation Powerhouse
|
17
|
-
☕ Donate at: https://stalchmst.com
|
17
|
+
☕ Donate at: https://stalchmst.com
|
18
18
|
🐙 Submit issues/PR at: https://github.com/state-alchemists/zrb
|
19
19
|
🐤 Follow us at: https://twitter.com/zarubastalchmst
|
20
20
|
"""
|
@@ -229,10 +229,6 @@ class Config:
|
|
229
229
|
def LLM_PERSONA(self) -> str | None:
|
230
230
|
return os.getenv("ZRB_LLM_PERSONA", None)
|
231
231
|
|
232
|
-
@property
|
233
|
-
def LLM_CODE_REVIEW_INSTRUCTION_PROMPT(self) -> str | None:
|
234
|
-
return os.getenv("ZRB_LLM_CODE_REVIEW_INSTRUCTION_PROMPT", None)
|
235
|
-
|
236
232
|
@property
|
237
233
|
def LLM_SPECIAL_INSTRUCTION_PROMPT(self) -> str | None:
|
238
234
|
return os.getenv("ZRB_LLM_SPECIAL_INSTRUCTION_PROMPT", None)
|
zrb/llm_config.py
CHANGED
@@ -51,9 +51,9 @@ another JSON object with these details (i.e., {"response": {"context_name": "val
|
|
51
51
|
If no context can be extracted, return {"response": {}}.
|
52
52
|
""".strip()
|
53
53
|
|
54
|
-
DEFAULT_SPECIAL_INSTRUCTION_PROMPT = ""
|
55
|
-
|
56
|
-
|
54
|
+
DEFAULT_SPECIAL_INSTRUCTION_PROMPT = """
|
55
|
+
# Coding and Code Review
|
56
|
+
When asked to do coding/code review related task, you prioritize correctness, readability,
|
57
57
|
performance, security, and maintainability.
|
58
58
|
Follow these principles:
|
59
59
|
1. **Correctness** Check whether the code performs the intended logic,
|
@@ -66,9 +66,10 @@ Follow these principles:
|
|
66
66
|
that could lead to security issues.
|
67
67
|
5. **Consistency** Ensure the code adheres to common language idioms,
|
68
68
|
style guides, and project conventions.
|
69
|
-
|
70
|
-
|
71
|
-
|
69
|
+
|
70
|
+
## Code Review
|
71
|
+
When asked to do code review, you provide clear, concise, and actionable feedback.
|
72
|
+
Use inline code examples when helpful. Do not restate the code unnecessarily.
|
72
73
|
Focus on meaningful insights that help the user improve the code quality.
|
73
74
|
Avoid excessive nitpicking unless requested.
|
74
75
|
""".strip()
|
@@ -84,7 +85,6 @@ class LLMConfig:
|
|
84
85
|
default_persona: str | None = None,
|
85
86
|
default_system_prompt: str | None = None,
|
86
87
|
default_special_instruction_prompt: str | None = None,
|
87
|
-
default_code_review_instruction_prompt: str | None = None,
|
88
88
|
default_summarization_prompt: str | None = None,
|
89
89
|
default_context_enrichment_prompt: str | None = None,
|
90
90
|
default_summarize_history: bool | None = None,
|
@@ -101,9 +101,6 @@ class LLMConfig:
|
|
101
101
|
self._default_persona = default_persona
|
102
102
|
self._default_system_prompt = default_system_prompt
|
103
103
|
self._default_special_instruction_prompt = default_special_instruction_prompt
|
104
|
-
self._default_code_review_instruction_prompt = (
|
105
|
-
default_code_review_instruction_prompt
|
106
|
-
)
|
107
104
|
self._default_summarization_prompt = default_summarization_prompt
|
108
105
|
self._default_context_enrichment_prompt = default_context_enrichment_prompt
|
109
106
|
self._default_summarize_history = default_summarize_history
|
@@ -175,14 +172,6 @@ class LLMConfig:
|
|
175
172
|
return CFG.LLM_PERSONA
|
176
173
|
return DEFAULT_PERSONA
|
177
174
|
|
178
|
-
@property
|
179
|
-
def default_code_review_instruction_prompt(self) -> str:
|
180
|
-
if self._default_code_review_instruction_prompt is not None:
|
181
|
-
return self._default_code_review_instruction_prompt
|
182
|
-
if CFG.LLM_CODE_REVIEW_INSTRUCTION_PROMPT is not None:
|
183
|
-
return CFG.LLM_CODE_REVIEW_INSTRUCTION_PROMPT
|
184
|
-
return DEFAULT_CODE_REVIEW_INSTRUCTION_PROMPT
|
185
|
-
|
186
175
|
@property
|
187
176
|
def default_special_instruction_prompt(self) -> str:
|
188
177
|
if self._default_special_instruction_prompt is not None:
|
zrb/task/llm/prompt.py
CHANGED
@@ -52,19 +52,7 @@ def get_special_instruction_prompt(
|
|
52
52
|
)
|
53
53
|
if special_instruction is not None:
|
54
54
|
return special_instruction
|
55
|
-
|
56
|
-
if llm_config.default_code_review_instruction_prompt:
|
57
|
-
aggregated_special_instruction += "\n".join(
|
58
|
-
[
|
59
|
-
"# Code review instruction",
|
60
|
-
llm_config.default_code_review_instruction_prompt,
|
61
|
-
]
|
62
|
-
)
|
63
|
-
if llm_config.default_special_instruction_prompt:
|
64
|
-
aggregated_special_instruction += "\n" + "\n".join(
|
65
|
-
["# Code review instruction", llm_config.default_special_instruction_prompt]
|
66
|
-
)
|
67
|
-
return aggregated_special_instruction or ""
|
55
|
+
return llm_config.default_special_instruction_prompt
|
68
56
|
|
69
57
|
|
70
58
|
def get_combined_system_prompt(
|
zrb/util/file.py
CHANGED
@@ -12,15 +12,33 @@ def read_file(file_path: str, replace_map: dict[str, str] = {}) -> str:
|
|
12
12
|
Returns:
|
13
13
|
The content of the file with replacements applied.
|
14
14
|
"""
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
abs_file_path = os.path.abspath(os.path.expanduser(file_path))
|
16
|
+
is_pdf = abs_file_path.lower().endswith(".pdf")
|
17
|
+
content = (
|
18
|
+
_read_pdf_file_content(abs_file_path)
|
19
|
+
if is_pdf
|
20
|
+
else _read_text_file_content(abs_file_path)
|
21
|
+
)
|
19
22
|
for key, val in replace_map.items():
|
20
23
|
content = content.replace(key, val)
|
21
24
|
return content
|
22
25
|
|
23
26
|
|
27
|
+
def _read_text_file_content(file_path: str) -> str:
|
28
|
+
with open(file_path, "r", encoding="utf-8") as f:
|
29
|
+
content = f.read()
|
30
|
+
return content
|
31
|
+
|
32
|
+
|
33
|
+
def _read_pdf_file_content(file_path: str) -> str:
|
34
|
+
import pdfplumber
|
35
|
+
|
36
|
+
with pdfplumber.open(file_path) as pdf:
|
37
|
+
return "\n".join(
|
38
|
+
page.extract_text() for page in pdf.pages if page.extract_text()
|
39
|
+
)
|
40
|
+
|
41
|
+
|
24
42
|
def read_file_with_line_numbers(
|
25
43
|
file_path: str, replace_map: dict[str, str] = {}
|
26
44
|
) -> str:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: zrb
|
3
|
-
Version: 1.8.
|
3
|
+
Version: 1.8.2
|
4
4
|
Summary: Your Automation Powerhouse
|
5
5
|
Home-page: https://github.com/state-alchemists/zrb
|
6
6
|
License: AGPL-3.0-or-later
|
@@ -194,6 +194,32 @@ Then open your browser and visit `http://localhost:21213`
|
|
194
194
|

|
195
195
|
|
196
196
|
|
197
|
+
# 🐋 As Container
|
198
|
+
|
199
|
+
Zrb has two version of container:
|
200
|
+
- The normal version
|
201
|
+
- The dind (Docker in Docker) version
|
202
|
+
|
203
|
+
The dind version has builtin docker command, and is suitable to access host's docker CLI command.
|
204
|
+
|
205
|
+
To run the normal version, you can execute:
|
206
|
+
|
207
|
+
```bash
|
208
|
+
# docker run -v <host-path>:<container-path> -it stalchmst/zrb:<version> <command>
|
209
|
+
docker run -v ${HOME}:/zrb-home -it --rm stalchmst/zrb:1.8.1 zrb
|
210
|
+
```
|
211
|
+
|
212
|
+
While to run the dind version, you can execute:
|
213
|
+
|
214
|
+
```bash
|
215
|
+
# docker run -v <host-path>:<container-path> -it stalchmst/zrb:<version>-dind <command>
|
216
|
+
docker run \
|
217
|
+
-v ${HOME}:/zrb-home \
|
218
|
+
-v /var/run/docker.sock:/var/run/docker.sock \
|
219
|
+
-it --rm stalchmst/zrb:1.8.1-dind docker ps
|
220
|
+
```
|
221
|
+
|
222
|
+
|
197
223
|
# 🎥 Demo & Documentation
|
198
224
|
|
199
225
|
- **Full documentation:** [Zrb Documentation](https://github.com/state-alchemists/zrb/blob/main/docs/README.md)
|
@@ -214,7 +240,7 @@ Then open your browser and visit `http://localhost:21213`
|
|
214
240
|
|
215
241
|
If you find Zrb valuable, please consider donating:
|
216
242
|
|
217
|
-
[](https://stalchmst.com
|
243
|
+
[](https://stalchmst.com)
|
218
244
|
|
219
245
|
# 🎉 Fun Fact
|
220
246
|
|
@@ -18,7 +18,7 @@ zrb/builtin/llm/tool/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hS
|
|
18
18
|
zrb/builtin/llm/tool/api.py,sha256=yR9I0ZsI96OeQl9pgwORMASVuXsAL0a89D_iPS4C8Dc,1699
|
19
19
|
zrb/builtin/llm/tool/cli.py,sha256=_CNEmEc6K2Z0i9ppYeM7jGpqaEdT3uxaWQatmxP3jKE,858
|
20
20
|
zrb/builtin/llm/tool/file.py,sha256=nCY74VtruTr9LgAq5mroSr4zF0g6LA_uXMI5sh9c8OE,17909
|
21
|
-
zrb/builtin/llm/tool/rag.py,sha256=
|
21
|
+
zrb/builtin/llm/tool/rag.py,sha256=yqx7vXXyrOCJjhQJl4s0TnLL-2uQUTuKRnkWlSQBW0M,7883
|
22
22
|
zrb/builtin/llm/tool/sub_agent.py,sha256=7n14KzUSFe5Bjf2lpluKlLyL-b1Mehj2QekkuDzo0ik,5091
|
23
23
|
zrb/builtin/llm/tool/web.py,sha256=pXRLhcB_Y6z-2w4C4WezH8n-pg3PSMgt_bwn3aaqi6g,5479
|
24
24
|
zrb/builtin/md5.py,sha256=690RV2LbW7wQeTFxY-lmmqTSVEEZv3XZbjEUW1Q3XpE,1480
|
@@ -216,7 +216,7 @@ zrb/callback/callback.py,sha256=mk_RIHuWi-oP5b81jfhzU6fruhsIjhRtKpwh2yYmsiM,3876
|
|
216
216
|
zrb/cmd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
217
217
|
zrb/cmd/cmd_result.py,sha256=L8bQJzWCpcYexIxHBNsXj2pT3BtLmWex0iJSMkvimOA,597
|
218
218
|
zrb/cmd/cmd_val.py,sha256=7Doowyg6BK3ISSGBLt-PmlhzaEkBjWWm51cED6fAUOQ,1014
|
219
|
-
zrb/config.py,sha256=
|
219
|
+
zrb/config.py,sha256=lpJJv5ns-bNntEpScSLptPHv9gQYvEl4M8LP6rE7zfk,9423
|
220
220
|
zrb/content_transformer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
221
221
|
zrb/content_transformer/any_content_transformer.py,sha256=v8ZUbcix1GGeDQwB6OKX_1TjpY__ksxWVeqibwa_iZA,850
|
222
222
|
zrb/content_transformer/content_transformer.py,sha256=STl77wW-I69QaGzCXjvkppngYFLufow8ybPLSyAvlHs,2404
|
@@ -245,7 +245,7 @@ zrb/input/option_input.py,sha256=TQB82ko5odgzkULEizBZi0e9TIHEbIgvdP0AR3RhA74,213
|
|
245
245
|
zrb/input/password_input.py,sha256=szBojWxSP9QJecgsgA87OIYwQrY2AQ3USIKdDZY6snU,1465
|
246
246
|
zrb/input/str_input.py,sha256=NevZHX9rf1g8eMatPyy-kUX3DglrVAQpzvVpKAzf7bA,81
|
247
247
|
zrb/input/text_input.py,sha256=6T3MngWdUs0u0ZVs5Dl11w5KS7nN1RkgrIR_zKumzPM,3695
|
248
|
-
zrb/llm_config.py,sha256=
|
248
|
+
zrb/llm_config.py,sha256=w_GSyQiJ_Q2jupej8xvQULScqPaSYICdNcH9J54W1lE,11696
|
249
249
|
zrb/runner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
250
250
|
zrb/runner/cli.py,sha256=AbLTNqFy5FuyGQOWOjHZGaBC8e2yuE_Dx1sBdnisR18,6984
|
251
251
|
zrb/runner/common_util.py,sha256=JDMcwvQ8cxnv9kQrAoKVLA40Q1omfv-u5_d5MvvwHeE,1373
|
@@ -343,7 +343,7 @@ zrb/task/llm/error.py,sha256=27DQXSG8SH1-XuvXFdZQKzP39wZDWmd_YnSTz6DJKKI,3690
|
|
343
343
|
zrb/task/llm/history.py,sha256=3WMXoi7RquxosXQf3iv2_BCeF8iKtY1f407pR71xERs,7745
|
344
344
|
zrb/task/llm/history_summarization.py,sha256=n3GbgwXlDIkgpJppMGfpqF_8Wpi9yAoZYh46O1pFQeU,6432
|
345
345
|
zrb/task/llm/print_node.py,sha256=bpISOUxSH_JBLR-4Nq6-iLrzNWFagrKFX6u8ogYYMw8,4395
|
346
|
-
zrb/task/llm/prompt.py,sha256=
|
346
|
+
zrb/task/llm/prompt.py,sha256=zBo3xT3YPX_A4_t8Cd-QjNqQZl9dsoWMTt-NdytI2f4,3827
|
347
347
|
zrb/task/llm/tool_wrapper.py,sha256=Xygd4VCY3ykjVv63pqlTI16ZG41ySkp683_5VTnL-Zo,6481
|
348
348
|
zrb/task/llm/typing.py,sha256=c8VAuPBw_4A3DxfYdydkgedaP-LU61W9_wj3m3CAX1E,58
|
349
349
|
zrb/task/llm_task.py,sha256=Yav1pmV26Eh4h9xTh16dN-DbTvhfYINI0EDp_ptJHLg,15643
|
@@ -374,7 +374,7 @@ zrb/util/codemod/modify_function_call.py,sha256=wbyoRRsM4V9fPYkT5kHN0zpBetpRDq2S
|
|
374
374
|
zrb/util/codemod/modify_method.py,sha256=5fioXjqNQmrf4CV2qlTZHpViF9PMnNer4FvuKam7byo,6344
|
375
375
|
zrb/util/codemod/modify_module.py,sha256=2mzi_NxJ-kNFo5G0U_Rqb3JoYQl1s6Izt7b_wAl10F0,715
|
376
376
|
zrb/util/cron.py,sha256=UWqqhhM7DDTPx6wjCIdBndnVh3NRu-sdKazp8aZkXh8,3833
|
377
|
-
zrb/util/file.py,sha256=
|
377
|
+
zrb/util/file.py,sha256=jygiPSXx2DqaUH5o9P6AKt2nyfynGfvH5mFfeIKrp_w,2754
|
378
378
|
zrb/util/git.py,sha256=gS_Y9sQgJbY0PfgSQiowLvV3Nf0y9C8nT3j6z6oEsG8,8186
|
379
379
|
zrb/util/git_subtree.py,sha256=E_UB5OIgm8WkHL9beifRxpZ25_BB9p1H578OhLZTgRU,4611
|
380
380
|
zrb/util/group.py,sha256=T82yr3qg9I5k10VPXkMyrIRIqyfzadSH813bqzwKEPI,4718
|
@@ -388,7 +388,7 @@ zrb/util/string/name.py,sha256=SXEfxJ1-tDOzHqmSV8kvepRVyMqs2XdV_vyoh_9XUu0,1584
|
|
388
388
|
zrb/util/todo.py,sha256=VGISej2KQZERpornK-8X7bysp4JydMrMUTnG8B0-liI,20708
|
389
389
|
zrb/xcom/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
390
390
|
zrb/xcom/xcom.py,sha256=o79rxR9wphnShrcIushA0Qt71d_p3ZTxjNf7x9hJB78,1571
|
391
|
-
zrb-1.8.
|
392
|
-
zrb-1.8.
|
393
|
-
zrb-1.8.
|
394
|
-
zrb-1.8.
|
391
|
+
zrb-1.8.2.dist-info/METADATA,sha256=NRlAG2IfE1oZDH9CDlAn9hAaQ8Arn5ytoXyZ6pdDZBA,9086
|
392
|
+
zrb-1.8.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
393
|
+
zrb-1.8.2.dist-info/entry_points.txt,sha256=-Pg3ElWPfnaSM-XvXqCxEAa-wfVI6BEgcs386s8C8v8,46
|
394
|
+
zrb-1.8.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|