erdo 0.1.31__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.
Files changed (48) hide show
  1. erdo/__init__.py +35 -0
  2. erdo/_generated/__init__.py +18 -0
  3. erdo/_generated/actions/__init__.py +34 -0
  4. erdo/_generated/actions/analysis.py +179 -0
  5. erdo/_generated/actions/bot.py +186 -0
  6. erdo/_generated/actions/codeexec.py +199 -0
  7. erdo/_generated/actions/llm.py +148 -0
  8. erdo/_generated/actions/memory.py +463 -0
  9. erdo/_generated/actions/pdfextractor.py +97 -0
  10. erdo/_generated/actions/resource_definitions.py +296 -0
  11. erdo/_generated/actions/sqlexec.py +90 -0
  12. erdo/_generated/actions/utils.py +475 -0
  13. erdo/_generated/actions/webparser.py +119 -0
  14. erdo/_generated/actions/websearch.py +85 -0
  15. erdo/_generated/condition/__init__.py +556 -0
  16. erdo/_generated/internal.py +51 -0
  17. erdo/_generated/internal_actions.py +91 -0
  18. erdo/_generated/parameters.py +17 -0
  19. erdo/_generated/secrets.py +17 -0
  20. erdo/_generated/template_functions.py +55 -0
  21. erdo/_generated/types.py +3907 -0
  22. erdo/actions/__init__.py +40 -0
  23. erdo/bot_permissions.py +266 -0
  24. erdo/cli_entry.py +73 -0
  25. erdo/conditions/__init__.py +11 -0
  26. erdo/config/__init__.py +5 -0
  27. erdo/config/config.py +140 -0
  28. erdo/formatting.py +279 -0
  29. erdo/install_cli.py +140 -0
  30. erdo/integrations.py +131 -0
  31. erdo/invoke/__init__.py +11 -0
  32. erdo/invoke/client.py +234 -0
  33. erdo/invoke/invoke.py +555 -0
  34. erdo/state.py +376 -0
  35. erdo/sync/__init__.py +17 -0
  36. erdo/sync/client.py +95 -0
  37. erdo/sync/extractor.py +492 -0
  38. erdo/sync/sync.py +327 -0
  39. erdo/template.py +136 -0
  40. erdo/test/__init__.py +41 -0
  41. erdo/test/evaluate.py +272 -0
  42. erdo/test/runner.py +263 -0
  43. erdo/types.py +1431 -0
  44. erdo-0.1.31.dist-info/METADATA +471 -0
  45. erdo-0.1.31.dist-info/RECORD +48 -0
  46. erdo-0.1.31.dist-info/WHEEL +4 -0
  47. erdo-0.1.31.dist-info/entry_points.txt +2 -0
  48. erdo-0.1.31.dist-info/licenses/LICENSE +22 -0
@@ -0,0 +1,556 @@
1
+ # DO NOT EDIT THIS FILE MANUALLY - it will be overwritten.
2
+ # Generated by: erdo gen-client
3
+ """
4
+ Condition classes auto-generated from Go condition types.
5
+
6
+ These classes provide type-safe condition definitions that match
7
+ the backend condition system exactly.
8
+ """
9
+
10
+ from typing import TYPE_CHECKING, Any, Dict, List, Union
11
+
12
+ if TYPE_CHECKING:
13
+ # Forward reference for condition types
14
+ Condition = Union[
15
+ "_BaseCondition", "_AndCondition", "_OrCondition", "_NotCondition"
16
+ ]
17
+
18
+
19
+ # Composite condition functions (matching Go pattern)
20
+ class _AndCondition:
21
+ def __init__(self, *conditions: Any) -> None:
22
+ self.conditions = list(conditions)
23
+
24
+ def to_dict(self) -> Dict[str, Any]:
25
+ """Convert to dict format expected by backend."""
26
+ return {
27
+ "type": "And",
28
+ "conditions": [
29
+ c.to_dict() if hasattr(c, "to_dict") else c for c in self.conditions
30
+ ],
31
+ }
32
+
33
+ def __and__(self, other: Any) -> "_AndCondition":
34
+ """Support & operator for chaining AND conditions."""
35
+ if isinstance(other, _AndCondition):
36
+ return _AndCondition(*(self.conditions + other.conditions))
37
+ return _AndCondition(*(self.conditions + [other]))
38
+
39
+ def __or__(self, other: Any) -> "_OrCondition":
40
+ """Support | operator for OR conditions."""
41
+ return _OrCondition(self, other)
42
+
43
+ def __invert__(self) -> "_NotCondition":
44
+ """Support ~ operator for NOT conditions."""
45
+ return _NotCondition(self)
46
+
47
+
48
+ class _OrCondition:
49
+ def __init__(self, *conditions: Any) -> None:
50
+ self.conditions = list(conditions)
51
+
52
+ def to_dict(self) -> Dict[str, Any]:
53
+ """Convert to dict format expected by backend."""
54
+ return {
55
+ "type": "Or",
56
+ "conditions": [
57
+ c.to_dict() if hasattr(c, "to_dict") else c for c in self.conditions
58
+ ],
59
+ }
60
+
61
+ def __and__(self, other: Any) -> "_AndCondition":
62
+ """Support & operator for AND conditions."""
63
+ return _AndCondition(self, other)
64
+
65
+ def __or__(self, other: Any) -> "_OrCondition":
66
+ """Support | operator for chaining OR conditions."""
67
+ if isinstance(other, _OrCondition):
68
+ return _OrCondition(*(self.conditions + other.conditions))
69
+ return _OrCondition(*(self.conditions + [other]))
70
+
71
+ def __invert__(self) -> "_NotCondition":
72
+ """Support ~ operator for NOT conditions."""
73
+ return _NotCondition(self)
74
+
75
+
76
+ class _NotCondition:
77
+ def __init__(self, condition: Any) -> None:
78
+ self.condition = condition
79
+
80
+ def to_dict(self) -> Dict[str, Any]:
81
+ """Convert to dict format expected by backend."""
82
+ return {
83
+ "type": "Not",
84
+ "conditions": (
85
+ self.condition.to_dict()
86
+ if hasattr(self.condition, "to_dict")
87
+ else self.condition
88
+ ),
89
+ }
90
+
91
+ def __and__(self, other: Any) -> "_AndCondition":
92
+ """Support & operator for AND conditions."""
93
+ return _AndCondition(self, other)
94
+
95
+ def __or__(self, other: Any) -> "_OrCondition":
96
+ """Support | operator for OR conditions."""
97
+ return _OrCondition(self, other)
98
+
99
+ def __invert__(self) -> Any:
100
+ """Support ~ operator for double negation (returns original condition)."""
101
+ return self.condition
102
+
103
+
104
+ def And(*conditions: "Condition") -> _AndCondition:
105
+ """Create an AND condition from multiple conditions"""
106
+ return _AndCondition(*conditions)
107
+
108
+
109
+ def Or(*conditions: "Condition") -> _OrCondition:
110
+ """Create an OR condition from multiple conditions"""
111
+ return _OrCondition(*conditions)
112
+
113
+
114
+ def Not(condition: "Condition") -> _NotCondition:
115
+ """Create a NOT condition from a single condition"""
116
+ return _NotCondition(condition)
117
+
118
+
119
+ # Base class for leaf conditions to support operators
120
+ class _BaseCondition:
121
+ """Base class for all leaf conditions to support operator overloading."""
122
+
123
+ def __and__(self, other: Any) -> "_AndCondition":
124
+ """Support & operator for AND conditions."""
125
+ return _AndCondition(self, other)
126
+
127
+ def __or__(self, other: Any) -> "_OrCondition":
128
+ """Support | operator for OR conditions."""
129
+ return _OrCondition(self, other)
130
+
131
+ def __invert__(self) -> "_NotCondition":
132
+ """Support ~ operator for NOT conditions."""
133
+ return _NotCondition(self)
134
+
135
+
136
+ class AndCondition(_BaseCondition):
137
+ def __init__(self, conditions: Any = None) -> None:
138
+ self.conditions = conditions
139
+
140
+ def to_dict(self) -> Dict[str, Any]:
141
+ """Convert to dict format expected by backend."""
142
+ result: Dict[str, Any] = {}
143
+ result["type"] = "AndCondition"
144
+
145
+ # Add field values to leaf object (backend expects leaf format)
146
+ leaf: Dict[str, Any] = {}
147
+ if self.conditions is not None:
148
+ leaf["conditions"] = self.conditions
149
+
150
+ if leaf:
151
+ result["leaf"] = leaf
152
+
153
+ return result
154
+
155
+
156
+ class EarlierThan(_BaseCondition):
157
+ def __init__(self, time: Any = None, value: Any = None) -> None:
158
+ self.time = time
159
+ self.value = value
160
+
161
+ def to_dict(self) -> Dict[str, Any]:
162
+ """Convert to dict format expected by backend."""
163
+ result: Dict[str, Any] = {}
164
+ result["type"] = "EarlierThan"
165
+
166
+ # Add field values to leaf object (backend expects leaf format)
167
+ leaf: Dict[str, Any] = {}
168
+ if self.time is not None:
169
+ leaf["time"] = self.time
170
+ if self.value is not None:
171
+ leaf["value"] = self.value
172
+
173
+ if leaf:
174
+ result["leaf"] = leaf
175
+
176
+ return result
177
+
178
+
179
+ class FalseCondition(_BaseCondition):
180
+ def __init__(self) -> None:
181
+ pass
182
+
183
+ def to_dict(self) -> Dict[str, Any]:
184
+ """Convert to dict format expected by backend."""
185
+ return {"type": "FalseCondition", "leaf": {}}
186
+
187
+
188
+ class GreaterThan(_BaseCondition):
189
+ def __init__(self, number: Any = None, value: Any = None) -> None:
190
+ self.number = number
191
+ self.value = value
192
+
193
+ def to_dict(self) -> Dict[str, Any]:
194
+ """Convert to dict format expected by backend."""
195
+ result: Dict[str, Any] = {}
196
+ result["type"] = "GreaterThan"
197
+
198
+ # Add field values to leaf object (backend expects leaf format)
199
+ leaf: Dict[str, Any] = {}
200
+ if self.number is not None:
201
+ leaf["number"] = self.number
202
+ if self.value is not None:
203
+ leaf["value"] = self.value
204
+
205
+ if leaf:
206
+ result["leaf"] = leaf
207
+
208
+ return result
209
+
210
+
211
+ class IsAny(_BaseCondition):
212
+ def __init__(self, key: Any = None, value: Any = None) -> None:
213
+ self.key = key
214
+ self.value = value
215
+
216
+ def to_dict(self) -> Dict[str, Any]:
217
+ """Convert to dict format expected by backend."""
218
+ result: Dict[str, Any] = {}
219
+ result["type"] = "IsAny"
220
+
221
+ # Add field values to leaf object (backend expects leaf format)
222
+ leaf: Dict[str, Any] = {}
223
+ if self.key is not None:
224
+ leaf["key"] = self.key
225
+ if self.value is not None:
226
+ leaf["value"] = self.value
227
+
228
+ if leaf:
229
+ result["leaf"] = leaf
230
+
231
+ return result
232
+
233
+
234
+ class IsError(_BaseCondition):
235
+ def __init__(self) -> None:
236
+ pass
237
+
238
+ def to_dict(self) -> Dict[str, Any]:
239
+ """Convert to dict format expected by backend."""
240
+ return {"type": "IsError", "leaf": {}}
241
+
242
+
243
+ class IsErrorActionNotFound(_BaseCondition):
244
+ def __init__(self) -> None:
245
+ pass
246
+
247
+ def to_dict(self) -> Dict[str, Any]:
248
+ """Convert to dict format expected by backend."""
249
+ return {"type": "IsErrorActionNotFound", "leaf": {}}
250
+
251
+
252
+ class IsErrorInfoNeeded(_BaseCondition):
253
+ def __init__(self) -> None:
254
+ pass
255
+
256
+ def to_dict(self) -> Dict[str, Any]:
257
+ """Convert to dict format expected by backend."""
258
+ return {"type": "IsErrorInfoNeeded", "leaf": {}}
259
+
260
+
261
+ class IsErrorInternalError(_BaseCondition):
262
+ def __init__(self) -> None:
263
+ pass
264
+
265
+ def to_dict(self) -> Dict[str, Any]:
266
+ """Convert to dict format expected by backend."""
267
+ return {"type": "IsErrorInternalError", "leaf": {}}
268
+
269
+
270
+ class IsErrorTerminated(_BaseCondition):
271
+ def __init__(self) -> None:
272
+ pass
273
+
274
+ def to_dict(self) -> Dict[str, Any]:
275
+ """Convert to dict format expected by backend."""
276
+ return {"type": "IsErrorTerminated", "leaf": {}}
277
+
278
+
279
+ class IsErrorTimeout(_BaseCondition):
280
+ def __init__(self) -> None:
281
+ pass
282
+
283
+ def to_dict(self) -> Dict[str, Any]:
284
+ """Convert to dict format expected by backend."""
285
+ return {"type": "IsErrorTimeout", "leaf": {}}
286
+
287
+
288
+ class IsFalsey(_BaseCondition):
289
+ def __init__(self, text: Any = None) -> None:
290
+ self.text = text
291
+
292
+ def to_dict(self) -> Dict[str, Any]:
293
+ """Convert to dict format expected by backend."""
294
+ result: Dict[str, Any] = {}
295
+ result["type"] = "IsFalsey"
296
+
297
+ # Add field values to leaf object (backend expects leaf format)
298
+ leaf: Dict[str, Any] = {}
299
+ if self.text is not None:
300
+ leaf["text"] = self.text
301
+
302
+ if leaf:
303
+ result["leaf"] = leaf
304
+
305
+ return result
306
+
307
+
308
+ class IsFormattedError(_BaseCondition):
309
+ def __init__(self) -> None:
310
+ pass
311
+
312
+ def to_dict(self) -> Dict[str, Any]:
313
+ """Convert to dict format expected by backend."""
314
+ return {"type": "IsFormattedError", "leaf": {}}
315
+
316
+
317
+ class IsNull(_BaseCondition):
318
+ def __init__(self, key: Any = None) -> None:
319
+ self.key = key
320
+
321
+ def to_dict(self) -> Dict[str, Any]:
322
+ """Convert to dict format expected by backend."""
323
+ result: Dict[str, Any] = {}
324
+ result["type"] = "IsNull"
325
+
326
+ # Add field values to leaf object (backend expects leaf format)
327
+ leaf: Dict[str, Any] = {}
328
+ if self.key is not None:
329
+ leaf["key"] = self.key
330
+
331
+ if leaf:
332
+ result["leaf"] = leaf
333
+
334
+ return result
335
+
336
+
337
+ class IsSuccess(_BaseCondition):
338
+ def __init__(self) -> None:
339
+ pass
340
+
341
+ def to_dict(self) -> Dict[str, Any]:
342
+ """Convert to dict format expected by backend."""
343
+ return {"type": "IsSuccess", "leaf": {}}
344
+
345
+
346
+ class IsTruthy(_BaseCondition):
347
+ def __init__(self, text: Any = None) -> None:
348
+ self.text = text
349
+
350
+ def to_dict(self) -> Dict[str, Any]:
351
+ """Convert to dict format expected by backend."""
352
+ result: Dict[str, Any] = {}
353
+ result["type"] = "IsTruthy"
354
+
355
+ # Add field values to leaf object (backend expects leaf format)
356
+ leaf: Dict[str, Any] = {}
357
+ if self.text is not None:
358
+ leaf["text"] = self.text
359
+
360
+ if leaf:
361
+ result["leaf"] = leaf
362
+
363
+ return result
364
+
365
+
366
+ class LessThan(_BaseCondition):
367
+ def __init__(self, number: Any = None, value: Any = None) -> None:
368
+ self.number = number
369
+ self.value = value
370
+
371
+ def to_dict(self) -> Dict[str, Any]:
372
+ """Convert to dict format expected by backend."""
373
+ result: Dict[str, Any] = {}
374
+ result["type"] = "LessThan"
375
+
376
+ # Add field values to leaf object (backend expects leaf format)
377
+ leaf: Dict[str, Any] = {}
378
+ if self.number is not None:
379
+ leaf["number"] = self.number
380
+ if self.value is not None:
381
+ leaf["value"] = self.value
382
+
383
+ if leaf:
384
+ result["leaf"] = leaf
385
+
386
+ return result
387
+
388
+
389
+ class NotCondition(_BaseCondition):
390
+ def __init__(self, condition: Any = None) -> None:
391
+ self.condition = condition
392
+
393
+ def to_dict(self) -> Dict[str, Any]:
394
+ """Convert to dict format expected by backend."""
395
+ result: Dict[str, Any] = {}
396
+ result["type"] = "NotCondition"
397
+
398
+ # Add field values to leaf object (backend expects leaf format)
399
+ leaf: Dict[str, Any] = {}
400
+ if self.condition is not None:
401
+ leaf["condition"] = self.condition
402
+
403
+ if leaf:
404
+ result["leaf"] = leaf
405
+
406
+ return result
407
+
408
+
409
+ class OrCondition(_BaseCondition):
410
+ def __init__(self, conditions: Any = None) -> None:
411
+ self.conditions = conditions
412
+
413
+ def to_dict(self) -> Dict[str, Any]:
414
+ """Convert to dict format expected by backend."""
415
+ result: Dict[str, Any] = {}
416
+ result["type"] = "OrCondition"
417
+
418
+ # Add field values to leaf object (backend expects leaf format)
419
+ leaf: Dict[str, Any] = {}
420
+ if self.conditions is not None:
421
+ leaf["conditions"] = self.conditions
422
+
423
+ if leaf:
424
+ result["leaf"] = leaf
425
+
426
+ return result
427
+
428
+
429
+ class TextContains(_BaseCondition):
430
+ def __init__(self, text: Any = None, value: Any = None) -> None:
431
+ self.text = text
432
+ self.value = value
433
+
434
+ def to_dict(self) -> Dict[str, Any]:
435
+ """Convert to dict format expected by backend."""
436
+ result: Dict[str, Any] = {}
437
+ result["type"] = "TextContains"
438
+
439
+ # Add field values to leaf object (backend expects leaf format)
440
+ leaf: Dict[str, Any] = {}
441
+ if self.text is not None:
442
+ leaf["text"] = self.text
443
+ if self.value is not None:
444
+ leaf["value"] = self.value
445
+
446
+ if leaf:
447
+ result["leaf"] = leaf
448
+
449
+ return result
450
+
451
+
452
+ class TextEndsWith(_BaseCondition):
453
+ def __init__(self, text: Any = None, value: Any = None) -> None:
454
+ self.text = text
455
+ self.value = value
456
+
457
+ def to_dict(self) -> Dict[str, Any]:
458
+ """Convert to dict format expected by backend."""
459
+ result: Dict[str, Any] = {}
460
+ result["type"] = "TextEndsWith"
461
+
462
+ # Add field values to leaf object (backend expects leaf format)
463
+ leaf: Dict[str, Any] = {}
464
+ if self.text is not None:
465
+ leaf["text"] = self.text
466
+ if self.value is not None:
467
+ leaf["value"] = self.value
468
+
469
+ if leaf:
470
+ result["leaf"] = leaf
471
+
472
+ return result
473
+
474
+
475
+ class TextEquals(_BaseCondition):
476
+ def __init__(self, text: Any = None, value: Any = None) -> None:
477
+ self.text = text
478
+ self.value = value
479
+
480
+ def to_dict(self) -> Dict[str, Any]:
481
+ """Convert to dict format expected by backend."""
482
+ result: Dict[str, Any] = {}
483
+ result["type"] = "TextEquals"
484
+
485
+ # Add field values to leaf object (backend expects leaf format)
486
+ leaf: Dict[str, Any] = {}
487
+ if self.text is not None:
488
+ leaf["text"] = self.text
489
+ if self.value is not None:
490
+ leaf["value"] = self.value
491
+
492
+ if leaf:
493
+ result["leaf"] = leaf
494
+
495
+ return result
496
+
497
+
498
+ class TextStartsWith(_BaseCondition):
499
+ def __init__(self, text: Any = None, value: Any = None) -> None:
500
+ self.text = text
501
+ self.value = value
502
+
503
+ def to_dict(self) -> Dict[str, Any]:
504
+ """Convert to dict format expected by backend."""
505
+ result: Dict[str, Any] = {}
506
+ result["type"] = "TextStartsWith"
507
+
508
+ # Add field values to leaf object (backend expects leaf format)
509
+ leaf: Dict[str, Any] = {}
510
+ if self.text is not None:
511
+ leaf["text"] = self.text
512
+ if self.value is not None:
513
+ leaf["value"] = self.value
514
+
515
+ if leaf:
516
+ result["leaf"] = leaf
517
+
518
+ return result
519
+
520
+
521
+ class TrueCondition(_BaseCondition):
522
+ def __init__(self) -> None:
523
+ pass
524
+
525
+ def to_dict(self) -> Dict[str, Any]:
526
+ """Convert to dict format expected by backend."""
527
+ return {"type": "TrueCondition", "leaf": {}}
528
+
529
+
530
+ # Auto-generated __all__ list for import *
531
+ __all__ = [
532
+ "And",
533
+ "Not",
534
+ "Or",
535
+ "EarlierThan",
536
+ "FalseCondition",
537
+ "GreaterThan",
538
+ "IsAny",
539
+ "IsError",
540
+ "IsErrorActionNotFound",
541
+ "IsErrorInfoNeeded",
542
+ "IsErrorInternalError",
543
+ "IsErrorTerminated",
544
+ "IsErrorTimeout",
545
+ "IsFalsey",
546
+ "IsFormattedError",
547
+ "IsNull",
548
+ "IsSuccess",
549
+ "IsTruthy",
550
+ "LessThan",
551
+ "TextContains",
552
+ "TextEndsWith",
553
+ "TextEquals",
554
+ "TextStartsWith",
555
+ "TrueCondition",
556
+ ]
@@ -0,0 +1,51 @@
1
+ # DO NOT EDIT THIS FILE MANUALLY - it will be overwritten.
2
+ # Generated by: erdo gen-client
3
+ """
4
+ Internal action functions auto-generated from backend/bot/action.go.
5
+
6
+ These functions provide Python implementations of internal actions
7
+ that are handled directly by the bot execution engine.
8
+ """
9
+
10
+ from typing import Any, Optional
11
+
12
+ from pydantic import BaseModel
13
+
14
+ from .types import Result
15
+
16
+
17
+ class CheckpointAttemptParams(BaseModel):
18
+ """checkpoint_attempt parameters"""
19
+
20
+ attempts: Optional[Any] = None # Attempt data
21
+ loops: Optional[Any] = None # Loop data
22
+
23
+
24
+ class RefreshResourceParams(BaseModel):
25
+ """refresh_resource parameters"""
26
+
27
+ resource: Any # Resource to refresh
28
+
29
+
30
+ def refresh_resource(resource) -> Result:
31
+ """Refreshes one or more resources by updating their dataset information."""
32
+ if isinstance(resource, list):
33
+ output = {"resources": resource}
34
+ else:
35
+ output = {"resource": resource}
36
+ return Result(
37
+ status="success", parameters={}, output=output, message=None, error=None
38
+ )
39
+
40
+
41
+ def checkpoint_attempt(loops, attempts=None) -> Result:
42
+ """Creates a checkpoint for the current attempt with the specified number of loops."""
43
+ # Don't try to convert template strings to int - they'll be resolved at runtime
44
+ if isinstance(loops, str) and not loops.startswith("{{"):
45
+ loops = int(loops)
46
+ output = {"loops": loops}
47
+ if attempts is not None:
48
+ output["attempts"] = attempts
49
+ return Result(
50
+ status="success", parameters={}, output=output, message=None, error=None
51
+ )
@@ -0,0 +1,91 @@
1
+ # DO NOT EDIT THIS FILE MANUALLY - it will be overwritten.
2
+ # Generated by: erdo gen-client
3
+ """
4
+ Internal action functions auto-generated from backend/bot/action.go.
5
+
6
+ These functions provide Python implementations of internal actions
7
+ that are handled directly by the bot execution engine.
8
+ """
9
+
10
+ from typing import Any, Dict, Optional, Union
11
+
12
+ from pydantic import BaseModel
13
+
14
+ from erdo.template import TemplateString
15
+
16
+
17
+ class BaseActionParams(BaseModel):
18
+ """Base class for all action parameter classes.
19
+
20
+ Provides common fields that all actions support:
21
+ - name: The action type identifier
22
+ - step_metadata: Optional configuration for the step created from this action
23
+ """
24
+
25
+ name: str
26
+ step_metadata: Optional[Any] = None
27
+
28
+
29
+ class CheckpointAttemptParams(BaseActionParams):
30
+ """checkpoint_attempt parameters"""
31
+
32
+ name: str = "checkpoint_attempt" # Action type for roundtrip compatibility
33
+ attempts: Optional[Union[Any, TemplateString]] = None # Attempt data
34
+ loops: Optional[Union[Any, TemplateString]] = None # Loop data
35
+
36
+
37
+ class RefreshResourceParams(BaseActionParams):
38
+ """refresh_resource parameters"""
39
+
40
+ name: str = "refresh_resource" # Action type for roundtrip compatibility
41
+ resource: Union[str, Dict[str, Any], TemplateString] # Resource to refresh
42
+
43
+
44
+ def checkpoint_attempt(
45
+ attempts: Optional[Union[Any, TemplateString]] = None,
46
+ loops: Optional[Union[Any, TemplateString]] = None,
47
+ **kwargs: Any,
48
+ ) -> CheckpointAttemptParams:
49
+ """checkpoint_attempt internal action
50
+
51
+ Internal action that is handled directly by the bot execution engine.
52
+
53
+ Args:
54
+ attempts: Optional attempt data
55
+ loops: Optional loop data
56
+
57
+ Returns:
58
+ CheckpointAttemptParams: Type-safe parameter object
59
+ """
60
+ params = {
61
+ "attempts": attempts,
62
+ "loops": loops,
63
+ }
64
+ # Remove None values for optional parameters
65
+ params = {k: v for k, v in params.items() if v is not None}
66
+ params.update(kwargs)
67
+
68
+ return CheckpointAttemptParams.model_validate(params)
69
+
70
+
71
+ def refresh_resource(
72
+ resource: Union[str, Dict[str, Any], TemplateString], **kwargs: Any
73
+ ) -> RefreshResourceParams:
74
+ """refresh_resource internal action
75
+
76
+ Internal action that is handled directly by the bot execution engine.
77
+
78
+ Args:
79
+ resource: Resource to refresh
80
+
81
+ Returns:
82
+ RefreshResourceParams: Type-safe parameter object
83
+ """
84
+ params = {
85
+ "resource": resource,
86
+ }
87
+ # Remove None values for optional parameters
88
+ params = {k: v for k, v in params.items() if v is not None}
89
+ params.update(kwargs)
90
+
91
+ return RefreshResourceParams.model_validate(params)