zrb 1.15.13__py3-none-any.whl → 1.15.15__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.
@@ -98,7 +98,13 @@ def search_wikipedia(query: str) -> str:
98
98
  import requests
99
99
 
100
100
  params = {"action": "query", "list": "search", "srsearch": query, "format": "json"}
101
- response = requests.get("https://en.wikipedia.org/w/api.php", params=params)
101
+ response = requests.get(
102
+ "https://en.wikipedia.org/w/api.php",
103
+ headers={
104
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
105
+ },
106
+ params=params,
107
+ )
102
108
  return response.json()
103
109
 
104
110
 
@@ -123,7 +129,13 @@ def search_arxiv(query: str, num_results: int = 10) -> str:
123
129
  import requests
124
130
 
125
131
  params = {"search_query": f"all:{query}", "start": 0, "max_results": num_results}
126
- response = requests.get("http://export.arxiv.org/api/query", params=params)
132
+ response = requests.get(
133
+ "http://export.arxiv.org/api/query",
134
+ headers={
135
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
136
+ },
137
+ params=params,
138
+ )
127
139
  return response.content
128
140
 
129
141
 
@@ -1,17 +1,16 @@
1
- You are a memory management AI. Your goal is to curate the conversation history by calling the `update_conversation_memory` tool.
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**.
2
2
 
3
- Follow these steps precisely:
3
+ Follow these instructions carefully:
4
4
 
5
- **Step 1: Consolidate Conversation Information**
5
+ 1. **Summarize:** Create a concise narrative summary that integrates the `Past Conversation Summary` with the `Recent Conversation`. **This summary must not be more than two paragraphs.**
6
+ 2. **Transcript:** Extract ONLY the last 4 (four) turns of the `Recent Conversation` to serve as the new transcript.
7
+ * **Do not change or shorten the content of these turns, with one exception:** If a tool call returns a very long output, do not include the full output. Instead, briefly summarize the result of the tool call.
8
+ * Ensure the timestamp format is `[YYYY-MM-DD HH:MM:SS UTC+Z] Role: Message/Tool name being called`.
9
+ 3. **Notes:** Review the `Notes` and `Recent Conversation` to identify new or updated facts.
10
+ * Update `long_term_note` with global facts about the user.
11
+ * Update `contextual_note` with facts specific to the current project/directory.
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
+ * **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.
6
15
 
7
- 1. Create a concise narrative summary that integrates the `Past Conversation Summary` with the `Recent Conversation`.
8
- 2. Extract ONLY the last 4 (four) turns of the `Recent Conversation` to serve as the new transcript. Do not change or shorten the content of these turns. Ensure the timestamp format is `[YYYY-MM-DD HH:MM:SS UTC+Z] Role: Message/Tool name being called`.
9
- 3. Review the `Notes` and the `Recent Conversation` to identify any new or updated facts.
10
- * Update global facts about the user or their preferences for the `long_term_note`.
11
- * Update facts specific to the current project or directory for the `contextual_note`.
12
- * **CRITICAL:** When updating `contextual_note`, you MUST determine the correct `context_path` by analyzing the `Recent Conversation`. For example, if a fact was established when the working directory was `/app`, the `context_path` MUST be `/app`.
13
- * **CRITICAL:** The content for notes must be raw, unformatted text. Do not use Markdown. Notes should be timeless facts, not a log of events. Only update notes if the information has actually changed.
14
-
15
- **Step 2: Update Memory**
16
-
17
- 1. Call the `update_conversation_memory` tool ONCE, providing all the information you consolidated in Step 1 as arguments.
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.
zrb/task/llm/agent.py CHANGED
@@ -185,7 +185,7 @@ async def _run_single_agent_iteration(
185
185
  agent_payload = _estimate_request_payload(
186
186
  agent, user_prompt, attachments, history_list
187
187
  )
188
- callback = lambda: _print_throttle_notif(ctx)
188
+ callback = _create_print_throttle_notif(ctx)
189
189
  if rate_limitter:
190
190
  await rate_limitter.throttle(agent_payload, callback)
191
191
  else:
@@ -216,8 +216,11 @@ async def _run_single_agent_iteration(
216
216
  return agent_run
217
217
 
218
218
 
219
- def _print_throttle_notif(ctx: AnyContext):
220
- ctx.print(stylize_faint(" ⌛>> Request Throttled"), plain=True)
219
+ def _create_print_throttle_notif(ctx: AnyContext) -> Callable[[], None]:
220
+ def _print_throttle_notif(ctx: AnyContext):
221
+ ctx.print(stylize_faint(" ⌛>> Request Throttled"), plain=True)
222
+
223
+ return _print_throttle_notif
221
224
 
222
225
 
223
226
  def _estimate_request_payload(
@@ -48,6 +48,12 @@ async def print_node(
48
48
  _format_stream_content(content_delta, log_indent_level),
49
49
  end="",
50
50
  )
51
+ elif isinstance(event.delta, ThinkingPartDelta):
52
+ content_delta = event.delta.content_delta
53
+ print_func(
54
+ _format_stream_content(content_delta, log_indent_level),
55
+ end="",
56
+ )
51
57
  elif isinstance(event.delta, ToolCallPartDelta):
52
58
  args_delta = event.delta.args_delta
53
59
  print_func(
@@ -71,7 +77,10 @@ async def print_node(
71
77
  print_func("") # ensure newline consistency
72
78
  print_func(
73
79
  _format_content(
74
- f"⚠️ Unexpected Model Behavior: {e}. node_id={meta}",
80
+ (
81
+ f"⚠️ Unexpected Model Behavior: {e}. "
82
+ f"Cause: {e.__cause__}. Node.Id: {meta}"
83
+ ),
75
84
  log_indent_level,
76
85
  )
77
86
  )
@@ -102,7 +111,10 @@ async def print_node(
102
111
  print_func("") # ensure newline consistency
103
112
  print_func(
104
113
  _format_content(
105
- f"⚠️ Unexpected Model Behavior: {e}. node_id={meta}",
114
+ (
115
+ f"⚠️ Unexpected Model Behavior: {e}. "
116
+ f"Cause: {e.__cause__}. Node.Id: {meta}"
117
+ ),
106
118
  log_indent_level,
107
119
  )
108
120
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: zrb
3
- Version: 1.15.13
3
+ Version: 1.15.15
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
@@ -26,7 +26,7 @@ Requires-Dist: markdownify (>=1.2.0,<2.0.0)
26
26
  Requires-Dist: pdfplumber (>=0.11.7,<0.12.0)
27
27
  Requires-Dist: playwright (>=1.54.0,<2.0.0) ; extra == "playwright" or extra == "all"
28
28
  Requires-Dist: psutil (>=7.0.0,<8.0.0)
29
- Requires-Dist: pydantic-ai-slim[anthropic,bedrock,cli,cohere,google,groq,huggingface,mcp,mistral,openai,vertexai] (>=0.7.5,<0.8.0)
29
+ Requires-Dist: pydantic-ai-slim[anthropic,bedrock,cli,cohere,google,groq,huggingface,mcp,mistral,openai,vertexai] (>=0.8.0,<0.9.0)
30
30
  Requires-Dist: pyjwt (>=2.10.1,<3.0.0)
31
31
  Requires-Dist: python-dotenv (>=1.1.1,<2.0.0)
32
32
  Requires-Dist: python-jose[cryptography] (>=3.5.0,<4.0.0)
@@ -21,7 +21,7 @@ zrb/builtin/llm/tool/code.py,sha256=fr9FbmtfwizQTyTztvuvwAb9MD_auRZhPZfoJVBlKT4,
21
21
  zrb/builtin/llm/tool/file.py,sha256=eXFGGFxxpdpWGVw0svyQNQc03I5M7wotSsA_HjkXw7c,23670
22
22
  zrb/builtin/llm/tool/rag.py,sha256=Ab8_ZljnG_zfkwxPezImvorshuz3Fi4CmSzNOtU1a-g,9770
23
23
  zrb/builtin/llm/tool/sub_agent.py,sha256=dPqdFCXxJ-3hZnPjheZr-bPeKNbfSBSDKcZZR5vkWFM,5075
24
- zrb/builtin/llm/tool/web.py,sha256=zNQWDNOz_MyyzhncBeV5E_9XijQxTFVp6BSzz_e5tBI,7261
24
+ zrb/builtin/llm/tool/web.py,sha256=Hc9ikgBWZMgLB2O5lX-P9k8jvNSZeyUufqHXa_n_v4I,7653
25
25
  zrb/builtin/md5.py,sha256=690RV2LbW7wQeTFxY-lmmqTSVEEZv3XZbjEUW1Q3XpE,1480
26
26
  zrb/builtin/project/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
27
  zrb/builtin/project/add/fastapp/fastapp_input.py,sha256=MKlWR_LxWhM_DcULCtLfL_IjTxpDnDBkn9KIqNmajFs,310
@@ -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=GMqbw7mmDWQf7rhnJcJjXQFtGu7nVYIZfK6sStJ4coc,1472
226
+ zrb/config/default_prompt/summarization_prompt.md,sha256=vbxzJGeH7uCdgnfbVt3GYOjY-BygmeRfJ6tnzXmFdoY,1698
227
227
  zrb/config/default_prompt/system_prompt.md,sha256=gEb6N-cFg6VvOV-7ZffNwVt39DavAGesMqn9u0epbRc,2282
228
228
  zrb/config/llm_config.py,sha256=xt-Xf8ZuNoUT_GKCSFz5yy0BhbeHzxP-jrezB06WeiY,8857
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=jfC90N8oER2z-fTmPEuWH3ASPgw5t8cZm8rk98HBBlw,8876
349
+ zrb/task/llm/agent.py,sha256=-DVECvW3nLQNmppkD9DStG6L_VUaUUAJb2iMmd-JB90,8990
350
350
  zrb/task/llm/config.py,sha256=n1SPmwab09K2i1sL_OCwrEOWHI0Owx_hvWelg3Dreus,3781
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,7 +356,7 @@ 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=fNTL0LtoZBQQPHYCAUaOFP97nNNfobPXvY2RlxewQCE,7556
359
+ zrb/task/llm/print_node.py,sha256=si619OvCUZJYTUSUpoOqVAgLSu1BGw-dlBq02MSD7FE,8096
360
360
  zrb/task/llm/prompt.py,sha256=FGXWYHecWtrNNkPnjg-uhnkqp7fYt8V91-AjFM_5fpA,11550
361
361
  zrb/task/llm/tool_wrapper.py,sha256=IavXwW9C0ojI3ivGDY8j7XbMJE_NTJeI86TVbHNRwJ0,9684
362
362
  zrb/task/llm/typing.py,sha256=c8VAuPBw_4A3DxfYdydkgedaP-LU61W9_wj3m3CAX1E,58
@@ -409,7 +409,7 @@ zrb/util/todo_model.py,sha256=hhzAX-uFl5rsg7iVX1ULlJOfBtblwQ_ieNUxBWfc-Os,1670
409
409
  zrb/util/truncate.py,sha256=eSzmjBpc1Qod3lM3M73snNbDOcARHukW_tq36dWdPvc,921
410
410
  zrb/xcom/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
411
411
  zrb/xcom/xcom.py,sha256=o79rxR9wphnShrcIushA0Qt71d_p3ZTxjNf7x9hJB78,1571
412
- zrb-1.15.13.dist-info/METADATA,sha256=lDKm2YdMNhKPRFayict53Twk3Bd_nnQExw7tZFqWe5c,9775
413
- zrb-1.15.13.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
414
- zrb-1.15.13.dist-info/entry_points.txt,sha256=-Pg3ElWPfnaSM-XvXqCxEAa-wfVI6BEgcs386s8C8v8,46
415
- zrb-1.15.13.dist-info/RECORD,,
412
+ zrb-1.15.15.dist-info/METADATA,sha256=VWZ52YsfHRjEU0_qygR3DMqufPQWd_rWaNqFabU7EDo,9775
413
+ zrb-1.15.15.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
414
+ zrb-1.15.15.dist-info/entry_points.txt,sha256=-Pg3ElWPfnaSM-XvXqCxEAa-wfVI6BEgcs386s8C8v8,46
415
+ zrb-1.15.15.dist-info/RECORD,,
File without changes