agently 4.0.6.9__tar.gz → 4.0.6.10__tar.gz

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.
Files changed (76) hide show
  1. {agently-4.0.6.9 → agently-4.0.6.10}/PKG-INFO +1 -1
  2. {agently-4.0.6.9 → agently-4.0.6.10}/agently/builtins/hookers/SystemMessageHooker.py +51 -7
  3. {agently-4.0.6.9 → agently-4.0.6.10}/agently/builtins/plugins/ModelRequester/OpenAICompatible.py +4 -0
  4. {agently-4.0.6.9 → agently-4.0.6.10}/agently/builtins/plugins/PromptGenerator/AgentlyPromptGenerator.py +10 -4
  5. {agently-4.0.6.9 → agently-4.0.6.10}/agently/core/Agent.py +13 -0
  6. {agently-4.0.6.9 → agently-4.0.6.10}/agently/core/ModelRequest.py +9 -0
  7. {agently-4.0.6.9 → agently-4.0.6.10}/agently/core/TriggerFlow/Chunk.py +2 -2
  8. {agently-4.0.6.9 → agently-4.0.6.10}/agently/core/TriggerFlow/Execution.py +2 -2
  9. {agently-4.0.6.9 → agently-4.0.6.10}/agently/core/TriggerFlow/process/BaseProcess.py +40 -17
  10. {agently-4.0.6.9 → agently-4.0.6.10}/agently/core/TriggerFlow/process/ForEachProcess.py +3 -3
  11. {agently-4.0.6.9 → agently-4.0.6.10}/agently/core/TriggerFlow/process/MatchCaseProcess.py +6 -6
  12. {agently-4.0.6.9 → agently-4.0.6.10}/agently/types/trigger_flow/trigger_flow.py +6 -6
  13. {agently-4.0.6.9 → agently-4.0.6.10}/pyproject.toml +1 -1
  14. {agently-4.0.6.9 → agently-4.0.6.10}/LICENSE +0 -0
  15. {agently-4.0.6.9 → agently-4.0.6.10}/README.md +0 -0
  16. {agently-4.0.6.9 → agently-4.0.6.10}/agently/__init__.py +0 -0
  17. {agently-4.0.6.9 → agently-4.0.6.10}/agently/_default_init.py +0 -0
  18. {agently-4.0.6.9 → agently-4.0.6.10}/agently/_default_settings.yaml +0 -0
  19. {agently-4.0.6.9 → agently-4.0.6.10}/agently/base.py +0 -0
  20. {agently-4.0.6.9 → agently-4.0.6.10}/agently/builtins/agent_extensions/AutoFuncExtension.py +0 -0
  21. {agently-4.0.6.9 → agently-4.0.6.10}/agently/builtins/agent_extensions/ChatSessionExtension.py +0 -0
  22. {agently-4.0.6.9 → agently-4.0.6.10}/agently/builtins/agent_extensions/ConfigurePromptExtension.py +0 -0
  23. {agently-4.0.6.9 → agently-4.0.6.10}/agently/builtins/agent_extensions/KeyWaiterExtension.py +0 -0
  24. {agently-4.0.6.9 → agently-4.0.6.10}/agently/builtins/agent_extensions/ToolExtension.py +0 -0
  25. {agently-4.0.6.9 → agently-4.0.6.10}/agently/builtins/agent_extensions/__init__.py +0 -0
  26. {agently-4.0.6.9 → agently-4.0.6.10}/agently/builtins/hookers/ConsoleHooker.py +0 -0
  27. {agently-4.0.6.9 → agently-4.0.6.10}/agently/builtins/hookers/PureLoggerHooker.py +0 -0
  28. {agently-4.0.6.9 → agently-4.0.6.10}/agently/builtins/plugins/ResponseParser/AgentlyResponseParser.py +0 -0
  29. {agently-4.0.6.9 → agently-4.0.6.10}/agently/builtins/plugins/ToolManager/AgentlyToolManager.py +0 -0
  30. {agently-4.0.6.9 → agently-4.0.6.10}/agently/builtins/plugins/__init__.py +0 -0
  31. {agently-4.0.6.9 → agently-4.0.6.10}/agently/builtins/tools/Browse.py +0 -0
  32. {agently-4.0.6.9 → agently-4.0.6.10}/agently/builtins/tools/Search.py +0 -0
  33. {agently-4.0.6.9 → agently-4.0.6.10}/agently/builtins/tools/__init__.py +0 -0
  34. {agently-4.0.6.9 → agently-4.0.6.10}/agently/core/EventCenter.py +0 -0
  35. {agently-4.0.6.9 → agently-4.0.6.10}/agently/core/ExtensionHandlers.py +0 -0
  36. {agently-4.0.6.9 → agently-4.0.6.10}/agently/core/PluginManager.py +0 -0
  37. {agently-4.0.6.9 → agently-4.0.6.10}/agently/core/Prompt.py +0 -0
  38. {agently-4.0.6.9 → agently-4.0.6.10}/agently/core/Tool.py +0 -0
  39. {agently-4.0.6.9 → agently-4.0.6.10}/agently/core/TriggerFlow/BluePrint.py +0 -0
  40. {agently-4.0.6.9 → agently-4.0.6.10}/agently/core/TriggerFlow/Process.py +0 -0
  41. {agently-4.0.6.9 → agently-4.0.6.10}/agently/core/TriggerFlow/TriggerFlow.py +0 -0
  42. {agently-4.0.6.9 → agently-4.0.6.10}/agently/core/TriggerFlow/__init__.py +0 -0
  43. {agently-4.0.6.9 → agently-4.0.6.10}/agently/core/TriggerFlow/process/__init__.py +0 -0
  44. {agently-4.0.6.9 → agently-4.0.6.10}/agently/core/__init__.py +0 -0
  45. {agently-4.0.6.9 → agently-4.0.6.10}/agently/integrations/chromadb.py +0 -0
  46. {agently-4.0.6.9 → agently-4.0.6.10}/agently/types/__init__.py +0 -0
  47. {agently-4.0.6.9 → agently-4.0.6.10}/agently/types/data/__init__.py +0 -0
  48. {agently-4.0.6.9 → agently-4.0.6.10}/agently/types/data/event.py +0 -0
  49. {agently-4.0.6.9 → agently-4.0.6.10}/agently/types/data/prompt.py +0 -0
  50. {agently-4.0.6.9 → agently-4.0.6.10}/agently/types/data/request.py +0 -0
  51. {agently-4.0.6.9 → agently-4.0.6.10}/agently/types/data/response.py +0 -0
  52. {agently-4.0.6.9 → agently-4.0.6.10}/agently/types/data/serializable.py +0 -0
  53. {agently-4.0.6.9 → agently-4.0.6.10}/agently/types/data/tool.py +0 -0
  54. {agently-4.0.6.9 → agently-4.0.6.10}/agently/types/plugins/EventHooker.py +0 -0
  55. {agently-4.0.6.9 → agently-4.0.6.10}/agently/types/plugins/ModelRequester.py +0 -0
  56. {agently-4.0.6.9 → agently-4.0.6.10}/agently/types/plugins/PromptGenerator.py +0 -0
  57. {agently-4.0.6.9 → agently-4.0.6.10}/agently/types/plugins/ResponseParser.py +0 -0
  58. {agently-4.0.6.9 → agently-4.0.6.10}/agently/types/plugins/ToolManager.py +0 -0
  59. {agently-4.0.6.9 → agently-4.0.6.10}/agently/types/plugins/__init__.py +0 -0
  60. {agently-4.0.6.9 → agently-4.0.6.10}/agently/types/plugins/base.py +0 -0
  61. {agently-4.0.6.9 → agently-4.0.6.10}/agently/types/trigger_flow/__init__.py +0 -0
  62. {agently-4.0.6.9 → agently-4.0.6.10}/agently/utils/DataFormatter.py +0 -0
  63. {agently-4.0.6.9 → agently-4.0.6.10}/agently/utils/DataLocator.py +0 -0
  64. {agently-4.0.6.9 → agently-4.0.6.10}/agently/utils/DataPathBuilder.py +0 -0
  65. {agently-4.0.6.9 → agently-4.0.6.10}/agently/utils/FunctionShifter.py +0 -0
  66. {agently-4.0.6.9 → agently-4.0.6.10}/agently/utils/GeneratorConsumer.py +0 -0
  67. {agently-4.0.6.9 → agently-4.0.6.10}/agently/utils/LazyImport.py +0 -0
  68. {agently-4.0.6.9 → agently-4.0.6.10}/agently/utils/Logger.py +0 -0
  69. {agently-4.0.6.9 → agently-4.0.6.10}/agently/utils/Messenger.py +0 -0
  70. {agently-4.0.6.9 → agently-4.0.6.10}/agently/utils/RuntimeData.py +0 -0
  71. {agently-4.0.6.9 → agently-4.0.6.10}/agently/utils/SerializableRuntimeData.py +0 -0
  72. {agently-4.0.6.9 → agently-4.0.6.10}/agently/utils/Settings.py +0 -0
  73. {agently-4.0.6.9 → agently-4.0.6.10}/agently/utils/Storage.py +0 -0
  74. {agently-4.0.6.9 → agently-4.0.6.10}/agently/utils/StreamingJSONCompleter.py +0 -0
  75. {agently-4.0.6.9 → agently-4.0.6.10}/agently/utils/StreamingJSONParser.py +0 -0
  76. {agently-4.0.6.9 → agently-4.0.6.10}/agently/utils/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agently
3
- Version: 4.0.6.9
3
+ Version: 4.0.6.10
4
4
  Summary:
5
5
  License: Apache-2.0
6
6
  License-File: LICENSE
@@ -17,6 +17,32 @@ from typing import TYPE_CHECKING
17
17
 
18
18
  from agently.types.plugins import EventHooker
19
19
 
20
+ COLORS = {
21
+ "black": 30,
22
+ "red": 31,
23
+ "green": 32,
24
+ "yellow": 33,
25
+ "blue": 34,
26
+ "magenta": 35,
27
+ "cyan": 36,
28
+ "white": 37,
29
+ "gray": 90,
30
+ }
31
+
32
+
33
+ def color_text(text: str, color: str | None = None, bold: bool = False, underline: bool = False) -> str:
34
+ codes = []
35
+ if bold:
36
+ codes.append("1")
37
+ if underline:
38
+ codes.append("4")
39
+ if color and color in COLORS:
40
+ codes.append(str(COLORS[color]))
41
+ if not codes:
42
+ return text
43
+ return f"\x1b[{';'.join(codes)}m{text}\x1b[0m"
44
+
45
+
20
46
  if TYPE_CHECKING:
21
47
  from agently.types.data import EventMessage, AgentlySystemEvent
22
48
 
@@ -72,12 +98,18 @@ class SystemMessageHooker(EventHooker):
72
98
  and SystemMessageHooker._current_meta["row_id"] == message_data["response_id"]
73
99
  and SystemMessageHooker._current_meta["stage"] == content["stage"]
74
100
  ):
75
- print(content["detail"], end="")
101
+ print(color_text(content["detail"], color="gray"), end="", flush=True)
76
102
  else:
77
- print(
78
- f"[Agent-{ message_data['agent_name'] }] - [Request-{ message_data['response_id'] }]\nStage: { content['stage'] }\nDetail:\n{ content['detail'] }",
79
- end="",
103
+ header = color_text(
104
+ f"[Agent-{ message_data['agent_name'] }] - [Request-{ message_data['response_id'] }]",
105
+ color="blue",
106
+ bold=True,
80
107
  )
108
+ stage_label = color_text("Stage:", color="cyan", bold=True)
109
+ stage_val = color_text(content["stage"], color="yellow", underline=True)
110
+ detail_label = color_text("Detail:\n", color="cyan", bold=True)
111
+ detail = color_text(content["detail"], color="green")
112
+ print(f"{header}\n{stage_label} {stage_val}\n{detail_label}{detail}", end="")
81
113
  SystemMessageHooker._current_meta["table_name"] = message_data["agent_name"]
82
114
  SystemMessageHooker._current_meta["row_id"] = message_data["response_id"]
83
115
  SystemMessageHooker._current_meta["stage"] = content["stage"]
@@ -99,28 +131,40 @@ class SystemMessageHooker(EventHooker):
99
131
  },
100
132
  )
101
133
  if settings["runtime.show_model_logs"]:
134
+ header = color_text(
135
+ f"[Agent-{ message_data['agent_name'] }] - [Response-{ message_data['response_id'] }]",
136
+ color="blue",
137
+ bold=True,
138
+ )
139
+ stage_label = color_text("Stage:", color="cyan", bold=True)
140
+ stage_val = color_text(content["stage"], color="yellow", underline=True)
141
+ detail_label = color_text("Detail:\n", color="cyan", bold=True)
142
+ detail = color_text(f"{content['detail']}", color="gray")
102
143
  await event_center.async_emit(
103
144
  "log",
104
145
  {
105
146
  "level": "INFO",
106
- "content": f"[Agent-{ message_data['agent_name'] }] - [Response-{ message_data['response_id'] }]\nStage: { content['stage'] }\nDetail:\n{ content['detail'] }",
147
+ "content": f"{header}\n{stage_label} {stage_val}\n{detail_label}{detail}",
107
148
  },
108
149
  )
109
150
  case "TOOL":
110
151
  if settings["runtime.show_tool_logs"]:
152
+ tool_title = color_text("[Tool Using Result]:", color="blue", bold=True)
153
+ tool_body = color_text(str(message.content["data"]), color="gray")
111
154
  await event_center.async_emit(
112
155
  "log",
113
156
  {
114
157
  "level": "INFO",
115
- "content": f"[Tool Using Result]:\n{ message.content['data'] }",
158
+ "content": f"{tool_title}\n{tool_body}",
116
159
  },
117
160
  )
118
161
  case "TRIGGER_FLOW":
119
162
  if settings["runtime.show_trigger_flow_logs"]:
163
+ trigger = color_text(f"[TriggerFlow] { message.content['data'] }", color="yellow", bold=True)
120
164
  await event_center.async_emit(
121
165
  "log",
122
166
  {
123
167
  "level": "INFO",
124
- "content": f"[TriggerFlow] { message.content['data'] }",
168
+ "content": trigger,
125
169
  },
126
170
  )
@@ -146,6 +146,10 @@ class OpenAICompatible(ModelRequester):
146
146
  self.model_type = cast(str, self.plugin_settings.get("model_type"))
147
147
  self._messenger = event_center.create_messenger(self.name)
148
148
 
149
+ # check if has attachment prompt
150
+ if self.prompt["attachment"]:
151
+ self.plugin_settings["rich_content"] = True
152
+
149
153
  @staticmethod
150
154
  def _on_register():
151
155
  pass
@@ -725,10 +725,16 @@ class AgentlyPromptGenerator(PromptGenerator):
725
725
  "$type": output_prompt_part[0],
726
726
  }
727
727
  case _:
728
- return {
729
- "$type": output_prompt_part[0],
730
- "$desc": ";".join(output_prompt_part[1:]),
731
- }
728
+ desc_text = ";".join([item for item in output_prompt_part[1:] if item])
729
+ if desc_text:
730
+ return {
731
+ "$type": output_prompt_part[0],
732
+ "$desc": desc_text,
733
+ }
734
+ else:
735
+ return {
736
+ "$type": output_prompt_part[0],
737
+ }
732
738
  else:
733
739
  return list(output_prompt_part)
734
740
 
@@ -273,6 +273,19 @@ class BaseAgent:
273
273
  self.request.prompt.set("output", prompt, mappings)
274
274
  return self
275
275
 
276
+ def attachment(
277
+ self,
278
+ prompt: list[dict[str, Any]],
279
+ mappings: dict[str, Any] | None = None,
280
+ *,
281
+ always: bool = False,
282
+ ):
283
+ if always:
284
+ self.agent_prompt.set("attachment", prompt, mappings)
285
+ else:
286
+ self.request_prompt.set("attachment", prompt, mappings)
287
+ return self
288
+
276
289
  def options(
277
290
  self,
278
291
  options: dict[str, Any],
@@ -523,6 +523,15 @@ class ModelRequest:
523
523
  self.prompt.set("output", prompt, mappings)
524
524
  return self
525
525
 
526
+ def attachment(
527
+ self,
528
+ prompt: list[dict[str, Any]],
529
+ mappings: dict[str, Any] | None = None,
530
+ ):
531
+ self.prompt.set("attachment", prompt, mappings)
532
+ return self
533
+
534
+ # Response & Result
526
535
  def get_response(self):
527
536
  response = ModelResponse(
528
537
  self.agent_name,
@@ -36,10 +36,10 @@ class TriggerFlowChunk:
36
36
 
37
37
  async def async_call(self, data: "TriggerFlowEventData"):
38
38
  result = await FunctionShifter.asyncify(self._handler)(data)
39
- await data.async_emit(self.trigger, result, layer_marks=data.layer_marks.copy())
39
+ await data.async_emit(self.trigger, result, _layer_marks=data._layer_marks.copy())
40
40
  return result
41
41
 
42
42
  def call(self, data: "TriggerFlowEventData"):
43
43
  result = FunctionShifter.syncify(self._handler)(data)
44
- data.emit(self.trigger, result, layer_marks=data.layer_marks.copy())
44
+ data.emit(self.trigger, result, _layer_marks=data._layer_marks.copy())
45
45
  return result
@@ -97,7 +97,7 @@ class TriggerFlowExecution:
97
97
  self,
98
98
  trigger_event: str,
99
99
  value: Any = None,
100
- layer_marks: list[str] | None = None,
100
+ _layer_marks: list[str] | None = None,
101
101
  *,
102
102
  trigger_type: Literal["event", "runtime_data", "flow_data"] = "event",
103
103
  ):
@@ -134,7 +134,7 @@ class TriggerFlowExecution:
134
134
  trigger_type=trigger_type,
135
135
  value=value,
136
136
  execution=self,
137
- layer_marks=layer_marks,
137
+ _layer_marks=_layer_marks,
138
138
  )
139
139
  )
140
140
  )
@@ -178,7 +178,7 @@ class TriggerFlowBaseProcess:
178
178
  if mode == "simple_or"
179
179
  else (data.trigger_type, data.trigger_event, data.value)
180
180
  ),
181
- layer_marks=data.layer_marks.copy(),
181
+ _layer_marks=data._layer_marks.copy(),
182
182
  )
183
183
  case "and":
184
184
  if data.trigger_type in values and data.trigger_event in values[trigger_type]: # type: ignore
@@ -191,7 +191,7 @@ class TriggerFlowBaseProcess:
191
191
  await data.async_emit(
192
192
  when_trigger,
193
193
  values,
194
- layer_marks=data.layer_marks.copy(),
194
+ _layer_marks=data._layer_marks.copy(),
195
195
  )
196
196
 
197
197
  for trigger_type, trigger_event_dict in values.items():
@@ -213,15 +213,21 @@ class TriggerFlowBaseProcess:
213
213
 
214
214
  def to(
215
215
  self,
216
- chunk: "TriggerFlowChunk | TriggerFlowHandler | str",
216
+ chunk: "TriggerFlowChunk | TriggerFlowHandler | str | tuple[str, TriggerFlowHandler]",
217
217
  side_branch: bool = False,
218
+ name: str | None = None,
218
219
  ):
219
220
  if isinstance(chunk, str):
220
221
  if chunk in self._blue_print.chunks:
221
222
  chunk = self._blue_print.chunks[chunk]
222
223
  else:
223
224
  raise NotImplementedError(f"Cannot find chunk named '{ chunk }'")
224
- chunk = TriggerFlowChunk(chunk) if callable(chunk) else chunk
225
+ elif isinstance(chunk, tuple):
226
+ chunk_name = chunk[0]
227
+ chunk_func = chunk[1]
228
+ chunk = TriggerFlowChunk(chunk_func, name=chunk_name)
229
+ else:
230
+ chunk = TriggerFlowChunk(chunk, name=name) if callable(chunk) else chunk
225
231
  self._blue_print.add_handler(
226
232
  self.trigger_type,
227
233
  self.trigger_event,
@@ -235,34 +241,51 @@ class TriggerFlowBaseProcess:
235
241
  **self._options,
236
242
  )
237
243
 
238
- def side_branch(self, chunk: "TriggerFlowChunk | TriggerFlowHandler"):
239
- return self.to(chunk, side_branch=True)
244
+ def side_branch(
245
+ self,
246
+ chunk: "TriggerFlowChunk | TriggerFlowHandler",
247
+ *,
248
+ name: str | None = None,
249
+ ):
250
+ return self.to(
251
+ chunk,
252
+ side_branch=True,
253
+ name=name,
254
+ )
240
255
 
241
256
  def batch(
242
257
  self,
243
- *chunks: "TriggerFlowChunk | TriggerFlowHandler",
258
+ *chunks: "TriggerFlowChunk | TriggerFlowHandler | tuple[str, TriggerFlowHandler]",
244
259
  side_branch: bool = False,
245
260
  ):
246
261
  batch_trigger = f"Batch-{ uuid.uuid4().hex }"
247
262
  results = {}
248
- chunks_to_wait = {}
263
+ triggers_to_wait = {}
264
+ trigger_to_chunk_name = {}
249
265
 
250
266
  async def wait_all_chunks(data: "TriggerFlowEventData"):
251
- if data.event in chunks_to_wait:
252
- results[data.event] = data.value
253
- chunks_to_wait[data.event] = True
254
- for done in chunks_to_wait.values():
267
+ if data.event in triggers_to_wait:
268
+ results[trigger_to_chunk_name[data.event]] = data.value
269
+ triggers_to_wait[data.event] = True
270
+ for done in triggers_to_wait.values():
255
271
  if done is False:
256
272
  return
257
273
  await data.async_emit(
258
274
  batch_trigger,
259
275
  results,
260
- layer_marks=data.layer_marks.copy(),
276
+ _layer_marks=data._layer_marks.copy(),
261
277
  )
262
278
 
263
279
  for chunk in chunks:
264
- chunk = TriggerFlowChunk(chunk) if callable(chunk) else chunk
265
- chunks_to_wait[chunk.name] = False
280
+ if isinstance(chunk, tuple):
281
+ chunk_name = chunk[0]
282
+ chunk_func = chunk[1]
283
+ chunk = TriggerFlowChunk(chunk_func, name=chunk_name)
284
+ else:
285
+ chunk = TriggerFlowChunk(chunk) if callable(chunk) else chunk
286
+ triggers_to_wait[chunk.trigger] = False
287
+ trigger_to_chunk_name[chunk.trigger] = chunk.name
288
+ results[chunk.name] = None
266
289
  self._blue_print.add_handler(
267
290
  self.trigger_type,
268
291
  self.trigger_event,
@@ -299,13 +322,13 @@ class TriggerFlowBaseProcess:
299
322
  await data.async_emit(
300
323
  collect_trigger,
301
324
  self._block_data.global_data.get(f"collections.{ collection_name}"),
302
- layer_marks=data.layer_marks.copy(),
325
+ _layer_marks=data._layer_marks.copy(),
303
326
  )
304
327
  elif mode == "filled_then_empty":
305
328
  await data.async_emit(
306
329
  collect_trigger,
307
330
  self._block_data.global_data.get(f"collections.{ collection_name}"),
308
- layer_marks=data.layer_marks.copy(),
331
+ _layer_marks=data._layer_marks.copy(),
309
332
  )
310
333
  del self._block_data.global_data[f"collections.{ collection_name}"]
311
334
 
@@ -49,7 +49,7 @@ class TriggerFlowForEachProcess(TriggerFlowBaseProcess):
49
49
  data.async_emit(
50
50
  send_item_trigger,
51
51
  item,
52
- data.layer_marks.copy(),
52
+ data._layer_marks.copy(),
53
53
  )
54
54
  )
55
55
  data.layer_out()
@@ -62,7 +62,7 @@ class TriggerFlowForEachProcess(TriggerFlowBaseProcess):
62
62
  await data.async_emit(
63
63
  send_item_trigger,
64
64
  data.value,
65
- data.layer_marks.copy(),
65
+ data._layer_marks.copy(),
66
66
  )
67
67
  data.layer_out()
68
68
 
@@ -103,7 +103,7 @@ class TriggerFlowForEachProcess(TriggerFlowBaseProcess):
103
103
  await data.async_emit(
104
104
  end_for_each_trigger,
105
105
  list(for_each_results[for_each_instance_id].values()),
106
- data.layer_marks.copy(),
106
+ data._layer_marks.copy(),
107
107
  )
108
108
  for_each_results.delete(for_each_instance_id)
109
109
 
@@ -58,7 +58,7 @@ class TriggerFlowMatchCaseProcess(TriggerFlowBaseProcess):
58
58
  await data.async_emit(
59
59
  f"Match-{ match_id }-Case-{ case_id }",
60
60
  data.value,
61
- layer_marks=data.layer_marks.copy(),
61
+ _layer_marks=data._layer_marks.copy(),
62
62
  )
63
63
  return
64
64
  elif mode == "hit_all":
@@ -71,7 +71,7 @@ class TriggerFlowMatchCaseProcess(TriggerFlowBaseProcess):
71
71
  data.async_emit(
72
72
  f"Match-{ match_id }-Case-{ case_id }",
73
73
  data.value,
74
- layer_marks=data.layer_marks.copy(),
74
+ _layer_marks=data._layer_marks.copy(),
75
75
  )
76
76
  )
77
77
  data.layer_out()
@@ -81,13 +81,13 @@ class TriggerFlowMatchCaseProcess(TriggerFlowBaseProcess):
81
81
  await data.async_emit(
82
82
  f"Match-{ match_id }-Else",
83
83
  data.value,
84
- layer_marks=data.layer_marks.copy(),
84
+ _layer_marks=data._layer_marks.copy(),
85
85
  )
86
86
  else:
87
87
  await data.async_emit(
88
88
  f"Match-{ match_id }-Result",
89
89
  data.value,
90
- layer_marks=data.layer_marks.copy(),
90
+ _layer_marks=data._layer_marks.copy(),
91
91
  )
92
92
 
93
93
  self.to(match_case)
@@ -164,7 +164,7 @@ class TriggerFlowMatchCaseProcess(TriggerFlowBaseProcess):
164
164
  await data.async_emit(
165
165
  f"Match-{ match_id }-Result",
166
166
  list(match_results.values()),
167
- layer_marks=data.layer_marks.copy(),
167
+ _layer_marks=data._layer_marks.copy(),
168
168
  )
169
169
  del data._system_runtime_data[f"match_results.{ data.upper_layer_mark }"]
170
170
  else:
@@ -172,7 +172,7 @@ class TriggerFlowMatchCaseProcess(TriggerFlowBaseProcess):
172
172
  await data.async_emit(
173
173
  f"Match-{ match_id }-Result",
174
174
  data.value,
175
- layer_marks=data.layer_marks.copy(),
175
+ _layer_marks=data._layer_marks.copy(),
176
176
  )
177
177
 
178
178
  for trigger in branch_ends:
@@ -43,7 +43,7 @@ class TriggerFlowEventData:
43
43
  trigger_type: Literal["event", "runtime_data", "flow_data"],
44
44
  value: Any,
45
45
  execution: "TriggerFlowExecution",
46
- layer_marks: list[str] | None = None,
46
+ _layer_marks: list[str] | None = None,
47
47
  ):
48
48
  self.trigger_event = trigger_event
49
49
  self.trigger_type = trigger_type
@@ -51,7 +51,7 @@ class TriggerFlowEventData:
51
51
  self.type = trigger_type
52
52
  self.value = value
53
53
  self.execution_id = execution.id
54
- self.layer_marks = layer_marks if layer_marks is not None else []
54
+ self._layer_marks = _layer_marks if _layer_marks is not None else []
55
55
  self.settings = execution.settings
56
56
 
57
57
  self.get_flow_data = execution.get_flow_data
@@ -84,17 +84,17 @@ class TriggerFlowEventData:
84
84
 
85
85
  @property
86
86
  def upper_layer_mark(self):
87
- return self.layer_marks[-2] if len(self.layer_marks) > 1 else None
87
+ return self._layer_marks[-2] if len(self._layer_marks) > 1 else None
88
88
 
89
89
  @property
90
90
  def layer_mark(self):
91
- return self.layer_marks[-1] if len(self.layer_marks) > 0 else None
91
+ return self._layer_marks[-1] if len(self._layer_marks) > 0 else None
92
92
 
93
93
  def layer_in(self):
94
- self.layer_marks.append(uuid.uuid4().hex)
94
+ self._layer_marks.append(uuid.uuid4().hex)
95
95
 
96
96
  def layer_out(self):
97
- self.layer_marks = self.layer_marks[:-1] if len(self.layer_marks) > 0 else []
97
+ self._layer_marks = self._layer_marks[:-1] if len(self._layer_marks) > 0 else []
98
98
 
99
99
 
100
100
  TriggerFlowHandler = Callable[[TriggerFlowEventData], Any]
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "agently"
3
- version = "4.0.6.9"
3
+ version = "4.0.6.10"
4
4
  description = ""
5
5
  authors = [
6
6
  {name = "Agently Team",email = "developer@agently.tech"},
File without changes
File without changes
File without changes