zrb 1.15.23__py3-none-any.whl → 1.15.24__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.
@@ -1,4 +1,4 @@
1
- You are a memory management AI. Your only task is to process the provided conversation history and call the `update_conversation_memory` tool **once**.
1
+ You are a memory management AI. Your only task is to process the provided conversation history and call the `final_result` tool **once**.
2
2
 
3
3
  Follow these instructions carefully:
4
4
 
@@ -11,6 +11,6 @@ Follow these instructions carefully:
11
11
  * Update `contextual_note` with facts specific to the current project/directory.
12
12
  * **CRITICAL:** When updating `contextual_note`, you MUST determine the correct `context_path`. For example, if a fact was established when the working directory was `/app`, the `context_path` MUST be `/app`.
13
13
  * **CRITICAL:** Note content must be **brief**, raw, unformatted text, not a log of events. Only update notes if information has changed.
14
- 4. **Update Memory:** Call the `update_conversation_memory` tool with all the information you consolidated.
14
+ 4. **Update Memory:** Call the `final_result` tool with all the information you consolidated.
15
15
 
16
- After you have called the tool, your task is complete. Your final output **MUST** be the single word `OK`. Do not add any other text, formatting, or tool calls.
16
+ After you have called the tool, your task is complete.
zrb/task/llm/agent.py CHANGED
@@ -16,6 +16,7 @@ if TYPE_CHECKING:
16
16
  from pydantic_ai.agent import AgentRun
17
17
  from pydantic_ai.messages import UserContent
18
18
  from pydantic_ai.models import Model
19
+ from pydantic_ai.output import OutputDataT, OutputSpec
19
20
  from pydantic_ai.settings import ModelSettings
20
21
  from pydantic_ai.toolsets import AbstractToolset
21
22
 
@@ -25,13 +26,14 @@ if TYPE_CHECKING:
25
26
  def create_agent_instance(
26
27
  ctx: AnyContext,
27
28
  model: "str | Model",
29
+ output_type: "OutputSpec[OutputDataT]" = str,
28
30
  system_prompt: str = "",
29
31
  model_settings: "ModelSettings | None" = None,
30
32
  tools: "list[ToolOrCallable]" = [],
31
33
  toolsets: list["AbstractToolset[Agent]"] = [],
32
34
  retries: int = 3,
33
35
  yolo_mode: bool | list[str] | None = None,
34
- ) -> "Agent":
36
+ ) -> "Agent[None, Any]":
35
37
  """Creates a new Agent instance with configured tools and servers."""
36
38
  from pydantic_ai import Agent, Tool
37
39
  from pydantic_ai.tools import GenerateToolJsonSchema
@@ -63,8 +65,9 @@ def create_agent_instance(
63
65
  # Turn function into tool
64
66
  tool_list.append(wrap_tool(tool_or_callable, ctx, yolo_mode))
65
67
  # Return Agent
66
- return Agent(
68
+ return Agent[None, Any](
67
69
  model=model,
70
+ output_type=output_type,
68
71
  system_prompt=system_prompt,
69
72
  tools=tool_list,
70
73
  toolsets=toolsets,
@@ -77,14 +80,15 @@ def get_agent(
77
80
  ctx: AnyContext,
78
81
  agent_attr: "Agent | Callable[[AnySharedContext], Agent] | None",
79
82
  model: "str | Model",
80
- system_prompt: str,
81
- model_settings: "ModelSettings | None",
83
+ output_type: "OutputSpec[OutputDataT]" = str,
84
+ system_prompt: str = "",
85
+ model_settings: "ModelSettings | None" = None,
82
86
  tools_attr: (
83
87
  "list[ToolOrCallable] | Callable[[AnySharedContext], list[ToolOrCallable]]"
84
- ),
85
- additional_tools: "list[ToolOrCallable]",
86
- toolsets_attr: "list[AbstractToolset[Agent]] | Callable[[AnySharedContext], list[AbstractToolset[Agent]]]", # noqa
87
- additional_toolsets: "list[AbstractToolset[Agent]]",
88
+ ) = [],
89
+ additional_tools: "list[ToolOrCallable]" = [],
90
+ toolsets_attr: "list[AbstractToolset[Agent]] | Callable[[AnySharedContext], list[AbstractToolset[Agent]]]" = [], # noqa
91
+ additional_toolsets: "list[AbstractToolset[Agent]]" = [],
88
92
  retries: int = 3,
89
93
  yolo_mode: bool | list[str] | None = None,
90
94
  ) -> "Agent":
@@ -113,6 +117,7 @@ def get_agent(
113
117
  return create_agent_instance(
114
118
  ctx=ctx,
115
119
  model=model,
120
+ output_type=output_type,
116
121
  system_prompt=system_prompt,
117
122
  tools=tools,
118
123
  toolsets=tool_sets,
@@ -124,7 +129,7 @@ def get_agent(
124
129
 
125
130
  async def run_agent_iteration(
126
131
  ctx: AnyContext,
127
- agent: "Agent",
132
+ agent: "Agent[None, Any]",
128
133
  user_prompt: str,
129
134
  attachments: "list[UserContent] | None" = None,
130
135
  history_list: ListOfDict | None = None,
@@ -143,12 +143,13 @@ async def summarize_history(
143
143
  ),
144
144
  ]
145
145
  )
146
- summarization_agent = Agent(
146
+ summarize = create_history_summarization_tool(conversation_history)
147
+ summarization_agent = Agent[None, str](
147
148
  model=model,
149
+ output_type=summarize,
148
150
  system_prompt=system_prompt,
149
151
  model_settings=settings,
150
152
  retries=retries,
151
- tools=[create_history_summarization_tool(conversation_history)],
152
153
  )
153
154
  try:
154
155
  ctx.print(stylize_faint(" 📝 Rollup Conversation"), plain=True)
@@ -7,14 +7,14 @@ from zrb.task.llm.conversation_history_model import ConversationHistory
7
7
 
8
8
  def create_history_summarization_tool(
9
9
  conversation_history: ConversationHistory,
10
- ) -> Callable:
10
+ ) -> Callable[[str, str, str | None, str | None, str | None], str]:
11
11
  def update_conversation_memory(
12
12
  past_conversation_summary: str,
13
13
  past_conversation_transcript: str,
14
14
  long_term_note: str | None = None,
15
15
  contextual_note: str | None = None,
16
16
  context_path: str | None = None,
17
- ):
17
+ ) -> str:
18
18
  """
19
19
  Update the conversation memory including summary, transcript, and notes.
20
20
  - past_conversation_summary: A concise narrative that integrates the
@@ -33,6 +33,6 @@ def create_history_summarization_tool(
33
33
  if context_path is None:
34
34
  context_path = conversation_history.project_path
35
35
  llm_context_config.write_context(contextual_note, context_path=context_path)
36
- return json.dumps({"success": True})
36
+ return "Conversation memory updated"
37
37
 
38
38
  return update_conversation_memory
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: zrb
3
- Version: 1.15.23
3
+ Version: 1.15.24
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
@@ -223,7 +223,7 @@ zrb/config/default_prompt/interactive_system_prompt.md,sha256=XvXI51dMpQmuuYah_L
223
223
  zrb/config/default_prompt/persona.md,sha256=GfUJ4-Mlf_Bm1YTzxFNkPkdVbAi06ZDVYh-iIma3NOs,253
224
224
  zrb/config/default_prompt/repo_extractor_system_prompt.md,sha256=EGZ-zj78RlMEg2jduRBs8WzO4VJTkXHR96IpBepZMsY,3881
225
225
  zrb/config/default_prompt/repo_summarizer_system_prompt.md,sha256=RNy37Wg7ibXj3DlsFKaYvgMpMS-lyXlM1LZlc59_4ic,2009
226
- zrb/config/default_prompt/summarization_prompt.md,sha256=vbxzJGeH7uCdgnfbVt3GYOjY-BygmeRfJ6tnzXmFdoY,1698
226
+ zrb/config/default_prompt/summarization_prompt.md,sha256=qGSZJHQ0KVaSoeDVeAmvxaOHUGeLPaq813jepGqnkbk,1564
227
227
  zrb/config/default_prompt/system_prompt.md,sha256=gEb6N-cFg6VvOV-7ZffNwVt39DavAGesMqn9u0epbRc,2282
228
228
  zrb/config/llm_config.py,sha256=9I_msAibvTY-ADG6lXCBXQ0EshaA-GQzJym9EZKsetw,8901
229
229
  zrb/config/llm_context/config.py,sha256=TPQX_kU772r0AHmVFeo1WGLDAidacT-qDyuMWxY_avg,5878
@@ -346,7 +346,7 @@ zrb/task/base_trigger.py,sha256=WSGcmBcGAZw8EzUXfmCjqJQkz8GEmi1RzogpF6A1V4s,6902
346
346
  zrb/task/cmd_task.py,sha256=myM8WZm6NrUD-Wv0Vb5sTOrutrAVZLt5LVsSBKwX6SM,10860
347
347
  zrb/task/http_check.py,sha256=Gf5rOB2Se2EdizuN9rp65HpGmfZkGc-clIAlHmPVehs,2565
348
348
  zrb/task/llm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
349
- zrb/task/llm/agent.py,sha256=lN0kSpPmTweWAEptt4Pq7JYX9gne0hP5Jtw3iuUlrU8,8904
349
+ zrb/task/llm/agent.py,sha256=gi7JlUpNBHQ0WhlZcTgTaJQSNlkVYb999NUAWYttqt8,9194
350
350
  zrb/task/llm/config.py,sha256=zOPf4NpdWPuBc_R8d-kljYcOKfUAypDxiSjRDrxV66M,4059
351
351
  zrb/task/llm/conversation_history.py,sha256=oMdKUV2__mBZ4znnA-prl-gfyoleKC8Nj5KNpmLQJ4o,6764
352
352
  zrb/task/llm/conversation_history_model.py,sha256=kk-7niTl29Rm2EUIhTHzPXgZ5tp4IThMnIB3dS-1OdU,3062
@@ -354,8 +354,8 @@ zrb/task/llm/default_workflow/coding.md,sha256=2uythvPsnBpYfIhiIH1cCinQXX0i0yUqs
354
354
  zrb/task/llm/default_workflow/copywriting.md,sha256=xSO7GeDolwGxiuz6kXsK2GKGpwp8UgtG0yRqTmill_s,1999
355
355
  zrb/task/llm/default_workflow/researching.md,sha256=KD-aYHFHir6Ti-4FsBBtGwiI0seSVgleYbKJZi_POXA,2139
356
356
  zrb/task/llm/error.py,sha256=QR-nIohS6pBpC_16cWR-fw7Mevo1sNYAiXMBsh_CJDE,4157
357
- zrb/task/llm/history_summarization.py,sha256=UIT8bpdT3hy1xn559waDLFWZlNtIqdIpIvRGcZEpHm0,8057
358
- zrb/task/llm/history_summarization_tool.py,sha256=Wazi4WMr3k1WJ1v7QgjAPbuY1JdBpHUsTWGt3DSTsLc,1706
357
+ zrb/task/llm/history_summarization.py,sha256=blTKfaSpgaqvORWzGL3BKrRWAsfNdZB03oJTEOS-j5s,8098
358
+ zrb/task/llm/history_summarization_tool.py,sha256=RmYxWAxmBzhgwz9Cyu5aZ9so8r3zeAVhekEhqfhuTrY,1766
359
359
  zrb/task/llm/print_node.py,sha256=Nnf4F6eDJR4PFcOqQ1jLWBTFnzNGl1Stux2DZ3SMhsY,8062
360
360
  zrb/task/llm/prompt.py,sha256=FGXWYHecWtrNNkPnjg-uhnkqp7fYt8V91-AjFM_5fpA,11550
361
361
  zrb/task/llm/tool_wrapper.py,sha256=ifOP-smxHcDNpZvZMZm0XkKH49BicbyGTtpHNdcIA6Q,10241
@@ -410,7 +410,7 @@ zrb/util/todo_model.py,sha256=hhzAX-uFl5rsg7iVX1ULlJOfBtblwQ_ieNUxBWfc-Os,1670
410
410
  zrb/util/truncate.py,sha256=eSzmjBpc1Qod3lM3M73snNbDOcARHukW_tq36dWdPvc,921
411
411
  zrb/xcom/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
412
412
  zrb/xcom/xcom.py,sha256=o79rxR9wphnShrcIushA0Qt71d_p3ZTxjNf7x9hJB78,1571
413
- zrb-1.15.23.dist-info/METADATA,sha256=FHiMrHWdQFZ1pP6odLEBBlNkbYhvWe1NwXBuj668FRc,9892
414
- zrb-1.15.23.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
415
- zrb-1.15.23.dist-info/entry_points.txt,sha256=-Pg3ElWPfnaSM-XvXqCxEAa-wfVI6BEgcs386s8C8v8,46
416
- zrb-1.15.23.dist-info/RECORD,,
413
+ zrb-1.15.24.dist-info/METADATA,sha256=1AenVGPfxpku7IJv9cOpRvSLGpct09bH79HTU7hAkrI,9892
414
+ zrb-1.15.24.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
415
+ zrb-1.15.24.dist-info/entry_points.txt,sha256=-Pg3ElWPfnaSM-XvXqCxEAa-wfVI6BEgcs386s8C8v8,46
416
+ zrb-1.15.24.dist-info/RECORD,,
File without changes