erdo 0.1.9__tar.gz → 0.1.11__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 (49) hide show
  1. {erdo-0.1.9 → erdo-0.1.11}/PKG-INFO +44 -7
  2. {erdo-0.1.9 → erdo-0.1.11}/README.md +43 -6
  3. {erdo-0.1.9 → erdo-0.1.11}/erdo/__init__.py +4 -4
  4. {erdo-0.1.9 → erdo-0.1.11}/erdo/_generated/actions/bot.py +6 -0
  5. {erdo-0.1.9 → erdo-0.1.11}/erdo/_generated/actions/codeexec.py +32 -1
  6. {erdo-0.1.9 → erdo-0.1.11}/erdo/_generated/actions/llm.py +5 -0
  7. erdo-0.1.11/erdo/_generated/types.py +3859 -0
  8. {erdo-0.1.9 → erdo-0.1.11}/erdo/invoke/client.py +9 -3
  9. {erdo-0.1.9 → erdo-0.1.11}/erdo/invoke/invoke.py +109 -48
  10. {erdo-0.1.9 → erdo-0.1.11}/erdo/types.py +36 -5
  11. erdo-0.1.9/erdo/_generated/types.py +0 -2558
  12. {erdo-0.1.9 → erdo-0.1.11}/.gitignore +0 -0
  13. {erdo-0.1.9 → erdo-0.1.11}/LICENSE +0 -0
  14. {erdo-0.1.9 → erdo-0.1.11}/erdo/_generated/__init__.py +0 -0
  15. {erdo-0.1.9 → erdo-0.1.11}/erdo/_generated/actions/__init__.py +0 -0
  16. {erdo-0.1.9 → erdo-0.1.11}/erdo/_generated/actions/analysis.py +0 -0
  17. {erdo-0.1.9 → erdo-0.1.11}/erdo/_generated/actions/memory.py +0 -0
  18. {erdo-0.1.9 → erdo-0.1.11}/erdo/_generated/actions/pdfextractor.py +0 -0
  19. {erdo-0.1.9 → erdo-0.1.11}/erdo/_generated/actions/resource_definitions.py +0 -0
  20. {erdo-0.1.9 → erdo-0.1.11}/erdo/_generated/actions/sqlexec.py +0 -0
  21. {erdo-0.1.9 → erdo-0.1.11}/erdo/_generated/actions/utils.py +0 -0
  22. {erdo-0.1.9 → erdo-0.1.11}/erdo/_generated/actions/webparser.py +0 -0
  23. {erdo-0.1.9 → erdo-0.1.11}/erdo/_generated/actions/websearch.py +0 -0
  24. {erdo-0.1.9 → erdo-0.1.11}/erdo/_generated/condition/__init__.py +0 -0
  25. {erdo-0.1.9 → erdo-0.1.11}/erdo/_generated/internal.py +0 -0
  26. {erdo-0.1.9 → erdo-0.1.11}/erdo/_generated/internal_actions.py +0 -0
  27. {erdo-0.1.9 → erdo-0.1.11}/erdo/_generated/parameters.py +0 -0
  28. {erdo-0.1.9 → erdo-0.1.11}/erdo/_generated/secrets.py +0 -0
  29. {erdo-0.1.9 → erdo-0.1.11}/erdo/_generated/template_functions.py +0 -0
  30. {erdo-0.1.9 → erdo-0.1.11}/erdo/actions/__init__.py +0 -0
  31. {erdo-0.1.9 → erdo-0.1.11}/erdo/bot_permissions.py +0 -0
  32. {erdo-0.1.9 → erdo-0.1.11}/erdo/cli_entry.py +0 -0
  33. {erdo-0.1.9 → erdo-0.1.11}/erdo/conditions/__init__.py +0 -0
  34. {erdo-0.1.9 → erdo-0.1.11}/erdo/config/__init__.py +0 -0
  35. {erdo-0.1.9 → erdo-0.1.11}/erdo/config/config.py +0 -0
  36. {erdo-0.1.9 → erdo-0.1.11}/erdo/formatting.py +0 -0
  37. {erdo-0.1.9 → erdo-0.1.11}/erdo/install_cli.py +0 -0
  38. {erdo-0.1.9 → erdo-0.1.11}/erdo/integrations.py +0 -0
  39. {erdo-0.1.9 → erdo-0.1.11}/erdo/invoke/__init__.py +0 -0
  40. {erdo-0.1.9 → erdo-0.1.11}/erdo/state.py +0 -0
  41. {erdo-0.1.9 → erdo-0.1.11}/erdo/sync/__init__.py +0 -0
  42. {erdo-0.1.9 → erdo-0.1.11}/erdo/sync/client.py +0 -0
  43. {erdo-0.1.9 → erdo-0.1.11}/erdo/sync/extractor.py +0 -0
  44. {erdo-0.1.9 → erdo-0.1.11}/erdo/sync/sync.py +0 -0
  45. {erdo-0.1.9 → erdo-0.1.11}/erdo/template.py +0 -0
  46. {erdo-0.1.9 → erdo-0.1.11}/erdo/test/__init__.py +0 -0
  47. {erdo-0.1.9 → erdo-0.1.11}/erdo/test/evaluate.py +0 -0
  48. {erdo-0.1.9 → erdo-0.1.11}/erdo/test/runner.py +0 -0
  49. {erdo-0.1.9 → erdo-0.1.11}/pyproject.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: erdo
3
- Version: 0.1.9
3
+ Version: 0.1.11
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
@@ -316,18 +316,46 @@ else:
316
316
 
317
317
  ### Invocation Modes
318
318
 
319
- - **Live Mode** (default): Runs against real backend with LLM API
320
- - **Replay Mode**: Uses cached responses - free after first run (perfect for testing!)
321
- - **Mock Mode**: Returns synthetic responses - always free
319
+ Control how bot actions are executed for testing and development:
320
+
321
+ | Mode | Description | Cost |
322
+ |------|-------------|------|
323
+ | **live** | Execute with real API calls | $$$ per run |
324
+ | **replay** | Cache responses, replay on subsequent runs | $$$ first run, FREE after |
325
+ | **manual** | Use developer-provided mock responses | FREE always |
322
326
 
323
327
  ```python
324
- # Replay mode - free after first run
328
+ # Live mode (default) - real API calls
329
+ response = invoke("my-agent", messages=[...], mode="live")
330
+
331
+ # Replay mode - cache after first run (recommended for testing!)
325
332
  response = invoke("my-agent", messages=[...], mode="replay")
326
333
 
327
- # Mock mode - always free
328
- response = invoke("my-agent", messages=[...], mode="mock")
334
+ # Replay with refresh - bypass cache, get fresh response
335
+ response = invoke("my-agent", messages=[...], mode={"mode": "replay", "refresh": True})
336
+
337
+ # Manual mode - use mock responses
338
+ response = invoke(
339
+ "my-agent",
340
+ messages=[...],
341
+ mode="manual",
342
+ manual_mocks={
343
+ "llm.message": {
344
+ "status": "success",
345
+ "output": {"content": "Mocked response"}
346
+ }
347
+ }
348
+ )
329
349
  ```
330
350
 
351
+ **Replay Mode Refresh:**
352
+ The `refresh` parameter forces a fresh API call while staying in replay mode:
353
+ - First run: Executes and caches the response
354
+ - Subsequent runs: Uses cached response (free!)
355
+ - With refresh: Bypasses cache, gets fresh response, updates cache
356
+
357
+ Perfect for updating cached responses after bot changes without switching modes.
358
+
331
359
  ## Testing Agents
332
360
 
333
361
  Write fast, parallel agent tests using `agent_test_*` functions:
@@ -358,8 +386,17 @@ erdo agent-test tests/test_my_agent.py
358
386
 
359
387
  # Verbose output
360
388
  erdo agent-test tests/test_my_agent.py --verbose
389
+
390
+ # Refresh cached responses (bypass cache for all replay mode tests)
391
+ erdo agent-test tests/test_my_agent.py --refresh
361
392
  ```
362
393
 
394
+ **Refresh Flag:**
395
+ The `--refresh` flag forces all tests using `mode="replay"` to bypass cache and get fresh responses. Perfect for:
396
+ - Updating cached responses after bot changes
397
+ - Verifying tests with current LLM behavior
398
+ - No code changes needed - just add the flag!
399
+
363
400
  ### Test Helpers
364
401
 
365
402
  The `erdo.test` module provides assertion helpers:
@@ -277,18 +277,46 @@ else:
277
277
 
278
278
  ### Invocation Modes
279
279
 
280
- - **Live Mode** (default): Runs against real backend with LLM API
281
- - **Replay Mode**: Uses cached responses - free after first run (perfect for testing!)
282
- - **Mock Mode**: Returns synthetic responses - always free
280
+ Control how bot actions are executed for testing and development:
281
+
282
+ | Mode | Description | Cost |
283
+ |------|-------------|------|
284
+ | **live** | Execute with real API calls | $$$ per run |
285
+ | **replay** | Cache responses, replay on subsequent runs | $$$ first run, FREE after |
286
+ | **manual** | Use developer-provided mock responses | FREE always |
283
287
 
284
288
  ```python
285
- # Replay mode - free after first run
289
+ # Live mode (default) - real API calls
290
+ response = invoke("my-agent", messages=[...], mode="live")
291
+
292
+ # Replay mode - cache after first run (recommended for testing!)
286
293
  response = invoke("my-agent", messages=[...], mode="replay")
287
294
 
288
- # Mock mode - always free
289
- response = invoke("my-agent", messages=[...], mode="mock")
295
+ # Replay with refresh - bypass cache, get fresh response
296
+ response = invoke("my-agent", messages=[...], mode={"mode": "replay", "refresh": True})
297
+
298
+ # Manual mode - use mock responses
299
+ response = invoke(
300
+ "my-agent",
301
+ messages=[...],
302
+ mode="manual",
303
+ manual_mocks={
304
+ "llm.message": {
305
+ "status": "success",
306
+ "output": {"content": "Mocked response"}
307
+ }
308
+ }
309
+ )
290
310
  ```
291
311
 
312
+ **Replay Mode Refresh:**
313
+ The `refresh` parameter forces a fresh API call while staying in replay mode:
314
+ - First run: Executes and caches the response
315
+ - Subsequent runs: Uses cached response (free!)
316
+ - With refresh: Bypasses cache, gets fresh response, updates cache
317
+
318
+ Perfect for updating cached responses after bot changes without switching modes.
319
+
292
320
  ## Testing Agents
293
321
 
294
322
  Write fast, parallel agent tests using `agent_test_*` functions:
@@ -319,8 +347,17 @@ erdo agent-test tests/test_my_agent.py
319
347
 
320
348
  # Verbose output
321
349
  erdo agent-test tests/test_my_agent.py --verbose
350
+
351
+ # Refresh cached responses (bypass cache for all replay mode tests)
352
+ erdo agent-test tests/test_my_agent.py --refresh
322
353
  ```
323
354
 
355
+ **Refresh Flag:**
356
+ The `--refresh` flag forces all tests using `mode="replay"` to bypass cache and get fresh responses. Perfect for:
357
+ - Updating cached responses after bot changes
358
+ - Verifying tests with current LLM behavior
359
+ - No code changes needed - just add the flag!
360
+
324
361
  ### Test Helpers
325
362
 
326
363
  The `erdo.test` module provides assertion helpers:
@@ -10,8 +10,8 @@ from ._generated.condition import __all__ as condition_all
10
10
  from ._generated.types import * # noqa: F403,F401
11
11
  from ._generated.types import __all__ as generated_all
12
12
 
13
- # Import invoke function for production and testing
14
- from .invoke import invoke # noqa: F401
13
+ # Import invoke functions
14
+ from .invoke.invoke import invoke, invoke_agent, invoke_by_key # noqa: F401
15
15
 
16
16
  # Import state object for template support
17
17
  from .state import state # noqa: F401
@@ -28,6 +28,6 @@ __all__.extend(handwritten_all)
28
28
  __all__.extend(generated_all)
29
29
  __all__.extend(condition_all)
30
30
 
31
- # Add state and invoke to __all__ for explicit import
31
+ # Add state and invoke functions to __all__ for explicit import
32
32
  __all__.append("state")
33
- __all__.append("invoke")
33
+ __all__.extend(["invoke", "invoke_agent", "invoke_by_key"])
@@ -9,6 +9,8 @@ NOTE: This module is hardcoded because bot.invoke requires bot_name parameter
9
9
  but the Go struct uses bot_id. The backend converts bot_name -> bot_id internally.
10
10
  """
11
11
 
12
+ from __future__ import annotations
13
+
12
14
  from typing import Any, Dict, Optional, Union
13
15
 
14
16
  from pydantic import BaseModel
@@ -175,6 +177,10 @@ def ask(
175
177
  return AskParams(**params_dict)
176
178
 
177
179
 
180
+ # Rebuild models to resolve forward references (needed for Python 3.10+)
181
+ InvokeParams.model_rebuild()
182
+ AskParams.model_rebuild()
183
+
178
184
  # Associate parameter classes with their result types
179
185
  InvokeParams._result = InvokeResult
180
186
  AskParams._result = AskResult
@@ -8,7 +8,7 @@ Actual execution happens in the Go backend after syncing.
8
8
 
9
9
  from typing import Any, Optional, Union
10
10
 
11
- from pydantic import BaseModel, Field
11
+ from pydantic import BaseModel, Field, model_serializer
12
12
 
13
13
  from erdo.template import TemplateString
14
14
 
@@ -41,6 +41,37 @@ class ExecuteParams(BaseActionParams):
41
41
  )
42
42
  storage_config: Optional[Any] = None # storage_config parameter
43
43
 
44
+ @model_serializer
45
+ def _serialize_model(self) -> dict:
46
+ """Custom serializer to preserve PythonFile._type marker in code_files."""
47
+ # Serialize code_files first
48
+ serialized_code_files = None
49
+ if self.code_files is not None and isinstance(self.code_files, list):
50
+ serialized_code_files = []
51
+ for item in self.code_files:
52
+ if hasattr(item, "model_dump") and callable(
53
+ getattr(item, "model_dump")
54
+ ):
55
+ # Use Pydantic's serialization which respects @model_serializer
56
+ serialized_code_files.append(item.model_dump())
57
+ elif hasattr(item, "to_dict") and callable(getattr(item, "to_dict")):
58
+ serialized_code_files.append(item.to_dict())
59
+ else:
60
+ serialized_code_files.append(item)
61
+
62
+ # Build full serialization
63
+ return {
64
+ "name": self.name,
65
+ "step_metadata": self.step_metadata,
66
+ "entrypoint": self.entrypoint,
67
+ "code_files": serialized_code_files,
68
+ "resources": self.resources,
69
+ "parameters": self.parameters,
70
+ "encryption_key": self.encryption_key,
71
+ "timeout_seconds": self.timeout_seconds,
72
+ "storage_config": self.storage_config,
73
+ }
74
+
44
75
 
45
76
  class ParseFileAsBotResourceParams(BaseActionParams):
46
77
  """Parse a file from code execution results into a bot resource with dataset and analysis parameters"""
@@ -9,6 +9,8 @@ NOTE: This module is hardcoded to provide bot-compatible parameter names
9
9
  that match the exported bot code format.
10
10
  """
11
11
 
12
+ from __future__ import annotations
13
+
12
14
  from typing import Any, Dict, List, Optional, Union
13
15
 
14
16
  from pydantic import BaseModel
@@ -139,5 +141,8 @@ def message(
139
141
  return MessageParams(**params_dict)
140
142
 
141
143
 
144
+ # Rebuild models to resolve forward references (needed for Python 3.10+)
145
+ MessageParams.model_rebuild()
146
+
142
147
  # Associate parameter classes with their result types
143
148
  MessageParams._result = MessageResult