zrb 1.15.22__py3-none-any.whl → 1.15.23__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/task/llm/agent.py CHANGED
@@ -199,7 +199,6 @@ async def _run_single_agent_iteration(
199
199
  ) as agent_run:
200
200
  async for node in agent_run:
201
201
  # Each node represents a step in the agent's execution
202
- # Reference: https://ai.pydantic.dev/agents/#streaming
203
202
  try:
204
203
  await print_node(
205
204
  _get_plain_printer(ctx), agent_run, node, log_indent_level
@@ -217,7 +216,7 @@ async def _run_single_agent_iteration(
217
216
 
218
217
 
219
218
  def _create_print_throttle_notif(ctx: AnyContext) -> Callable[[], None]:
220
- def _print_throttle_notif(ctx: AnyContext):
219
+ def _print_throttle_notif():
221
220
  ctx.print(stylize_faint(" ⌛>> Request Throttled"), plain=True)
222
221
 
223
222
  return _print_throttle_notif
@@ -28,7 +28,7 @@ async def print_node(
28
28
  elif Agent.is_model_request_node(node):
29
29
  # A model request node => We can stream tokens from the model's request
30
30
  print_func(_format_header("🧠 Processing...", log_indent_level))
31
- # Reference: https://ai.pydantic.dev/agents/#streaming
31
+ # Reference: https://ai.pydantic.dev/agents/#streaming-all-events-and-output
32
32
  try:
33
33
  async with node.stream(agent_run.ctx) as request_stream:
34
34
  is_streaming = False
@@ -40,9 +40,7 @@ async def print_node(
40
40
  print_func(_format_content(content, log_indent_level), end="")
41
41
  is_streaming = True
42
42
  elif isinstance(event, PartDeltaEvent):
43
- if isinstance(event.delta, TextPartDelta) or isinstance(
44
- event.delta, ThinkingPartDelta
45
- ):
43
+ if isinstance(event.delta, TextPartDelta):
46
44
  content_delta = event.delta.content_delta
47
45
  print_func(
48
46
  _format_stream_content(content_delta, log_indent_level),
@@ -78,7 +76,7 @@ async def print_node(
78
76
  print_func(
79
77
  _format_content(
80
78
  (
81
- f"⚠️ Unexpected Model Behavior: {e}. "
79
+ f"🟡 Unexpected Model Behavior: {e}. "
82
80
  f"Cause: {e.__cause__}. Node.Id: {meta}"
83
81
  ),
84
82
  log_indent_level,
@@ -112,7 +110,7 @@ async def print_node(
112
110
  print_func(
113
111
  _format_content(
114
112
  (
115
- f"⚠️ Unexpected Model Behavior: {e}. "
113
+ f"🟡 Unexpected Model Behavior: {e}. "
116
114
  f"Cause: {e.__cause__}. Node.Id: {meta}"
117
115
  ),
118
116
  log_indent_level,
@@ -123,7 +121,7 @@ async def print_node(
123
121
  print_func(_format_header("✅ Completed...", log_indent_level))
124
122
 
125
123
 
126
- def _format_header(text: str, log_indent_level: int = 0) -> str:
124
+ def _format_header(text: str | None, log_indent_level: int = 0) -> str:
127
125
  return _format(
128
126
  text,
129
127
  base_indent=2,
@@ -133,7 +131,7 @@ def _format_header(text: str, log_indent_level: int = 0) -> str:
133
131
  )
134
132
 
135
133
 
136
- def _format_content(text: str, log_indent_level: int = 0) -> str:
134
+ def _format_content(text: str | None, log_indent_level: int = 0) -> str:
137
135
  return _format(
138
136
  text,
139
137
  base_indent=2,
@@ -143,7 +141,7 @@ def _format_content(text: str, log_indent_level: int = 0) -> str:
143
141
  )
144
142
 
145
143
 
146
- def _format_stream_content(text: str, log_indent_level: int = 0) -> str:
144
+ def _format_stream_content(text: str | None, log_indent_level: int = 0) -> str:
147
145
  return _format(
148
146
  text,
149
147
  base_indent=2,
@@ -154,13 +152,15 @@ def _format_stream_content(text: str, log_indent_level: int = 0) -> str:
154
152
 
155
153
 
156
154
  def _format(
157
- text: str,
155
+ text: str | None,
158
156
  base_indent: int = 0,
159
157
  first_indent: int = 0,
160
158
  indent: int = 0,
161
159
  log_indent_level: int = 0,
162
160
  is_stream: bool = False,
163
161
  ) -> str:
162
+ if text is None:
163
+ text = ""
164
164
  line_prefix = (base_indent * (log_indent_level + 1) + indent) * " "
165
165
  processed_text = text.replace("\n", f"\n{line_prefix}")
166
166
  if is_stream:
@@ -220,7 +220,7 @@ def _get_user_approval_and_reason(
220
220
  def _get_run_func_confirmation(func: Callable) -> str:
221
221
  func_name = get_callable_name(func)
222
222
  return render_markdown(
223
- f"Allow to run `{func_name}`? (✅ `Yes` | ⛔ `No, <reason>` | ✏️ `Edit <param> <value>`)"
223
+ f"Allow to run `{func_name}`? (✅ `Yes` | ⛔ `No, <reason>` | 📝 `Edit <param> <value>`)"
224
224
  ).strip()
225
225
 
226
226
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: zrb
3
- Version: 1.15.22
3
+ Version: 1.15.23
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
@@ -29,7 +29,7 @@ Requires-Dist: pdfplumber (>=0.11.7,<0.12.0)
29
29
  Requires-Dist: playwright (>=1.54.0,<2.0.0) ; extra == "playwright" or extra == "all"
30
30
  Requires-Dist: prompt-toolkit (>=3)
31
31
  Requires-Dist: psutil (>=7.0.0,<8.0.0)
32
- Requires-Dist: pydantic-ai-slim[anthropic,bedrock,cohere,google,groq,huggingface,mistral,openai,vertexai] (>=0.8.1,<0.9.0)
32
+ Requires-Dist: pydantic-ai-slim[anthropic,bedrock,cohere,google,groq,huggingface,mistral,openai,vertexai] (>=1.0.1,<1.1.0)
33
33
  Requires-Dist: pyjwt (>=2.10.1,<3.0.0)
34
34
  Requires-Dist: python-dotenv (>=1.1.1,<2.0.0)
35
35
  Requires-Dist: python-jose[cryptography] (>=3.5.0,<4.0.0)
@@ -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=uI0X_injDrxq-IhYuZsAMdoq9AXy-gnipozGuZ72QIs,8990
349
+ zrb/task/llm/agent.py,sha256=lN0kSpPmTweWAEptt4Pq7JYX9gne0hP5Jtw3iuUlrU8,8904
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
@@ -356,9 +356,9 @@ zrb/task/llm/default_workflow/researching.md,sha256=KD-aYHFHir6Ti-4FsBBtGwiI0seS
356
356
  zrb/task/llm/error.py,sha256=QR-nIohS6pBpC_16cWR-fw7Mevo1sNYAiXMBsh_CJDE,4157
357
357
  zrb/task/llm/history_summarization.py,sha256=UIT8bpdT3hy1xn559waDLFWZlNtIqdIpIvRGcZEpHm0,8057
358
358
  zrb/task/llm/history_summarization_tool.py,sha256=Wazi4WMr3k1WJ1v7QgjAPbuY1JdBpHUsTWGt3DSTsLc,1706
359
- zrb/task/llm/print_node.py,sha256=TG8i3MrAkIj3cLkU9_fSX-u49jlTdU8t9FpHGI_VtoM,8077
359
+ zrb/task/llm/print_node.py,sha256=Nnf4F6eDJR4PFcOqQ1jLWBTFnzNGl1Stux2DZ3SMhsY,8062
360
360
  zrb/task/llm/prompt.py,sha256=FGXWYHecWtrNNkPnjg-uhnkqp7fYt8V91-AjFM_5fpA,11550
361
- zrb/task/llm/tool_wrapper.py,sha256=v3y4FO14xStpq9K0lA3GIVv6-3dbq85I7xZqdtG-j9U,10243
361
+ zrb/task/llm/tool_wrapper.py,sha256=ifOP-smxHcDNpZvZMZm0XkKH49BicbyGTtpHNdcIA6Q,10241
362
362
  zrb/task/llm/typing.py,sha256=c8VAuPBw_4A3DxfYdydkgedaP-LU61W9_wj3m3CAX1E,58
363
363
  zrb/task/llm_task.py,sha256=OxJ9QpqjEyeOI1_zqzNZHtQlRHi0ANOvL9FYaWLzO3Y,14913
364
364
  zrb/task/make_task.py,sha256=PD3b_aYazthS8LHeJsLAhwKDEgdurQZpymJDKeN60u0,2265
@@ -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.22.dist-info/METADATA,sha256=OHahYYqF0_2Z_Ht40qggq5Z538ITZNVtaC-UagYam6o,9892
414
- zrb-1.15.22.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
415
- zrb-1.15.22.dist-info/entry_points.txt,sha256=-Pg3ElWPfnaSM-XvXqCxEAa-wfVI6BEgcs386s8C8v8,46
416
- zrb-1.15.22.dist-info/RECORD,,
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,,
File without changes