langfun 0.1.2.dev202504180804__py3-none-any.whl → 0.1.2.dev202504190803__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.

Potentially problematic release.


This version of langfun might be problematic. Click here for more details.

@@ -199,6 +199,11 @@ class ExecutionTrace(pg.Object, pg.views.html.HtmlTreeView.Extension):
199
199
  """Returns all queries from current trace and its child execution items."""
200
200
  return self._all_child_items(lf_structured.QueryInvocation)
201
201
 
202
+ @property
203
+ def all_actions(self) -> list['ActionInvocation']:
204
+ """Returns all actions from current trace and its child execution items."""
205
+ return self._all_child_items(ActionInvocation)
206
+
202
207
  @property
203
208
  def all_logs(self) -> list[lf.logging.LogEntry]:
204
209
  """Returns all logs from current trace and its child execution items."""
@@ -221,7 +226,7 @@ class ExecutionTrace(pg.Object, pg.views.html.HtmlTreeView.Extension):
221
226
  for item in self.items:
222
227
  if isinstance(item, item_cls):
223
228
  child_items.append(item)
224
- elif isinstance(item, ActionInvocation):
229
+ if isinstance(item, ActionInvocation):
225
230
  child_items.extend(item.execution._all_child_items(item_cls)) # pylint: disable=protected-access
226
231
  elif isinstance(item, ExecutionTrace):
227
232
  child_items.extend(item._all_child_items(item_cls)) # pylint: disable=protected-access
@@ -582,6 +587,11 @@ class ActionInvocation(pg.Object, pg.views.html.HtmlTreeView.Extension):
582
587
  """Returns all queries made by the action and its child execution items."""
583
588
  return self.execution.all_queries
584
589
 
590
+ @property
591
+ def all_actions(self) -> list['ActionInvocation']:
592
+ """Returns all actions made by the action and its child execution items."""
593
+ return self.execution.all_actions
594
+
585
595
  @property
586
596
  def all_logs(self) -> list[lf.logging.LogEntry]:
587
597
  """Returns all logs made by the action and its child execution items."""
@@ -95,6 +95,8 @@ class SessionTest(unittest.TestCase):
95
95
  self.assertEqual(len(list(root.logs)), 0)
96
96
  # 1 query from Bar, 2 from Foo and 3 from parallel executions.
97
97
  self.assertEqual(len(list(root.all_queries)), 6)
98
+ # 2 actions: Foo and Bar.
99
+ self.assertEqual(len(list(root.all_actions)), 2)
98
100
  # 1 log from Bar and 1 from Foo.
99
101
  self.assertEqual(len(list(root.all_logs)), 2)
100
102
  self.assertEqual(root.usage_summary.total.num_requests, 6)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: langfun
3
- Version: 0.1.2.dev202504180804
3
+ Version: 0.1.2.dev202504190803
4
4
  Summary: Langfun: Language as Functions.
5
5
  Home-page: https://github.com/google/langfun
6
6
  Author: Langfun Authors
@@ -26,10 +26,10 @@ langfun/core/subscription_test.py,sha256=Y4ZdbZEwm83YNZBxHff0QR4QUa4rdaNXA3_jfIc
26
26
  langfun/core/template.py,sha256=jNhYSrbLIn9kZOa03w5QZbyjgfnzJzE_ZrrMvvWY4t4,24929
27
27
  langfun/core/template_test.py,sha256=g7x4mgNIAXEEj-4W1D5whGfl5YikLEQoylKPzaeDomk,17069
28
28
  langfun/core/agentic/__init__.py,sha256=qR3jlfUO4rhIoYdRDLz-d22YZf3FvU4FW88vsjiGDQQ,1224
29
- langfun/core/agentic/action.py,sha256=8o8UUPKZO2TdUGWU3QrJ4fmm4JdV-kH7G12JdrrYHZE,32744
29
+ langfun/core/agentic/action.py,sha256=AVc2aSZEvyblG_PRsri4kg5fnPrrnqjHU_sYB9EdR-o,33123
30
30
  langfun/core/agentic/action_eval.py,sha256=-ZcWt_eYqnTyOe9HFGyrLJkQRd4iG3hfN4IZ-NYAWwA,4534
31
31
  langfun/core/agentic/action_eval_test.py,sha256=tRUkWmOE9p0rpNOq19xAY2oDEnYsEEykjg6sUpAwJk0,2832
32
- langfun/core/agentic/action_test.py,sha256=e2INg-E7MaRNuN1qaSXLSnrjrsyVY3uSICiZpMuJr8c,5521
32
+ langfun/core/agentic/action_test.py,sha256=-QDP_U8hIZA2IYmaSDIWEvVjtyXMTq3S49onjLrsqJ8,5604
33
33
  langfun/core/coding/__init__.py,sha256=5utju_fwEsImaiftx4oXKl9FAM8p281k8-Esdh_-m1w,835
34
34
  langfun/core/coding/python/__init__.py,sha256=4ByknuoNU-mOIHwHKnTtmo6oD64oMFtlqPlYWmA5Wic,1736
35
35
  langfun/core/coding/python/correction.py,sha256=7zBedlhQKMPA4cfchUMxAOFl6Zl5RqCyllRHGWys40s,7092
@@ -156,8 +156,8 @@ langfun/core/templates/demonstration.py,sha256=vCrgYubdZM5Umqcgp8NUVGXgr4P_c-fik
156
156
  langfun/core/templates/demonstration_test.py,sha256=SafcDQ0WgI7pw05EmPI2S4v1t3ABKzup8jReCljHeK4,2162
157
157
  langfun/core/templates/selfplay.py,sha256=yhgrJbiYwq47TgzThmHrDQTF4nDrTI09CWGhuQPNv-s,2273
158
158
  langfun/core/templates/selfplay_test.py,sha256=Ot__1P1M8oJfoTp-M9-PQ6HUXqZKyMwvZ5f7yQ3yfyM,2326
159
- langfun-0.1.2.dev202504180804.dist-info/licenses/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
160
- langfun-0.1.2.dev202504180804.dist-info/METADATA,sha256=3olh4UsWwT8_aleiF-94tKmiiUkfTaSry6xnFBw-sQw,7692
161
- langfun-0.1.2.dev202504180804.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
162
- langfun-0.1.2.dev202504180804.dist-info/top_level.txt,sha256=RhlEkHxs1qtzmmtWSwYoLVJAc1YrbPtxQ52uh8Z9VvY,8
163
- langfun-0.1.2.dev202504180804.dist-info/RECORD,,
159
+ langfun-0.1.2.dev202504190803.dist-info/licenses/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
160
+ langfun-0.1.2.dev202504190803.dist-info/METADATA,sha256=Y9E3a9r77DSfmn698f83r8ElM9OmeeAcL-WSkUT2sTw,7692
161
+ langfun-0.1.2.dev202504190803.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
162
+ langfun-0.1.2.dev202504190803.dist-info/top_level.txt,sha256=RhlEkHxs1qtzmmtWSwYoLVJAc1YrbPtxQ52uh8Z9VvY,8
163
+ langfun-0.1.2.dev202504190803.dist-info/RECORD,,