erdo 0.1.5__tar.gz → 0.1.6__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.

Potentially problematic release.


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

Files changed (67) hide show
  1. {erdo-0.1.5 → erdo-0.1.6}/PKG-INFO +3 -1
  2. erdo-0.1.6/VERSION +1 -0
  3. {erdo-0.1.5 → erdo-0.1.6}/erdo/__init__.py +8 -11
  4. {erdo-0.1.5 → erdo-0.1.6}/erdo/_generated/actions/bot.py +22 -2
  5. {erdo-0.1.5 → erdo-0.1.6}/erdo/_generated/actions/llm.py +22 -4
  6. {erdo-0.1.5 → erdo-0.1.6}/erdo/_generated/internal_actions.py +14 -2
  7. {erdo-0.1.5 → erdo-0.1.6}/erdo/actions/__init__.py +7 -6
  8. {erdo-0.1.5 → erdo-0.1.6}/erdo/config/config.py +2 -2
  9. {erdo-0.1.5 → erdo-0.1.6}/erdo/invoke/client.py +7 -7
  10. {erdo-0.1.5 → erdo-0.1.6}/erdo/invoke/invoke.py +21 -15
  11. {erdo-0.1.5 → erdo-0.1.6}/erdo/sync/client.py +2 -2
  12. {erdo-0.1.5 → erdo-0.1.6}/erdo/sync/extractor.py +9 -3
  13. {erdo-0.1.5 → erdo-0.1.6}/erdo/sync/sync.py +1 -2
  14. {erdo-0.1.5 → erdo-0.1.6}/erdo/types.py +8 -3
  15. {erdo-0.1.5 → erdo-0.1.6}/pyproject.toml +2 -0
  16. erdo-0.1.5/VERSION +0 -1
  17. {erdo-0.1.5 → erdo-0.1.6}/.github/workflows/ci.yml +0 -0
  18. {erdo-0.1.5 → erdo-0.1.6}/.github/workflows/publish.yml +0 -0
  19. {erdo-0.1.5 → erdo-0.1.6}/.gitignore +0 -0
  20. {erdo-0.1.5 → erdo-0.1.6}/CLAUDE.md +0 -0
  21. {erdo-0.1.5 → erdo-0.1.6}/LICENSE +0 -0
  22. {erdo-0.1.5 → erdo-0.1.6}/MANIFEST.in +0 -0
  23. {erdo-0.1.5 → erdo-0.1.6}/PYPI_SETUP.md +0 -0
  24. {erdo-0.1.5 → erdo-0.1.6}/README.md +0 -0
  25. {erdo-0.1.5 → erdo-0.1.6}/erdo/_generated/__init__.py +0 -0
  26. {erdo-0.1.5 → erdo-0.1.6}/erdo/_generated/actions/__init__.py +0 -0
  27. {erdo-0.1.5 → erdo-0.1.6}/erdo/_generated/actions/analysis.py +0 -0
  28. {erdo-0.1.5 → erdo-0.1.6}/erdo/_generated/actions/codeexec.py +0 -0
  29. {erdo-0.1.5 → erdo-0.1.6}/erdo/_generated/actions/memory.py +0 -0
  30. {erdo-0.1.5 → erdo-0.1.6}/erdo/_generated/actions/pdfextractor.py +0 -0
  31. {erdo-0.1.5 → erdo-0.1.6}/erdo/_generated/actions/resource_definitions.py +0 -0
  32. {erdo-0.1.5 → erdo-0.1.6}/erdo/_generated/actions/sqlexec.py +0 -0
  33. {erdo-0.1.5 → erdo-0.1.6}/erdo/_generated/actions/utils.py +0 -0
  34. {erdo-0.1.5 → erdo-0.1.6}/erdo/_generated/actions/webparser.py +0 -0
  35. {erdo-0.1.5 → erdo-0.1.6}/erdo/_generated/actions/websearch.py +0 -0
  36. {erdo-0.1.5 → erdo-0.1.6}/erdo/_generated/condition/__init__.py +125 -125
  37. {erdo-0.1.5 → erdo-0.1.6}/erdo/_generated/internal.py +0 -0
  38. {erdo-0.1.5 → erdo-0.1.6}/erdo/_generated/parameters.py +0 -0
  39. {erdo-0.1.5 → erdo-0.1.6}/erdo/_generated/secrets.py +0 -0
  40. {erdo-0.1.5 → erdo-0.1.6}/erdo/_generated/template_functions.py +0 -0
  41. {erdo-0.1.5 → erdo-0.1.6}/erdo/_generated/types.py +0 -0
  42. {erdo-0.1.5 → erdo-0.1.6}/erdo/bot_permissions.py +0 -0
  43. {erdo-0.1.5 → erdo-0.1.6}/erdo/cli_entry.py +0 -0
  44. {erdo-0.1.5 → erdo-0.1.6}/erdo/conditions/__init__.py +0 -0
  45. {erdo-0.1.5 → erdo-0.1.6}/erdo/config/__init__.py +0 -0
  46. {erdo-0.1.5 → erdo-0.1.6}/erdo/install_cli.py +0 -0
  47. {erdo-0.1.5 → erdo-0.1.6}/erdo/integrations.py +0 -0
  48. {erdo-0.1.5 → erdo-0.1.6}/erdo/invoke/__init__.py +0 -0
  49. {erdo-0.1.5 → erdo-0.1.6}/erdo/py.typed +0 -0
  50. {erdo-0.1.5 → erdo-0.1.6}/erdo/state.py +0 -0
  51. {erdo-0.1.5 → erdo-0.1.6}/erdo/sync/__init__.py +0 -0
  52. {erdo-0.1.5 → erdo-0.1.6}/erdo/template.py +0 -0
  53. {erdo-0.1.5 → erdo-0.1.6}/examples/agent_centric_example.py +0 -0
  54. {erdo-0.1.5 → erdo-0.1.6}/examples/analysis_files/analysis_result.json +0 -0
  55. {erdo-0.1.5 → erdo-0.1.6}/examples/analysis_files/analyze.py +0 -0
  56. {erdo-0.1.5 → erdo-0.1.6}/examples/analysis_files/utils.py +0 -0
  57. {erdo-0.1.5 → erdo-0.1.6}/examples/bot_permissions_example.py +0 -0
  58. {erdo-0.1.5 → erdo-0.1.6}/examples/simple_echo_agent.py +0 -0
  59. {erdo-0.1.5 → erdo-0.1.6}/examples/state_example.py +0 -0
  60. {erdo-0.1.5 → erdo-0.1.6}/examples/test_agent.py +0 -0
  61. {erdo-0.1.5 → erdo-0.1.6}/examples/test_data.json +0 -0
  62. {erdo-0.1.5 → erdo-0.1.6}/examples/test_echo_agent.py +0 -0
  63. {erdo-0.1.5 → erdo-0.1.6}/setup.py +0 -0
  64. {erdo-0.1.5 → erdo-0.1.6}/test_bot_permissions.py +0 -0
  65. {erdo-0.1.5 → erdo-0.1.6}/tests/__init__.py +0 -0
  66. {erdo-0.1.5 → erdo-0.1.6}/tests/test_basic.py +0 -0
  67. {erdo-0.1.5 → erdo-0.1.6}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: erdo
3
- Version: 0.1.5
3
+ Version: 0.1.6
4
4
  Summary: Python SDK for building workflow automation agents with Erdo
5
5
  Project-URL: Homepage, https://erdo.ai
6
6
  Project-URL: Documentation, https://docs.erdo.ai
@@ -32,6 +32,8 @@ Requires-Dist: isort>=5.0.0; extra == 'dev'
32
32
  Requires-Dist: mypy>=1.0.0; extra == 'dev'
33
33
  Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
34
34
  Requires-Dist: pytest>=7.0.0; extra == 'dev'
35
+ Requires-Dist: types-pyyaml>=6.0.0; extra == 'dev'
36
+ Requires-Dist: types-requests>=2.31.0; extra == 'dev'
35
37
  Description-Content-Type: text/markdown
36
38
 
37
39
  # Erdo Agent SDK
erdo-0.1.6/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.6
@@ -16,22 +16,19 @@ from .types import * # noqa: F403,F401
16
16
 
17
17
  __version__ = "0.1.0"
18
18
 
19
- # Build __all__ dynamically by combining all available types
20
- __all__ = []
19
+ # Add all condition functions automatically
20
+ from ._generated.condition import __all__ as condition_all # noqa: E402
21
+
22
+ # Add all generated types automatically
23
+ from ._generated.types import __all__ as generated_all # noqa: E402
21
24
 
22
25
  # Add handwritten SDK classes
23
- from .types import __all__ as handwritten_all
26
+ from .types import __all__ as handwritten_all # noqa: E402
24
27
 
28
+ # Build __all__ dynamically by combining all available types
29
+ __all__ = []
25
30
  __all__.extend(handwritten_all)
26
-
27
- # Add all generated types automatically
28
- from ._generated.types import __all__ as generated_all
29
-
30
31
  __all__.extend(generated_all)
31
-
32
- # Add all condition functions automatically
33
- from ._generated.condition import __all__ as condition_all
34
-
35
32
  __all__.extend(condition_all)
36
33
 
37
34
  # Add state to __all__ for explicit import
@@ -42,7 +42,19 @@ class AskResult(BaseModel):
42
42
  error: Optional[str] = None # Error message if ask failed
43
43
 
44
44
 
45
- class InvokeParams(BaseModel):
45
+ class BaseActionParams(BaseModel):
46
+ """Base class for all action parameter classes.
47
+
48
+ Provides common fields that all actions support:
49
+ - name: The action type identifier
50
+ - step_metadata: Optional configuration for the step created from this action
51
+ """
52
+
53
+ name: str
54
+ step_metadata: Optional[Any] = None
55
+
56
+
57
+ class InvokeParams(BaseActionParams):
46
58
  """Invoke a bot with specified parameters and return the result parameters"""
47
59
 
48
60
  name: str = "bot.invoke" # Action type for roundtrip compatibility
@@ -66,7 +78,7 @@ class InvokeParams(BaseModel):
66
78
  )
67
79
 
68
80
 
69
- class AskParams(BaseModel):
81
+ class AskParams(BaseActionParams):
70
82
  """Ask a bot a question and get a response parameters"""
71
83
 
72
84
  name: str = "bot.ask" # Action type for roundtrip compatibility
@@ -117,6 +129,10 @@ def invoke(
117
129
  params_dict = {k: v for k, v in params_dict.items() if v is not None}
118
130
  params_dict.update(params)
119
131
 
132
+ # Include step_metadata in params_dict since it's a field on BaseActionParams
133
+ if step_metadata is not None:
134
+ params_dict["step_metadata"] = step_metadata
135
+
120
136
  # Use normal constructor for proper validation
121
137
  return InvokeParams(**params_dict)
122
138
 
@@ -151,6 +167,10 @@ def ask(
151
167
  params_dict = {k: v for k, v in params_dict.items() if v is not None}
152
168
  params_dict.update(params)
153
169
 
170
+ # Include step_metadata in params_dict since it's a field on BaseActionParams
171
+ if step_metadata is not None:
172
+ params_dict["step_metadata"] = step_metadata
173
+
154
174
  # Use normal constructor for proper validation
155
175
  return AskParams(**params_dict)
156
176
 
@@ -30,7 +30,19 @@ class MessageResult(BaseModel):
30
30
  finish_reason: Optional[str] = None # Reason the generation finished
31
31
 
32
32
 
33
- class MessageParams(BaseModel):
33
+ class BaseActionParams(BaseModel):
34
+ """Base class for all action parameter classes.
35
+
36
+ Provides common fields that all actions support:
37
+ - name: The action type identifier
38
+ - step_metadata: Optional configuration for the step created from this action
39
+ """
40
+
41
+ name: str
42
+ step_metadata: Optional[StepMetadata] = None
43
+
44
+
45
+ class MessageParams(BaseActionParams):
34
46
  """LLM message parameters (bot-compatible)"""
35
47
 
36
48
  name: str = "llm.message" # Action type for roundtrip compatibility
@@ -78,6 +90,7 @@ def message(
78
90
  disable_tools: Optional[Union[bool, TemplateString]] = None,
79
91
  reasoning: Optional[Union[Dict[str, Any], TemplateString]] = None,
80
92
  step_metadata: Optional[StepMetadata] = None,
93
+ **params: Any,
81
94
  ) -> MessageParams:
82
95
  """Generate LLM message with bot-compatible parameters
83
96
 
@@ -100,7 +113,7 @@ def message(
100
113
  Returns:
101
114
  MessageParams: Type-safe parameter object
102
115
  """
103
- params = {
116
+ params_dict = {
104
117
  "system_prompt": system_prompt,
105
118
  "message_history": message_history,
106
119
  "query": query,
@@ -115,10 +128,15 @@ def message(
115
128
  }
116
129
 
117
130
  # Remove None values for optional parameters
118
- params = {k: v for k, v in params.items() if v is not None}
131
+ params_dict = {k: v for k, v in params_dict.items() if v is not None}
132
+ params_dict.update(params)
133
+
134
+ # Include step_metadata in params_dict since it's a field on BaseActionParams
135
+ if step_metadata is not None:
136
+ params_dict["step_metadata"] = step_metadata
119
137
 
120
138
  # Use normal constructor for proper validation
121
- return MessageParams(**params)
139
+ return MessageParams(**params_dict)
122
140
 
123
141
 
124
142
  # Associate parameter classes with their result types
@@ -14,7 +14,19 @@ from pydantic import BaseModel
14
14
  from erdo.template import TemplateString
15
15
 
16
16
 
17
- class CheckpointAttemptParams(BaseModel):
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):
18
30
  """checkpoint_attempt parameters"""
19
31
 
20
32
  name: str = "checkpoint_attempt" # Action type for roundtrip compatibility
@@ -22,7 +34,7 @@ class CheckpointAttemptParams(BaseModel):
22
34
  loops: Optional[Union[Any, TemplateString]] = None # Loop data
23
35
 
24
36
 
25
- class RefreshResourceParams(BaseModel):
37
+ class RefreshResourceParams(BaseActionParams):
26
38
  """refresh_resource parameters"""
27
39
 
28
40
  name: str = "refresh_resource" # Action type for roundtrip compatibility
@@ -19,21 +19,22 @@ from .._generated.actions import utils # noqa: F401
19
19
  from .._generated.actions import webparser # noqa: F401
20
20
  from .._generated.actions import websearch # noqa: F401
21
21
 
22
- # Import internal actions first
23
- from .._generated.internal_actions import * # noqa: F403,F401
22
+ # Import internal actions explicitly
23
+ from .._generated.internal_actions import checkpoint_attempt # noqa: F401
24
+ from .._generated.internal_actions import refresh_resource # noqa: F401
24
25
 
25
26
  # Make all services available for import
26
27
  __all__ = [
27
28
  "checkpoint_attempt",
28
29
  "refresh_resource",
29
- "resource_definitions",
30
+ "analysis",
31
+ "bot",
30
32
  "webparser",
31
33
  "websearch",
32
- "analysis",
33
34
  "codeexec",
34
35
  "llm",
36
+ "memory",
37
+ "resource_definitions",
35
38
  "sqlexec",
36
39
  "utils",
37
- "bot",
38
- "memory",
39
40
  ]
@@ -72,7 +72,7 @@ class Config:
72
72
 
73
73
  with open(self._config_yaml, "r") as f:
74
74
  return yaml.safe_load(f)
75
- except:
75
+ except Exception:
76
76
  try:
77
77
  # Fallback to simple parsing if yaml not available
78
78
  with open(self._config_yaml, "r") as f:
@@ -82,7 +82,7 @@ class Config:
82
82
  key, value = line.strip().split(": ", 1)
83
83
  config[key] = value
84
84
  return config
85
- except:
85
+ except Exception:
86
86
  pass
87
87
 
88
88
  # Try JSON as fallback
@@ -76,7 +76,7 @@ class InvokeClient:
76
76
  }
77
77
 
78
78
  # Build invoke parameters
79
- invoke_params = {
79
+ invoke_params: Dict[str, Any] = {
80
80
  "parameters": parameters or {},
81
81
  }
82
82
 
@@ -91,7 +91,7 @@ class InvokeClient:
91
91
  try:
92
92
  error_details = response.text
93
93
  error_msg = f"{error_msg}: {error_details}"
94
- except:
94
+ except Exception:
95
95
  pass
96
96
  raise requests.RequestException(error_msg)
97
97
 
@@ -102,8 +102,8 @@ class InvokeClient:
102
102
  return sse_client
103
103
  else:
104
104
  # Consume all events and return final result
105
- events = []
106
- final_result = {}
105
+ events: list[Dict[str, Any]] = []
106
+ final_result: Dict[str, Any] = {}
107
107
 
108
108
  for event in sse_client.events():
109
109
  events.append(event)
@@ -173,7 +173,7 @@ class InvokeClient:
173
173
  try:
174
174
  error_details = response.text
175
175
  error_msg = f"{error_msg}: {error_details}"
176
- except:
176
+ except Exception:
177
177
  pass
178
178
  raise requests.RequestException(error_msg)
179
179
 
@@ -184,8 +184,8 @@ class InvokeClient:
184
184
  return sse_client
185
185
  else:
186
186
  # Consume all events and return final result
187
- events = []
188
- final_result = {}
187
+ events: list[Dict[str, Any]] = []
188
+ final_result: Dict[str, Any] = {}
189
189
 
190
190
  for event in sse_client.events():
191
191
  events.append(event)
@@ -124,21 +124,23 @@ class Invoke:
124
124
  final_result = None
125
125
  invocation_id = None
126
126
 
127
- for event in response.events():
128
- events.append(event)
127
+ # Type guard: response should be SSEClient when stream=True
128
+ if not isinstance(response, dict):
129
+ for event in response.events():
130
+ events.append(event)
129
131
 
130
- if self.print_events:
131
- self._print_event(event)
132
+ if self.print_events:
133
+ self._print_event(event)
132
134
 
133
- # Extract invocation ID from events
134
- if "invocation_id" in event:
135
- invocation_id = event["invocation_id"]
135
+ # Extract invocation ID from events
136
+ if "invocation_id" in event:
137
+ invocation_id = event["invocation_id"]
136
138
 
137
- # Check for final result
138
- if event.get("type") == "invocation_completed":
139
- final_result = event.get("result")
140
- elif event.get("type") == "result":
141
- final_result = event.get("data")
139
+ # Check for final result
140
+ if event.get("type") == "invocation_completed":
141
+ final_result = event.get("result")
142
+ elif event.get("type") == "result":
143
+ final_result = event.get("data")
142
144
 
143
145
  return InvokeResult(
144
146
  success=True,
@@ -148,9 +150,13 @@ class Invoke:
148
150
  events=events,
149
151
  )
150
152
  else:
151
- # Non-streaming response
153
+ # Non-streaming response - response is a dict
154
+ response_dict = response if isinstance(response, dict) else {}
152
155
  return InvokeResult(
153
- success=True, bot_id=bot_key, result=response, events=[response]
156
+ success=True,
157
+ bot_id=bot_key,
158
+ result=response_dict,
159
+ events=[response_dict],
154
160
  )
155
161
 
156
162
  except Exception as e:
@@ -170,7 +176,7 @@ class Invoke:
170
176
  content = event.get("content", "")
171
177
  print(content, end="", flush=True)
172
178
  elif event_type == "invocation_completed":
173
- print(f"\n✨ Invocation completed")
179
+ print("\n✨ Invocation completed")
174
180
  elif event_type == "error":
175
181
  error = event.get("error", "Unknown error")
176
182
  print(f"❌ Error: {error}")
@@ -53,7 +53,7 @@ class SyncClient:
53
53
  try:
54
54
  error_details = response.text
55
55
  error_msg = f"{error_msg}: {error_details}"
56
- except:
56
+ except Exception:
57
57
  pass
58
58
  raise requests.RequestException(error_msg)
59
59
 
@@ -88,7 +88,7 @@ class SyncClient:
88
88
  try:
89
89
  error_details = response.text
90
90
  error_msg = f"{error_msg}: {error_details}"
91
- except:
91
+ except Exception:
92
92
  pass
93
93
  raise requests.RequestException(error_msg)
94
94
 
@@ -218,7 +218,7 @@ if __name__ == "__main__":
218
218
  secrets_json = os.environ.get('STEP_SECRETS', '{{}}')
219
219
  secrets = json.loads(secrets_json)
220
220
  context = StepContext(parameters=parameters, secrets=secrets)
221
-
221
+
222
222
  try:
223
223
  result = {func_name}(context)
224
224
  if result:
@@ -298,7 +298,7 @@ def extract_action_result_schemas(module: Any) -> Dict:
298
298
  action_name = name_field.default.split(".")[-1]
299
299
 
300
300
  if action_name and result_class:
301
- schema = {
301
+ schema: Dict[str, Any] = {
302
302
  "class_name": result_class.__name__,
303
303
  "description": result_class.__doc__ or "",
304
304
  "required_fields": [],
@@ -413,9 +413,12 @@ def extract_agent_from_instance(
413
413
  spec = importlib.util.spec_from_file_location(
414
414
  "agent_module", source_file_path
415
415
  )
416
+ if not spec or not spec.loader:
417
+ raise ValueError(f"Could not load module spec from {source_file_path}")
418
+
416
419
  module = importlib.util.module_from_spec(spec)
417
420
  spec.loader.exec_module(module)
418
- except:
421
+ except Exception:
419
422
  module = None
420
423
  else:
421
424
  module = None
@@ -451,6 +454,9 @@ def extract_agents_from_file(file_path: str) -> Union[Dict, List[Dict]]:
451
454
  sys.path.insert(0, file_dir)
452
455
 
453
456
  spec = importlib.util.spec_from_file_location("target_module", file_path)
457
+ if not spec or not spec.loader:
458
+ raise ValueError(f"Could not load module from {file_path}")
459
+
454
460
  module = importlib.util.module_from_spec(spec)
455
461
 
456
462
  with warnings.catch_warnings():
@@ -137,7 +137,6 @@ class Sync:
137
137
  Returns:
138
138
  List of SyncResult objects for each agent found
139
139
  """
140
- sync = cls(endpoint=endpoint, auth_token=auth_token)
141
140
  results = []
142
141
 
143
142
  directory = Path(directory_path)
@@ -151,7 +150,7 @@ class Sync:
151
150
  )
152
151
  if init_results:
153
152
  return init_results
154
- except:
153
+ except Exception:
155
154
  pass # Fall back to directory scan
156
155
 
157
156
  # Scan directory for agent files
@@ -947,8 +947,11 @@ class Agent(BaseModel):
947
947
  Returns:
948
948
  Step: The created step with sensible defaults
949
949
  """
950
- # Auto-generate key if not provided
951
- if key is None:
950
+ # Extract step_metadata from the action if present
951
+ extracted_config = _extract_step_config_from_action(action)
952
+
953
+ # Auto-generate key if not provided (either via param or step_metadata)
954
+ if key is None and "key" not in extracted_config:
952
955
  key = f"step_{len(self.steps) + 1}"
953
956
 
954
957
  # Set sensible defaults
@@ -966,7 +969,9 @@ class Agent(BaseModel):
966
969
  "output_content_type": OutputContentType.TEXT,
967
970
  }
968
971
 
969
- # Override with any provided kwargs
972
+ # First merge extracted_config (from step_metadata), then kwargs
973
+ # This allows kwargs to override step_metadata if needed
974
+ step_config.update(extracted_config)
970
975
  step_config.update(kwargs)
971
976
 
972
977
  step = Step(**step_config)
@@ -43,6 +43,8 @@ dev = [
43
43
  "isort>=5.0.0",
44
44
  "mypy>=1.0.0",
45
45
  "flake8>=6.0.0",
46
+ "types-requests>=2.31.0",
47
+ "types-PyYAML>=6.0.0",
46
48
  ]
47
49
 
48
50
  [project.urls]
erdo-0.1.5/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.1.5
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -133,30 +133,34 @@ class _BaseCondition:
133
133
  return _NotCondition(self)
134
134
 
135
135
 
136
- class TextEquals(_BaseCondition):
137
- def __init__(self, text: Any = None, value: Any = None) -> None:
138
- self.text = text
139
- self.value = value
136
+ class IsErrorInfoNeeded(_BaseCondition):
137
+ def __init__(self) -> None:
138
+ pass
140
139
 
141
140
  def to_dict(self) -> Dict[str, Any]:
142
141
  """Convert to dict format expected by backend."""
143
- result: Dict[str, Any] = {}
144
- result["type"] = "TextEquals"
142
+ return {"type": "IsErrorInfoNeeded", "leaf": {}}
145
143
 
146
- # Add field values to leaf object (backend expects leaf format)
147
- leaf: Dict[str, Any] = {}
148
- if self.text is not None:
149
- leaf["text"] = self.text
150
- if self.value is not None:
151
- leaf["value"] = self.value
152
144
 
153
- if leaf:
154
- result["leaf"] = leaf
145
+ class IsErrorTerminated(_BaseCondition):
146
+ def __init__(self) -> None:
147
+ pass
155
148
 
156
- return result
149
+ def to_dict(self) -> Dict[str, Any]:
150
+ """Convert to dict format expected by backend."""
151
+ return {"type": "IsErrorTerminated", "leaf": {}}
157
152
 
158
153
 
159
- class TextStartsWith(_BaseCondition):
154
+ class IsFormattedError(_BaseCondition):
155
+ def __init__(self) -> None:
156
+ pass
157
+
158
+ def to_dict(self) -> Dict[str, Any]:
159
+ """Convert to dict format expected by backend."""
160
+ return {"type": "IsFormattedError", "leaf": {}}
161
+
162
+
163
+ class TextEndsWith(_BaseCondition):
160
164
  def __init__(self, text: Any = None, value: Any = None) -> None:
161
165
  self.text = text
162
166
  self.value = value
@@ -164,7 +168,7 @@ class TextStartsWith(_BaseCondition):
164
168
  def to_dict(self) -> Dict[str, Any]:
165
169
  """Convert to dict format expected by backend."""
166
170
  result: Dict[str, Any] = {}
167
- result["type"] = "TextStartsWith"
171
+ result["type"] = "TextEndsWith"
168
172
 
169
173
  # Add field values to leaf object (backend expects leaf format)
170
174
  leaf: Dict[str, Any] = {}
@@ -179,19 +183,22 @@ class TextStartsWith(_BaseCondition):
179
183
  return result
180
184
 
181
185
 
182
- class NotCondition(_BaseCondition):
183
- def __init__(self, condition: Any = None) -> None:
184
- self.condition = condition
186
+ class IsAny(_BaseCondition):
187
+ def __init__(self, key: Any = None, value: Any = None) -> None:
188
+ self.key = key
189
+ self.value = value
185
190
 
186
191
  def to_dict(self) -> Dict[str, Any]:
187
192
  """Convert to dict format expected by backend."""
188
193
  result: Dict[str, Any] = {}
189
- result["type"] = "NotCondition"
194
+ result["type"] = "IsAny"
190
195
 
191
196
  # Add field values to leaf object (backend expects leaf format)
192
197
  leaf: Dict[str, Any] = {}
193
- if self.condition is not None:
194
- leaf["condition"] = self.condition
198
+ if self.key is not None:
199
+ leaf["key"] = self.key
200
+ if self.value is not None:
201
+ leaf["value"] = self.value
195
202
 
196
203
  if leaf:
197
204
  result["leaf"] = leaf
@@ -199,16 +206,25 @@ class NotCondition(_BaseCondition):
199
206
  return result
200
207
 
201
208
 
202
- class FalseCondition(_BaseCondition):
209
+ class IsErrorActionNotFound(_BaseCondition):
203
210
  def __init__(self) -> None:
204
211
  pass
205
212
 
206
213
  def to_dict(self) -> Dict[str, Any]:
207
214
  """Convert to dict format expected by backend."""
208
- return {"type": "FalseCondition", "leaf": {}}
215
+ return {"type": "IsErrorActionNotFound", "leaf": {}}
209
216
 
210
217
 
211
- class GreaterThan(_BaseCondition):
218
+ class IsErrorInternalError(_BaseCondition):
219
+ def __init__(self) -> None:
220
+ pass
221
+
222
+ def to_dict(self) -> Dict[str, Any]:
223
+ """Convert to dict format expected by backend."""
224
+ return {"type": "IsErrorInternalError", "leaf": {}}
225
+
226
+
227
+ class LessThan(_BaseCondition):
212
228
  def __init__(self, number: Any = None, value: Any = None) -> None:
213
229
  self.number = number
214
230
  self.value = value
@@ -216,7 +232,7 @@ class GreaterThan(_BaseCondition):
216
232
  def to_dict(self) -> Dict[str, Any]:
217
233
  """Convert to dict format expected by backend."""
218
234
  result: Dict[str, Any] = {}
219
- result["type"] = "GreaterThan"
235
+ result["type"] = "LessThan"
220
236
 
221
237
  # Add field values to leaf object (backend expects leaf format)
222
238
  leaf: Dict[str, Any] = {}
@@ -231,20 +247,20 @@ class GreaterThan(_BaseCondition):
231
247
  return result
232
248
 
233
249
 
234
- class IsAny(_BaseCondition):
235
- def __init__(self, key: Any = None, value: Any = None) -> None:
236
- self.key = key
250
+ class EarlierThan(_BaseCondition):
251
+ def __init__(self, time: Any = None, value: Any = None) -> None:
252
+ self.time = time
237
253
  self.value = value
238
254
 
239
255
  def to_dict(self) -> Dict[str, Any]:
240
256
  """Convert to dict format expected by backend."""
241
257
  result: Dict[str, Any] = {}
242
- result["type"] = "IsAny"
258
+ result["type"] = "EarlierThan"
243
259
 
244
260
  # Add field values to leaf object (backend expects leaf format)
245
261
  leaf: Dict[str, Any] = {}
246
- if self.key is not None:
247
- leaf["key"] = self.key
262
+ if self.time is not None:
263
+ leaf["time"] = self.time
248
264
  if self.value is not None:
249
265
  leaf["value"] = self.value
250
266
 
@@ -254,22 +270,45 @@ class IsAny(_BaseCondition):
254
270
  return result
255
271
 
256
272
 
257
- class IsError(_BaseCondition):
273
+ class FalseCondition(_BaseCondition):
258
274
  def __init__(self) -> None:
259
275
  pass
260
276
 
261
277
  def to_dict(self) -> Dict[str, Any]:
262
278
  """Convert to dict format expected by backend."""
263
- return {"type": "IsError", "leaf": {}}
279
+ return {"type": "FalseCondition", "leaf": {}}
264
280
 
265
281
 
266
- class IsErrorInternalError(_BaseCondition):
282
+ class GreaterThan(_BaseCondition):
283
+ def __init__(self, number: Any = None, value: Any = None) -> None:
284
+ self.number = number
285
+ self.value = value
286
+
287
+ def to_dict(self) -> Dict[str, Any]:
288
+ """Convert to dict format expected by backend."""
289
+ result: Dict[str, Any] = {}
290
+ result["type"] = "GreaterThan"
291
+
292
+ # Add field values to leaf object (backend expects leaf format)
293
+ leaf: Dict[str, Any] = {}
294
+ if self.number is not None:
295
+ leaf["number"] = self.number
296
+ if self.value is not None:
297
+ leaf["value"] = self.value
298
+
299
+ if leaf:
300
+ result["leaf"] = leaf
301
+
302
+ return result
303
+
304
+
305
+ class IsErrorTimeout(_BaseCondition):
267
306
  def __init__(self) -> None:
268
307
  pass
269
308
 
270
309
  def to_dict(self) -> Dict[str, Any]:
271
310
  """Convert to dict format expected by backend."""
272
- return {"type": "IsErrorInternalError", "leaf": {}}
311
+ return {"type": "IsErrorTimeout", "leaf": {}}
273
312
 
274
313
 
275
314
  class TextContains(_BaseCondition):
@@ -295,7 +334,7 @@ class TextContains(_BaseCondition):
295
334
  return result
296
335
 
297
336
 
298
- class TextEndsWith(_BaseCondition):
337
+ class TextEquals(_BaseCondition):
299
338
  def __init__(self, text: Any = None, value: Any = None) -> None:
300
339
  self.text = text
301
340
  self.value = value
@@ -303,7 +342,7 @@ class TextEndsWith(_BaseCondition):
303
342
  def to_dict(self) -> Dict[str, Any]:
304
343
  """Convert to dict format expected by backend."""
305
344
  result: Dict[str, Any] = {}
306
- result["type"] = "TextEndsWith"
345
+ result["type"] = "TextEquals"
307
346
 
308
347
  # Add field values to leaf object (backend expects leaf format)
309
348
  leaf: Dict[str, Any] = {}
@@ -318,29 +357,20 @@ class TextEndsWith(_BaseCondition):
318
357
  return result
319
358
 
320
359
 
321
- class TrueCondition(_BaseCondition):
322
- def __init__(self) -> None:
323
- pass
324
-
325
- def to_dict(self) -> Dict[str, Any]:
326
- """Convert to dict format expected by backend."""
327
- return {"type": "TrueCondition", "leaf": {}}
328
-
329
-
330
- class EarlierThan(_BaseCondition):
331
- def __init__(self, time: Any = None, value: Any = None) -> None:
332
- self.time = time
360
+ class TextStartsWith(_BaseCondition):
361
+ def __init__(self, text: Any = None, value: Any = None) -> None:
362
+ self.text = text
333
363
  self.value = value
334
364
 
335
365
  def to_dict(self) -> Dict[str, Any]:
336
366
  """Convert to dict format expected by backend."""
337
367
  result: Dict[str, Any] = {}
338
- result["type"] = "EarlierThan"
368
+ result["type"] = "TextStartsWith"
339
369
 
340
370
  # Add field values to leaf object (backend expects leaf format)
341
371
  leaf: Dict[str, Any] = {}
342
- if self.time is not None:
343
- leaf["time"] = self.time
372
+ if self.text is not None:
373
+ leaf["text"] = self.text
344
374
  if self.value is not None:
345
375
  leaf["value"] = self.value
346
376
 
@@ -350,64 +380,37 @@ class EarlierThan(_BaseCondition):
350
380
  return result
351
381
 
352
382
 
353
- class IsErrorActionNotFound(_BaseCondition):
354
- def __init__(self) -> None:
355
- pass
356
-
357
- def to_dict(self) -> Dict[str, Any]:
358
- """Convert to dict format expected by backend."""
359
- return {"type": "IsErrorActionNotFound", "leaf": {}}
360
-
361
-
362
- class IsErrorInfoNeeded(_BaseCondition):
363
- def __init__(self) -> None:
364
- pass
365
-
366
- def to_dict(self) -> Dict[str, Any]:
367
- """Convert to dict format expected by backend."""
368
- return {"type": "IsErrorInfoNeeded", "leaf": {}}
369
-
370
-
371
- class IsErrorTerminated(_BaseCondition):
372
- def __init__(self) -> None:
373
- pass
374
-
375
- def to_dict(self) -> Dict[str, Any]:
376
- """Convert to dict format expected by backend."""
377
- return {"type": "IsErrorTerminated", "leaf": {}}
378
-
379
-
380
- class IsErrorTimeout(_BaseCondition):
383
+ class TrueCondition(_BaseCondition):
381
384
  def __init__(self) -> None:
382
385
  pass
383
386
 
384
387
  def to_dict(self) -> Dict[str, Any]:
385
388
  """Convert to dict format expected by backend."""
386
- return {"type": "IsErrorTimeout", "leaf": {}}
389
+ return {"type": "TrueCondition", "leaf": {}}
387
390
 
388
391
 
389
- class IsSuccess(_BaseCondition):
392
+ class IsError(_BaseCondition):
390
393
  def __init__(self) -> None:
391
394
  pass
392
395
 
393
396
  def to_dict(self) -> Dict[str, Any]:
394
397
  """Convert to dict format expected by backend."""
395
- return {"type": "IsSuccess", "leaf": {}}
398
+ return {"type": "IsError", "leaf": {}}
396
399
 
397
400
 
398
- class OrCondition(_BaseCondition):
399
- def __init__(self, conditions: Any = None) -> None:
400
- self.conditions = conditions
401
+ class IsNull(_BaseCondition):
402
+ def __init__(self, key: Any = None) -> None:
403
+ self.key = key
401
404
 
402
405
  def to_dict(self) -> Dict[str, Any]:
403
406
  """Convert to dict format expected by backend."""
404
407
  result: Dict[str, Any] = {}
405
- result["type"] = "OrCondition"
408
+ result["type"] = "IsNull"
406
409
 
407
410
  # Add field values to leaf object (backend expects leaf format)
408
411
  leaf: Dict[str, Any] = {}
409
- if self.conditions is not None:
410
- leaf["conditions"] = self.conditions
412
+ if self.key is not None:
413
+ leaf["key"] = self.key
411
414
 
412
415
  if leaf:
413
416
  result["leaf"] = leaf
@@ -415,28 +418,28 @@ class OrCondition(_BaseCondition):
415
418
  return result
416
419
 
417
420
 
418
- class IsFormattedError(_BaseCondition):
421
+ class IsSuccess(_BaseCondition):
419
422
  def __init__(self) -> None:
420
423
  pass
421
424
 
422
425
  def to_dict(self) -> Dict[str, Any]:
423
426
  """Convert to dict format expected by backend."""
424
- return {"type": "IsFormattedError", "leaf": {}}
427
+ return {"type": "IsSuccess", "leaf": {}}
425
428
 
426
429
 
427
- class IsNull(_BaseCondition):
428
- def __init__(self, key: Any = None) -> None:
429
- self.key = key
430
+ class AndCondition(_BaseCondition):
431
+ def __init__(self, conditions: Any = None) -> None:
432
+ self.conditions = conditions
430
433
 
431
434
  def to_dict(self) -> Dict[str, Any]:
432
435
  """Convert to dict format expected by backend."""
433
436
  result: Dict[str, Any] = {}
434
- result["type"] = "IsNull"
437
+ result["type"] = "AndCondition"
435
438
 
436
439
  # Add field values to leaf object (backend expects leaf format)
437
440
  leaf: Dict[str, Any] = {}
438
- if self.key is not None:
439
- leaf["key"] = self.key
441
+ if self.conditions is not None:
442
+ leaf["conditions"] = self.conditions
440
443
 
441
444
  if leaf:
442
445
  result["leaf"] = leaf
@@ -444,22 +447,19 @@ class IsNull(_BaseCondition):
444
447
  return result
445
448
 
446
449
 
447
- class LessThan(_BaseCondition):
448
- def __init__(self, number: Any = None, value: Any = None) -> None:
449
- self.number = number
450
- self.value = value
450
+ class OrCondition(_BaseCondition):
451
+ def __init__(self, conditions: Any = None) -> None:
452
+ self.conditions = conditions
451
453
 
452
454
  def to_dict(self) -> Dict[str, Any]:
453
455
  """Convert to dict format expected by backend."""
454
456
  result: Dict[str, Any] = {}
455
- result["type"] = "LessThan"
457
+ result["type"] = "OrCondition"
456
458
 
457
459
  # Add field values to leaf object (backend expects leaf format)
458
460
  leaf: Dict[str, Any] = {}
459
- if self.number is not None:
460
- leaf["number"] = self.number
461
- if self.value is not None:
462
- leaf["value"] = self.value
461
+ if self.conditions is not None:
462
+ leaf["conditions"] = self.conditions
463
463
 
464
464
  if leaf:
465
465
  result["leaf"] = leaf
@@ -467,19 +467,19 @@ class LessThan(_BaseCondition):
467
467
  return result
468
468
 
469
469
 
470
- class AndCondition(_BaseCondition):
471
- def __init__(self, conditions: Any = None) -> None:
472
- self.conditions = conditions
470
+ class NotCondition(_BaseCondition):
471
+ def __init__(self, condition: Any = None) -> None:
472
+ self.condition = condition
473
473
 
474
474
  def to_dict(self) -> Dict[str, Any]:
475
475
  """Convert to dict format expected by backend."""
476
476
  result: Dict[str, Any] = {}
477
- result["type"] = "AndCondition"
477
+ result["type"] = "NotCondition"
478
478
 
479
479
  # Add field values to leaf object (backend expects leaf format)
480
480
  leaf: Dict[str, Any] = {}
481
- if self.conditions is not None:
482
- leaf["conditions"] = self.conditions
481
+ if self.condition is not None:
482
+ leaf["condition"] = self.condition
483
483
 
484
484
  if leaf:
485
485
  result["leaf"] = leaf
@@ -492,23 +492,23 @@ __all__ = [
492
492
  "And",
493
493
  "Or",
494
494
  "Not",
495
+ "EarlierThan",
495
496
  "FalseCondition",
496
497
  "GreaterThan",
497
- "IsAny",
498
- "IsError",
499
- "IsErrorInternalError",
498
+ "IsErrorTimeout",
500
499
  "TextContains",
501
- "TextEndsWith",
500
+ "TextEquals",
501
+ "TextStartsWith",
502
502
  "TrueCondition",
503
- "EarlierThan",
504
- "IsErrorActionNotFound",
503
+ "IsError",
504
+ "IsNull",
505
+ "IsSuccess",
505
506
  "IsErrorInfoNeeded",
506
507
  "IsErrorTerminated",
507
- "IsErrorTimeout",
508
- "IsSuccess",
509
508
  "IsFormattedError",
510
- "IsNull",
509
+ "TextEndsWith",
510
+ "IsAny",
511
+ "IsErrorActionNotFound",
512
+ "IsErrorInternalError",
511
513
  "LessThan",
512
- "TextEquals",
513
- "TextStartsWith",
514
514
  ]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes