zrb 1.21.17__py3-none-any.whl → 1.21.33__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/attr/type.py +10 -7
- zrb/builtin/git.py +12 -1
- zrb/builtin/llm/chat_completion.py +287 -0
- zrb/builtin/llm/chat_session_cmd.py +90 -28
- zrb/builtin/llm/chat_trigger.py +6 -1
- zrb/builtin/llm/tool/cli.py +29 -13
- zrb/builtin/llm/tool/code.py +9 -1
- zrb/builtin/llm/tool/file.py +32 -6
- zrb/builtin/llm/tool/note.py +9 -9
- zrb/builtin/llm/tool/search/__init__.py +1 -0
- zrb/builtin/llm/tool/search/brave.py +66 -0
- zrb/builtin/llm/tool/search/searxng.py +61 -0
- zrb/builtin/llm/tool/search/serpapi.py +61 -0
- zrb/builtin/llm/tool/sub_agent.py +30 -10
- zrb/builtin/llm/tool/web.py +17 -72
- zrb/config/config.py +67 -26
- zrb/config/default_prompt/interactive_system_prompt.md +16 -13
- zrb/config/default_prompt/summarization_prompt.md +54 -8
- zrb/config/default_prompt/system_prompt.md +16 -18
- zrb/config/llm_rate_limitter.py +15 -6
- zrb/input/option_input.py +13 -1
- zrb/task/llm/agent.py +42 -143
- zrb/task/llm/agent_runner.py +152 -0
- zrb/task/llm/conversation_history.py +35 -24
- zrb/task/llm/conversation_history_model.py +4 -11
- zrb/task/llm/history_processor.py +206 -0
- zrb/task/llm/history_summarization.py +2 -179
- zrb/task/llm/print_node.py +14 -5
- zrb/task/llm/prompt.py +2 -17
- zrb/task/llm/subagent_conversation_history.py +41 -0
- zrb/task/llm/tool_confirmation_completer.py +41 -0
- zrb/task/llm/tool_wrapper.py +15 -11
- zrb/task/llm_task.py +41 -40
- zrb/util/attr.py +12 -7
- zrb/util/git.py +2 -2
- zrb/xcom/xcom.py +10 -0
- {zrb-1.21.17.dist-info → zrb-1.21.33.dist-info}/METADATA +3 -3
- {zrb-1.21.17.dist-info → zrb-1.21.33.dist-info}/RECORD +40 -32
- zrb/task/llm/history_summarization_tool.py +0 -24
- {zrb-1.21.17.dist-info → zrb-1.21.33.dist-info}/WHEEL +0 -0
- {zrb-1.21.17.dist-info → zrb-1.21.33.dist-info}/entry_points.txt +0 -0
zrb/task/llm_task.py
CHANGED
|
@@ -3,13 +3,14 @@ from collections.abc import Callable
|
|
|
3
3
|
from typing import TYPE_CHECKING, Any
|
|
4
4
|
|
|
5
5
|
from zrb.attr.type import BoolAttr, IntAttr, StrAttr, StrListAttr, fstring
|
|
6
|
-
from zrb.config.llm_rate_limitter import
|
|
6
|
+
from zrb.config.llm_rate_limitter import LLMRateLimitter
|
|
7
7
|
from zrb.context.any_context import AnyContext
|
|
8
8
|
from zrb.env.any_env import AnyEnv
|
|
9
9
|
from zrb.input.any_input import AnyInput
|
|
10
10
|
from zrb.task.any_task import AnyTask
|
|
11
11
|
from zrb.task.base_task import BaseTask
|
|
12
|
-
from zrb.task.llm.agent import get_agent
|
|
12
|
+
from zrb.task.llm.agent import get_agent
|
|
13
|
+
from zrb.task.llm.agent_runner import run_agent_iteration
|
|
13
14
|
from zrb.task.llm.config import (
|
|
14
15
|
get_model,
|
|
15
16
|
get_model_settings,
|
|
@@ -21,13 +22,17 @@ from zrb.task.llm.conversation_history import (
|
|
|
21
22
|
write_conversation_history,
|
|
22
23
|
)
|
|
23
24
|
from zrb.task.llm.conversation_history_model import ConversationHistory
|
|
24
|
-
from zrb.task.llm.history_summarization import
|
|
25
|
+
from zrb.task.llm.history_summarization import get_history_summarization_token_threshold
|
|
25
26
|
from zrb.task.llm.prompt import (
|
|
26
27
|
get_attachments,
|
|
27
28
|
get_summarization_system_prompt,
|
|
28
29
|
get_system_and_user_prompt,
|
|
29
30
|
get_user_message,
|
|
30
31
|
)
|
|
32
|
+
from zrb.task.llm.subagent_conversation_history import (
|
|
33
|
+
extract_subagent_conversation_history_from_ctx,
|
|
34
|
+
inject_subagent_conversation_history_into_ctx,
|
|
35
|
+
)
|
|
31
36
|
from zrb.task.llm.workflow import load_workflow
|
|
32
37
|
from zrb.util.cli.style import stylize_faint
|
|
33
38
|
from zrb.xcom.xcom import Xcom
|
|
@@ -104,11 +109,11 @@ class LLMTask(BaseTask):
|
|
|
104
109
|
render_history_file: bool = True,
|
|
105
110
|
summarize_history: BoolAttr | None = None,
|
|
106
111
|
render_summarize_history: bool = True,
|
|
107
|
-
summarization_prompt:
|
|
112
|
+
summarization_prompt: "Callable[[AnyContext], str | None] | str | None" = None,
|
|
108
113
|
render_summarization_prompt: bool = False,
|
|
109
114
|
history_summarization_token_threshold: IntAttr | None = None,
|
|
110
115
|
render_history_summarization_token_threshold: bool = True,
|
|
111
|
-
rate_limitter:
|
|
116
|
+
rate_limitter: LLMRateLimitter | None = None,
|
|
112
117
|
execute_condition: bool | str | Callable[[AnyContext], bool] = True,
|
|
113
118
|
retries: int = 2,
|
|
114
119
|
retry_period: float = 0,
|
|
@@ -129,9 +134,6 @@ class LLMTask(BaseTask):
|
|
|
129
134
|
upstream: list[AnyTask] | AnyTask | None = None,
|
|
130
135
|
fallback: list[AnyTask] | AnyTask | None = None,
|
|
131
136
|
successor: list[AnyTask] | AnyTask | None = None,
|
|
132
|
-
conversation_context: (
|
|
133
|
-
dict[str, Any] | Callable[[AnyContext], dict[str, Any]] | None
|
|
134
|
-
) = None,
|
|
135
137
|
):
|
|
136
138
|
super().__init__(
|
|
137
139
|
name=name,
|
|
@@ -199,7 +201,6 @@ class LLMTask(BaseTask):
|
|
|
199
201
|
render_history_summarization_token_threshold
|
|
200
202
|
)
|
|
201
203
|
self._max_call_iteration = max_call_iteration
|
|
202
|
-
self._conversation_context = conversation_context
|
|
203
204
|
self._yolo_mode = yolo_mode
|
|
204
205
|
self._render_yolo_mode = render_yolo_mode
|
|
205
206
|
self._attachment = attachment
|
|
@@ -265,6 +266,7 @@ class LLMTask(BaseTask):
|
|
|
265
266
|
conversation_history_attr=self._conversation_history,
|
|
266
267
|
)
|
|
267
268
|
inject_conversation_history_notes(conversation_history)
|
|
269
|
+
inject_subagent_conversation_history_into_ctx(ctx, conversation_history)
|
|
268
270
|
# 2. Get system prompt and user prompt
|
|
269
271
|
system_prompt, user_prompt = get_system_and_user_prompt(
|
|
270
272
|
ctx=ctx,
|
|
@@ -279,12 +281,29 @@ class LLMTask(BaseTask):
|
|
|
279
281
|
render_workflows=self._render_workflows,
|
|
280
282
|
conversation_history=conversation_history,
|
|
281
283
|
)
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
284
|
+
# 3. Summarization
|
|
285
|
+
small_model = get_model(
|
|
286
|
+
ctx=ctx,
|
|
287
|
+
model_attr=self._small_model,
|
|
288
|
+
render_model=self._render_small_model,
|
|
289
|
+
model_base_url_attr=self._small_model_base_url,
|
|
290
|
+
render_model_base_url=self._render_small_model_base_url,
|
|
291
|
+
model_api_key_attr=self._small_model_api_key,
|
|
292
|
+
render_model_api_key=self._render_small_model_api_key,
|
|
293
|
+
)
|
|
294
|
+
small_model_settings = get_model_settings(ctx, self._small_model_settings)
|
|
295
|
+
summarization_token_threshold = get_history_summarization_token_threshold(
|
|
296
|
+
ctx,
|
|
297
|
+
self._history_summarization_token_threshold,
|
|
298
|
+
self._render_history_summarization_token_threshold,
|
|
299
|
+
)
|
|
300
|
+
# 4. Get the agent instance
|
|
301
|
+
ctx.log_info(f"SYSTEM PROMPT:\n{system_prompt}")
|
|
302
|
+
ctx.log_info(f"USER PROMPT:\n{user_prompt}")
|
|
285
303
|
agent = get_agent(
|
|
286
304
|
ctx=ctx,
|
|
287
305
|
model=model,
|
|
306
|
+
rate_limitter=self._rate_limitter,
|
|
288
307
|
system_prompt=system_prompt,
|
|
289
308
|
model_settings=model_settings,
|
|
290
309
|
tools_attr=self._tools,
|
|
@@ -292,8 +311,14 @@ class LLMTask(BaseTask):
|
|
|
292
311
|
toolsets_attr=self._toolsets,
|
|
293
312
|
additional_toolsets=self._additional_toolsets,
|
|
294
313
|
yolo_mode=yolo_mode,
|
|
314
|
+
summarization_model=small_model,
|
|
315
|
+
summarization_model_settings=small_model_settings,
|
|
316
|
+
summarization_system_prompt=summarization_prompt,
|
|
317
|
+
summarization_retries=2, # TODO: make this a property
|
|
318
|
+
summarization_token_threshold=summarization_token_threshold,
|
|
319
|
+
history_processors=[], # TODO: make this a property
|
|
295
320
|
)
|
|
296
|
-
#
|
|
321
|
+
# 5. Run the agent iteration and save the results/history
|
|
297
322
|
result = await self._execute_agent(
|
|
298
323
|
ctx=ctx,
|
|
299
324
|
agent=agent,
|
|
@@ -301,34 +326,10 @@ class LLMTask(BaseTask):
|
|
|
301
326
|
attachments=attachments,
|
|
302
327
|
conversation_history=conversation_history,
|
|
303
328
|
)
|
|
304
|
-
# 5. Summarize
|
|
305
|
-
small_model = get_model(
|
|
306
|
-
ctx=ctx,
|
|
307
|
-
model_attr=self._small_model,
|
|
308
|
-
render_model=self._render_small_model,
|
|
309
|
-
model_base_url_attr=self._small_model_base_url,
|
|
310
|
-
render_model_base_url=self._render_small_model_base_url,
|
|
311
|
-
model_api_key_attr=self._small_model_api_key,
|
|
312
|
-
render_model_api_key=self._render_small_model_api_key,
|
|
313
|
-
)
|
|
314
|
-
small_model_settings = get_model_settings(ctx, self._small_model_settings)
|
|
315
|
-
conversation_history = await maybe_summarize_history(
|
|
316
|
-
ctx=ctx,
|
|
317
|
-
conversation_history=conversation_history,
|
|
318
|
-
should_summarize_history_attr=self._should_summarize_history,
|
|
319
|
-
render_summarize_history=self._render_summarize_history,
|
|
320
|
-
history_summarization_token_threshold_attr=(
|
|
321
|
-
self._history_summarization_token_threshold
|
|
322
|
-
),
|
|
323
|
-
render_history_summarization_token_threshold=(
|
|
324
|
-
self._render_history_summarization_token_threshold
|
|
325
|
-
),
|
|
326
|
-
model=small_model,
|
|
327
|
-
model_settings=small_model_settings,
|
|
328
|
-
summarization_prompt=summarization_prompt,
|
|
329
|
-
rate_limitter=self._rate_limitter,
|
|
330
|
-
)
|
|
331
329
|
# 6. Write conversation history
|
|
330
|
+
conversation_history.subagent_history = (
|
|
331
|
+
extract_subagent_conversation_history_from_ctx(ctx)
|
|
332
|
+
)
|
|
332
333
|
await write_conversation_history(
|
|
333
334
|
ctx=ctx,
|
|
334
335
|
history_data=conversation_history,
|
zrb/util/attr.py
CHANGED
|
@@ -10,11 +10,14 @@ from zrb.attr.type import (
|
|
|
10
10
|
StrListAttr,
|
|
11
11
|
)
|
|
12
12
|
from zrb.context.any_context import AnyContext
|
|
13
|
+
from zrb.context.any_shared_context import AnySharedContext
|
|
13
14
|
from zrb.util.string.conversion import to_boolean
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
def get_str_list_attr(
|
|
17
|
-
ctx: AnyContext
|
|
18
|
+
ctx: AnyContext | AnySharedContext,
|
|
19
|
+
attr: StrListAttr | None,
|
|
20
|
+
auto_render: bool = True,
|
|
18
21
|
) -> list[str]:
|
|
19
22
|
"""
|
|
20
23
|
Retrieve a list of strings from shared context attributes.
|
|
@@ -35,7 +38,9 @@ def get_str_list_attr(
|
|
|
35
38
|
|
|
36
39
|
|
|
37
40
|
def get_str_dict_attr(
|
|
38
|
-
ctx: AnyContext
|
|
41
|
+
ctx: AnyContext | AnySharedContext,
|
|
42
|
+
attr: StrDictAttr | None,
|
|
43
|
+
auto_render: bool = True,
|
|
39
44
|
) -> dict[str, Any]:
|
|
40
45
|
"""
|
|
41
46
|
Retrieve a dictionary of strings from shared context attributes.
|
|
@@ -56,7 +61,7 @@ def get_str_dict_attr(
|
|
|
56
61
|
|
|
57
62
|
|
|
58
63
|
def get_str_attr(
|
|
59
|
-
ctx: AnyContext,
|
|
64
|
+
ctx: AnyContext | AnySharedContext,
|
|
60
65
|
attr: StrAttr | None,
|
|
61
66
|
default: StrAttr = "",
|
|
62
67
|
auto_render: bool = True,
|
|
@@ -82,7 +87,7 @@ def get_str_attr(
|
|
|
82
87
|
|
|
83
88
|
|
|
84
89
|
def get_bool_attr(
|
|
85
|
-
ctx: AnyContext,
|
|
90
|
+
ctx: AnyContext | AnySharedContext,
|
|
86
91
|
attr: BoolAttr | None,
|
|
87
92
|
default: BoolAttr = False,
|
|
88
93
|
auto_render: bool = True,
|
|
@@ -108,7 +113,7 @@ def get_bool_attr(
|
|
|
108
113
|
|
|
109
114
|
|
|
110
115
|
def get_int_attr(
|
|
111
|
-
ctx: AnyContext,
|
|
116
|
+
ctx: AnyContext | AnySharedContext,
|
|
112
117
|
attr: IntAttr | None,
|
|
113
118
|
default: IntAttr = 0,
|
|
114
119
|
auto_render: bool = True,
|
|
@@ -134,7 +139,7 @@ def get_int_attr(
|
|
|
134
139
|
|
|
135
140
|
|
|
136
141
|
def get_float_attr(
|
|
137
|
-
ctx: AnyContext,
|
|
142
|
+
ctx: AnyContext | AnySharedContext,
|
|
138
143
|
attr: FloatAttr | None,
|
|
139
144
|
default: FloatAttr = 0.0,
|
|
140
145
|
auto_render: bool = True,
|
|
@@ -160,7 +165,7 @@ def get_float_attr(
|
|
|
160
165
|
|
|
161
166
|
|
|
162
167
|
def get_attr(
|
|
163
|
-
ctx: AnyContext,
|
|
168
|
+
ctx: AnyContext | AnySharedContext,
|
|
164
169
|
attr: AnyAttr,
|
|
165
170
|
default: AnyAttr,
|
|
166
171
|
auto_render: bool = True,
|
zrb/util/git.py
CHANGED
|
@@ -131,7 +131,7 @@ async def get_branches(
|
|
|
131
131
|
Exception: If the git command returns a non-zero exit code.
|
|
132
132
|
"""
|
|
133
133
|
cmd_result, exit_code = await run_command(
|
|
134
|
-
cmd=["git", "
|
|
134
|
+
cmd=["git", "branch"],
|
|
135
135
|
cwd=repo_dir,
|
|
136
136
|
print_method=print_method,
|
|
137
137
|
)
|
|
@@ -160,7 +160,7 @@ async def delete_branch(
|
|
|
160
160
|
Exception: If the git command returns a non-zero exit code.
|
|
161
161
|
"""
|
|
162
162
|
cmd_result, exit_code = await run_command(
|
|
163
|
-
cmd=["git", "branch", "-
|
|
163
|
+
cmd=["git", "branch", "-d", branch_name],
|
|
164
164
|
cwd=repo_dir,
|
|
165
165
|
print_method=print_method,
|
|
166
166
|
)
|
zrb/xcom/xcom.py
CHANGED
|
@@ -34,6 +34,16 @@ class Xcom(deque):
|
|
|
34
34
|
else:
|
|
35
35
|
raise IndexError("Xcom is empty")
|
|
36
36
|
|
|
37
|
+
def get(self, default_value: Any = None) -> Any:
|
|
38
|
+
if len(self) > 0:
|
|
39
|
+
return self[0]
|
|
40
|
+
return default_value
|
|
41
|
+
|
|
42
|
+
def set(self, new_value: Any):
|
|
43
|
+
self.push(new_value)
|
|
44
|
+
while len(self) > 1:
|
|
45
|
+
self.pop()
|
|
46
|
+
|
|
37
47
|
def add_push_callback(self, callback: Callable[[], Any]):
|
|
38
48
|
if not hasattr(self, "push_callbacks"):
|
|
39
49
|
self.push_callbacks: list[Callable[[], Any]] = []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: zrb
|
|
3
|
-
Version: 1.21.
|
|
3
|
+
Version: 1.21.33
|
|
4
4
|
Summary: Your Automation Powerhouse
|
|
5
5
|
License: AGPL-3.0-or-later
|
|
6
6
|
Keywords: Automation,Task Runner,Code Generator,Monorepo,Low Code
|
|
@@ -40,12 +40,12 @@ Requires-Dist: libcst (>=1.8.6,<2.0.0)
|
|
|
40
40
|
Requires-Dist: markdownify (>=1.2.2,<2.0.0)
|
|
41
41
|
Requires-Dist: mcp (>1.18.0)
|
|
42
42
|
Requires-Dist: mistralai (>=1.9.10) ; extra == "mistral"
|
|
43
|
-
Requires-Dist: openai (>=2.
|
|
43
|
+
Requires-Dist: openai (>=2.11.0)
|
|
44
44
|
Requires-Dist: pdfplumber (>=0.11.7,<0.12.0)
|
|
45
45
|
Requires-Dist: playwright (>=1.56.0,<2.0.0) ; extra == "playwright" or extra == "all"
|
|
46
46
|
Requires-Dist: prompt-toolkit (>=3)
|
|
47
47
|
Requires-Dist: psutil (>=7.0.0,<8.0.0)
|
|
48
|
-
Requires-Dist: pydantic-ai-slim (>=1.
|
|
48
|
+
Requires-Dist: pydantic-ai-slim (>=1.32.0,<1.33.0)
|
|
49
49
|
Requires-Dist: pyjwt (>=2.10.1,<3.0.0)
|
|
50
50
|
Requires-Dist: python-dotenv (>=1.1.1,<2.0.0)
|
|
51
51
|
Requires-Dist: python-jose[cryptography] (>=3.5.0,<4.0.0)
|
|
@@ -1,31 +1,36 @@
|
|
|
1
1
|
zrb/__init__.py,sha256=qkCV2EnAGIgvsawBHYvKgPAp0zzPcikYSmbQXATLzg4,5060
|
|
2
2
|
zrb/__main__.py,sha256=9SXH9MK4PVyU9lkEyHxiIUABbcsV2wseP94HmlqTR4M,2657
|
|
3
3
|
zrb/attr/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
zrb/attr/type.py,sha256=
|
|
4
|
+
zrb/attr/type.py,sha256=eAsYk4aW8Pyi82KU5hfNpQuy6-FLsqcacSj0hJOGNnk,742
|
|
5
5
|
zrb/builtin/__init__.py,sha256=X_uDUEeu86MrYLehHEFiLFdbqrRXMvHECEeIJJkKWh4,1724
|
|
6
6
|
zrb/builtin/base64.py,sha256=UjaFttE2oRx0T7_RpKtKfgMtWfiQXfJBAJmA16ek8Ic,1507
|
|
7
|
-
zrb/builtin/git.py,sha256=
|
|
7
|
+
zrb/builtin/git.py,sha256=HWxCHW78HJ9SCiph4BMHFfrIpM4V8-bR2MmHLDaWEQM,5810
|
|
8
8
|
zrb/builtin/git_subtree.py,sha256=7BKwOkVTWDrR0DXXQ4iJyHqeR6sV5VYRt8y_rEB0EHg,3505
|
|
9
9
|
zrb/builtin/group.py,sha256=W_IA_4414c8Wi8QazqcT6Gq6UftrKwy95yMF114EJtI,2677
|
|
10
10
|
zrb/builtin/http.py,sha256=L6RE73c65wWwG5iHFN-tpOhyh56KsrgVskDd3c3YXtk,4246
|
|
11
11
|
zrb/builtin/jwt.py,sha256=3M5uaQhJZbKQLjTUft1OwPz_JxtmK-xtkjxWjciOQho,2859
|
|
12
12
|
zrb/builtin/llm/attachment.py,sha256=UwhOGtZY9Px9aebsKfTTw2_ZIpbsqx0XgoAonk6Ewkc,1344
|
|
13
|
+
zrb/builtin/llm/chat_completion.py,sha256=cWVju5ApC2OPGM3ZWGaXwSgLwgT9leKS_TbV4z610zc,12252
|
|
13
14
|
zrb/builtin/llm/chat_session.py,sha256=TmXL7IkVT22blgWqG625qpr2_BnDMIm7ERYbR61BL4Q,9154
|
|
14
|
-
zrb/builtin/llm/chat_session_cmd.py,sha256=
|
|
15
|
-
zrb/builtin/llm/chat_trigger.py,sha256=
|
|
15
|
+
zrb/builtin/llm/chat_session_cmd.py,sha256=lGiN-YNtv957wYuuF_mXV0opbRN61U9pyxVVq-_Gwv8,10842
|
|
16
|
+
zrb/builtin/llm/chat_trigger.py,sha256=i6_lej2xYfY8k5-CMIUsdYQdUvBV9ma_DM6ZmgLaQIU,2673
|
|
16
17
|
zrb/builtin/llm/history.py,sha256=qNRYq6SlJH5iuzdra_FOJxevWXCDh5YMvN2qPNLjI8I,3099
|
|
17
18
|
zrb/builtin/llm/input.py,sha256=Nw-26uTWp2QhUgKJcP_IMHmtk-b542CCSQ_vCOjhvhM,877
|
|
18
19
|
zrb/builtin/llm/llm_ask.py,sha256=6fUbCFjgjFiTVf-88WJZ1RD5wgOzmsVEpD3dR16Jl_8,8598
|
|
19
20
|
zrb/builtin/llm/previous-session.js,sha256=xMKZvJoAbrwiyHS0OoPrWuaKxWYLoyR5sguePIoCjTY,816
|
|
20
21
|
zrb/builtin/llm/tool/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
21
22
|
zrb/builtin/llm/tool/api.py,sha256=ItGJLr_1vhmLcitfIKeVDrnJEWdsyqucDnQ7enIC8fQ,2394
|
|
22
|
-
zrb/builtin/llm/tool/cli.py,sha256=
|
|
23
|
-
zrb/builtin/llm/tool/code.py,sha256=
|
|
24
|
-
zrb/builtin/llm/tool/file.py,sha256=
|
|
25
|
-
zrb/builtin/llm/tool/note.py,sha256=
|
|
23
|
+
zrb/builtin/llm/tool/cli.py,sha256=9BCbB6S5gBladOWO9dJhPgMq8dqpB2LQEfC6druZPDs,2091
|
|
24
|
+
zrb/builtin/llm/tool/code.py,sha256=1sErE5tsticXGNhiE0bTjI21Zq6zHMgS2hVM6dsAcww,7916
|
|
25
|
+
zrb/builtin/llm/tool/file.py,sha256=pzaIWB64aaEuW2I3TyuZwpNQa_nMv-zqJzSfTfjT9GQ,20183
|
|
26
|
+
zrb/builtin/llm/tool/note.py,sha256=USDQe8F1ddQp5dhv2u35rUN9EfJQl5BaWJIs6Xg9ZZY,2597
|
|
26
27
|
zrb/builtin/llm/tool/rag.py,sha256=lmoA42IWHcBOWTsWzYGklLs1YoiEldvu_Bi5bp6gbts,9439
|
|
27
|
-
zrb/builtin/llm/tool/
|
|
28
|
-
zrb/builtin/llm/tool/
|
|
28
|
+
zrb/builtin/llm/tool/search/__init__.py,sha256=wiMaie_IYt00fak-LrioC1qEZDs0SwYz4UWwidHfpFU,49
|
|
29
|
+
zrb/builtin/llm/tool/search/brave.py,sha256=ifuq3qX1rWZjJWw1afGD8VNkqED9Vwv5GJaJYwXmYdM,2271
|
|
30
|
+
zrb/builtin/llm/tool/search/searxng.py,sha256=kSp3HhhHu43eR8RvuzgF5f9EwSy0-uQQyWBYaYfZ82I,2092
|
|
31
|
+
zrb/builtin/llm/tool/search/serpapi.py,sha256=t5AM5PJ_j8VQQWHxFN61-WkDmcXVuvC1ZrFQ1tXZw1w,2101
|
|
32
|
+
zrb/builtin/llm/tool/sub_agent.py,sha256=UNgsvZvSQ1b5ybB0nRzTiFCJpZG3g2RLj_nzjRZzXMY,5808
|
|
33
|
+
zrb/builtin/llm/tool/web.py,sha256=nBpCN9sZ66Ly6nzpnNnUunXN_OJqClmShGI-6saEWFk,4364
|
|
29
34
|
zrb/builtin/md5.py,sha256=690RV2LbW7wQeTFxY-lmmqTSVEEZv3XZbjEUW1Q3XpE,1480
|
|
30
35
|
zrb/builtin/project/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
31
36
|
zrb/builtin/project/add/fastapp/fastapp_input.py,sha256=MKlWR_LxWhM_DcULCtLfL_IjTxpDnDBkn9KIqNmajFs,310
|
|
@@ -223,19 +228,19 @@ zrb/callback/callback.py,sha256=PFhCqzfxdk6IAthmXcZ13DokT62xtBzJr_ciLw6I8Zg,4030
|
|
|
223
228
|
zrb/cmd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
224
229
|
zrb/cmd/cmd_result.py,sha256=L8bQJzWCpcYexIxHBNsXj2pT3BtLmWex0iJSMkvimOA,597
|
|
225
230
|
zrb/cmd/cmd_val.py,sha256=7Doowyg6BK3ISSGBLt-PmlhzaEkBjWWm51cED6fAUOQ,1014
|
|
226
|
-
zrb/config/config.py,sha256=
|
|
231
|
+
zrb/config/config.py,sha256=bqC_B9OpofNWJkWA11HvtWD-Ut0VeKseIso5OACU6v4,19889
|
|
227
232
|
zrb/config/default_prompt/file_extractor_system_prompt.md,sha256=cVqhI016-fKa8PKz2kIxQAC0hPExgMT2ks-rVlz4K60,3789
|
|
228
|
-
zrb/config/default_prompt/interactive_system_prompt.md,sha256=
|
|
233
|
+
zrb/config/default_prompt/interactive_system_prompt.md,sha256=LewDZo_zXMP6U_42c5egAY0Hb4KYp4Tbf3rUd9bPK8k,2659
|
|
229
234
|
zrb/config/default_prompt/persona.md,sha256=GfUJ4-Mlf_Bm1YTzxFNkPkdVbAi06ZDVYh-iIma3NOs,253
|
|
230
235
|
zrb/config/default_prompt/repo_extractor_system_prompt.md,sha256=lmfMMc9BLLATHAVMmSEeXr7xTeiF4FWv_AWYedgcbDE,3786
|
|
231
236
|
zrb/config/default_prompt/repo_summarizer_system_prompt.md,sha256=-T_baTblam2XlW99e72jfgsrIBTjpABMBXRFI_7L6RA,1987
|
|
232
|
-
zrb/config/default_prompt/summarization_prompt.md,sha256=
|
|
233
|
-
zrb/config/default_prompt/system_prompt.md,sha256=
|
|
237
|
+
zrb/config/default_prompt/summarization_prompt.md,sha256=0FI7GO9wkOOP7I_CrJPECtrqDHE_SMNr9aKKHC1GtPI,3633
|
|
238
|
+
zrb/config/default_prompt/system_prompt.md,sha256=ipPaECOM4KQj5u2bzQj1f1w0J78vuZuLnxF5orZWElo,2857
|
|
234
239
|
zrb/config/llm_config.py,sha256=Nt7P0Q6bRpLbGi3IZ1WPeOxUsUUL438_8ufpML1WN28,12798
|
|
235
240
|
zrb/config/llm_context/config.py,sha256=WdqoFxc-PSwNh9aeTWhHMNiQZotbdQ8WaVr3YcezGNo,6487
|
|
236
241
|
zrb/config/llm_context/config_parser.py,sha256=PLfLfMgxPBj7Ryy-37gCZIHrweo1XiFQGnUqjvKXU_Y,1465
|
|
237
242
|
zrb/config/llm_context/workflow.py,sha256=cHkUYBk2Mc35RBuma7Vn3QCNaHd95Ajqr1N4L43FFZs,2681
|
|
238
|
-
zrb/config/llm_rate_limitter.py,sha256=
|
|
243
|
+
zrb/config/llm_rate_limitter.py,sha256=sNi_fttwRKjMTCn1pBoqx-p2uI4wHSl8CAAP8poe94g,7012
|
|
239
244
|
zrb/config/web_auth_config.py,sha256=_PXatQTYh2mX9H3HSYSQKp13zm1RlLyVIoeIr6KYMQ8,6279
|
|
240
245
|
zrb/content_transformer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
241
246
|
zrb/content_transformer/any_content_transformer.py,sha256=v8ZUbcix1GGeDQwB6OKX_1TjpY__ksxWVeqibwa_iZA,850
|
|
@@ -261,7 +266,7 @@ zrb/input/base_input.py,sha256=HCTxBZwnK-gP-F7XQGDbyyZHvwYR0fwNICzqVUw5Cg8,4169
|
|
|
261
266
|
zrb/input/bool_input.py,sha256=9ir8aTm8zaufrJ84_EerC5vOjyn4hHZ3BiLzFqPgPFM,1839
|
|
262
267
|
zrb/input/float_input.py,sha256=8G9lJKLlb_Upk9m5pBF9JwqlAAiYJLrbIItLnyzPxpg,1475
|
|
263
268
|
zrb/input/int_input.py,sha256=UhxCFYlZdJcgUSGGEkz301zOgRVpK0KDG_IxxWpQfMU,1457
|
|
264
|
-
zrb/input/option_input.py,sha256=
|
|
269
|
+
zrb/input/option_input.py,sha256=pG-7R5QboXRLyb4E63PXIUnhs5fHu2RCkGLBue46mmU,2687
|
|
265
270
|
zrb/input/password_input.py,sha256=szBojWxSP9QJecgsgA87OIYwQrY2AQ3USIKdDZY6snU,1465
|
|
266
271
|
zrb/input/str_input.py,sha256=NevZHX9rf1g8eMatPyy-kUX3DglrVAQpzvVpKAzf7bA,81
|
|
267
272
|
zrb/input/text_input.py,sha256=9vpXJt7ASa_Gq2zFbVWT1p-PBjYf6DpyXfuhIH-rJgs,2969
|
|
@@ -353,10 +358,11 @@ zrb/task/base_trigger.py,sha256=nbhFY3QCLNZkXxRorjyC4k2sEJumzR8YCNjOhFBSjJ8,7165
|
|
|
353
358
|
zrb/task/cmd_task.py,sha256=myM8WZm6NrUD-Wv0Vb5sTOrutrAVZLt5LVsSBKwX6SM,10860
|
|
354
359
|
zrb/task/http_check.py,sha256=Gf5rOB2Se2EdizuN9rp65HpGmfZkGc-clIAlHmPVehs,2565
|
|
355
360
|
zrb/task/llm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
356
|
-
zrb/task/llm/agent.py,sha256=
|
|
361
|
+
zrb/task/llm/agent.py,sha256=FrwqAt2SKm78C1fXAPJrXOZfd8iu-13n_R3tVetJlfI,8333
|
|
362
|
+
zrb/task/llm/agent_runner.py,sha256=7VmLnhtF1oWfuV6xMCIwd4xPewpDXgfIPEJRoX9boiA,5202
|
|
357
363
|
zrb/task/llm/config.py,sha256=wCcwxcaW2dgjxsjrXnG1inyKpQWs37kXJ-L_CO-KJ5s,4486
|
|
358
|
-
zrb/task/llm/conversation_history.py,sha256=
|
|
359
|
-
zrb/task/llm/conversation_history_model.py,sha256=
|
|
364
|
+
zrb/task/llm/conversation_history.py,sha256=Fye5oryjdDN_JGBkxoPGUsjuU0FTHis1Ue6nTovo1Zo,7112
|
|
365
|
+
zrb/task/llm/conversation_history_model.py,sha256=2ScAuu5ne6X6F0bXm-21ckEoqcDlWDeuD5L4DPPdz-Q,2629
|
|
360
366
|
zrb/task/llm/default_workflow/coding/workflow.md,sha256=tGiZuR5SYtLvvILJ_AkHaWdvXn5wvLd3RqNyjnHq9NE,5474
|
|
361
367
|
zrb/task/llm/default_workflow/copywriting/workflow.md,sha256=CL9083lrMZHa-J6GlbyGxgRxa8CqJJQFMw_I7WFK13w,3182
|
|
362
368
|
zrb/task/llm/default_workflow/git/workflow.md,sha256=BBkIChqLkex-irkaWH9lQlQkVHed1SM28nfgx8K3yZA,4263
|
|
@@ -371,14 +377,16 @@ zrb/task/llm/default_workflow/shell/workflow.md,sha256=_5aW5DEjOauiUANNWgbfEFmH5
|
|
|
371
377
|
zrb/task/llm/error.py,sha256=QR-nIohS6pBpC_16cWR-fw7Mevo1sNYAiXMBsh_CJDE,4157
|
|
372
378
|
zrb/task/llm/file_replacement.py,sha256=cUgtcfH9OlHzPwdZhSzWVNs7ZO0YYh0ajxqMwfIbvD0,7193
|
|
373
379
|
zrb/task/llm/file_tool_model.py,sha256=bNH-nrHamXtc_sUiPZ1TYI6CqefPIXj3tP4FbURiU1Y,1721
|
|
374
|
-
zrb/task/llm/
|
|
375
|
-
zrb/task/llm/
|
|
376
|
-
zrb/task/llm/print_node.py,sha256=
|
|
377
|
-
zrb/task/llm/prompt.py,sha256=
|
|
378
|
-
zrb/task/llm/
|
|
380
|
+
zrb/task/llm/history_processor.py,sha256=QQHoE2RNz8w75li-RC4PFgCelCLhVv4ObOiSQQ8JxDM,7684
|
|
381
|
+
zrb/task/llm/history_summarization.py,sha256=YqLm9Q5xzFVTL5XwnWu3XwaMgSxKskDFvoi2MIThRB0,927
|
|
382
|
+
zrb/task/llm/print_node.py,sha256=d7OMOJ2kj6iXZS2cC5cyuDF1QDFsA9FxDGX-xfirvxs,8674
|
|
383
|
+
zrb/task/llm/prompt.py,sha256=jlFNWa1IMCYNQh9Ccq9DB1dq9964IOQJ5jNSC9rMpkw,11366
|
|
384
|
+
zrb/task/llm/subagent_conversation_history.py,sha256=y8UbKF2GpjB-r1bc2xCpzepriVEq0wfdyFuHOwfpPfk,1647
|
|
385
|
+
zrb/task/llm/tool_confirmation_completer.py,sha256=rOYZdq5No9DfLUG889cr99cUX6XmoO29Yh9FUcdMMio,1534
|
|
386
|
+
zrb/task/llm/tool_wrapper.py,sha256=FfW2JcZ8vUVie0pekpwpQABQ8DhIv8EG7_kPSYGwsVw,12440
|
|
379
387
|
zrb/task/llm/typing.py,sha256=c8VAuPBw_4A3DxfYdydkgedaP-LU61W9_wj3m3CAX1E,58
|
|
380
388
|
zrb/task/llm/workflow.py,sha256=eGpUXoIKgbPFPZJ7hHy_HkGYnGWWx9-B9FNjjNm3_8I,2968
|
|
381
|
-
zrb/task/llm_task.py,sha256=
|
|
389
|
+
zrb/task/llm_task.py,sha256=ZH5XN064tJy2dTEnjf43Tk32-cL3-0Ey9JISz1hooTw,16388
|
|
382
390
|
zrb/task/make_task.py,sha256=rWay-Wz2nAOr4mhMcJZuuehuWULfSBmZm5XcDN4ZN3c,2198
|
|
383
391
|
zrb/task/rsync_task.py,sha256=0M5g2E_b28uCNLXSq2vTsDP2TdGpHfhNn1sDv4MhzNw,7089
|
|
384
392
|
zrb/task/scaffolder.py,sha256=rME18w1HJUHXgi9eTYXx_T2G4JdqDYzBoNOkdOOo5-o,6806
|
|
@@ -388,7 +396,7 @@ zrb/task/tcp_check.py,sha256=P_QgGqwd5dXDaud3oQRxe_WuxyxG4s7CTY2wDk9Qcu0,2511
|
|
|
388
396
|
zrb/task_status/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
389
397
|
zrb/task_status/task_status.py,sha256=blZ8dxg9g_8MuViq-t7yJRLoE7yGUf5srgHf-PCsXNc,3069
|
|
390
398
|
zrb/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
391
|
-
zrb/util/attr.py,sha256=
|
|
399
|
+
zrb/util/attr.py,sha256=3-arwThz8pOnLf4PRA_D-5Pue9xKVEmLtESsIXHCBSE,5523
|
|
392
400
|
zrb/util/callable.py,sha256=b6OFXbCXp2twow3wh2E_h5hNHLs2pXaLfGQz4iVyiQc,771
|
|
393
401
|
zrb/util/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
394
402
|
zrb/util/cli/markdown.py,sha256=Uhuw8XR-jAG9AG3oNK8VHJpYOdU40Q_8yVN74uu0RJ8,384
|
|
@@ -410,7 +418,7 @@ zrb/util/codemod/modify_method.py,sha256=5fioXjqNQmrf4CV2qlTZHpViF9PMnNer4FvuKam
|
|
|
410
418
|
zrb/util/codemod/modify_module.py,sha256=2mzi_NxJ-kNFo5G0U_Rqb3JoYQl1s6Izt7b_wAl10F0,715
|
|
411
419
|
zrb/util/cron.py,sha256=UWqqhhM7DDTPx6wjCIdBndnVh3NRu-sdKazp8aZkXh8,3833
|
|
412
420
|
zrb/util/file.py,sha256=BUWGfJwlS5FoaFgZ2CBG9LVcm-5cdqtFjaYda0VVs2s,3262
|
|
413
|
-
zrb/util/git.py,sha256=
|
|
421
|
+
zrb/util/git.py,sha256=Zy8F22IDJy-PIHH7wNy6KpADetrm4us2l0s9JeMS_DM,8166
|
|
414
422
|
zrb/util/git_diff_model.py,sha256=Tg2q6oxQ5chryThzjs0cLcKFGM03CnqvusTo_Ug_oX4,369
|
|
415
423
|
zrb/util/git_subtree.py,sha256=AyQWCWEi2EIzEpYXRnYN55157KMUql0WHj70QNw5PHU,4612
|
|
416
424
|
zrb/util/git_subtree_model.py,sha256=P_gJ0zhOAc3gFM6sYcjc0Ack9dFBt75TI5fXdE0q320,871
|
|
@@ -428,8 +436,8 @@ zrb/util/todo_model.py,sha256=hhzAX-uFl5rsg7iVX1ULlJOfBtblwQ_ieNUxBWfc-Os,1670
|
|
|
428
436
|
zrb/util/truncate.py,sha256=eSzmjBpc1Qod3lM3M73snNbDOcARHukW_tq36dWdPvc,921
|
|
429
437
|
zrb/util/yaml.py,sha256=MXcqQTOYzx16onFxxg6HNdavxDK4RQjvKUi2NMKd19Y,6510
|
|
430
438
|
zrb/xcom/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
431
|
-
zrb/xcom/xcom.py,sha256=
|
|
432
|
-
zrb-1.21.
|
|
433
|
-
zrb-1.21.
|
|
434
|
-
zrb-1.21.
|
|
435
|
-
zrb-1.21.
|
|
439
|
+
zrb/xcom/xcom.py,sha256=W5BOF9w5fVX2ZBlbOTMsXHbY0yU8Advm-_oWJ3DJvDM,1824
|
|
440
|
+
zrb-1.21.33.dist-info/METADATA,sha256=8_GuNfrNEPw5ZvdP-LqhFH7HAP4CfApFxhli-t3TI3k,10622
|
|
441
|
+
zrb-1.21.33.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
442
|
+
zrb-1.21.33.dist-info/entry_points.txt,sha256=-Pg3ElWPfnaSM-XvXqCxEAa-wfVI6BEgcs386s8C8v8,46
|
|
443
|
+
zrb-1.21.33.dist-info/RECORD,,
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
from typing import Callable
|
|
2
|
-
|
|
3
|
-
from zrb.task.llm.conversation_history_model import ConversationHistory
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
def create_history_summarization_tool(
|
|
7
|
-
conversation_history: ConversationHistory,
|
|
8
|
-
) -> Callable[[str, str], str]:
|
|
9
|
-
def update_conversation_memory(
|
|
10
|
-
past_conversation_summary: str,
|
|
11
|
-
past_conversation_transcript: str,
|
|
12
|
-
) -> str:
|
|
13
|
-
"""
|
|
14
|
-
Update the conversation memory including summary and transcript.
|
|
15
|
-
- past_conversation_summary: A concise narrative that integrates the
|
|
16
|
-
previous summary with the recent conversation.
|
|
17
|
-
- past_conversation_transcript: MUST be ONLY the last 4 (four) turns
|
|
18
|
-
of the conversation.
|
|
19
|
-
"""
|
|
20
|
-
conversation_history.past_conversation_summary = past_conversation_summary
|
|
21
|
-
conversation_history.past_conversation_transcript = past_conversation_transcript
|
|
22
|
-
return "Conversation memory updated"
|
|
23
|
-
|
|
24
|
-
return update_conversation_memory
|
|
File without changes
|
|
File without changes
|