iointel 1.3.2__tar.gz → 1.3.3__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 (75) hide show
  1. {iointel-1.3.2 → iointel-1.3.3}/.gitignore +5 -1
  2. {iointel-1.3.2 → iointel-1.3.3}/PKG-INFO +5 -5
  3. {iointel-1.3.2 → iointel-1.3.3}/README.md +4 -4
  4. {iointel-1.3.2 → iointel-1.3.3}/iointel/__init__.py +1 -1
  5. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agent_methods/data_models/datamodels.py +8 -6
  6. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/chainables.py +8 -6
  7. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/workflow.py +10 -1
  8. {iointel-1.3.2 → iointel-1.3.3}/.gitattributes +0 -0
  9. {iointel-1.3.2 → iointel-1.3.3}/.github/workflows/codeql.yaml +0 -0
  10. {iointel-1.3.2 → iointel-1.3.3}/.github/workflows/linting.yaml +0 -0
  11. {iointel-1.3.2 → iointel-1.3.3}/.github/workflows/release.yaml +0 -0
  12. {iointel-1.3.2 → iointel-1.3.3}/.github/workflows/tests.yaml +0 -0
  13. {iointel-1.3.2 → iointel-1.3.3}/.pre-commit-config.yaml +0 -0
  14. {iointel-1.3.2 → iointel-1.3.3}/LICENSE +0 -0
  15. {iointel-1.3.2 → iointel-1.3.3}/Makefile +0 -0
  16. {iointel-1.3.2 → iointel-1.3.3}/creds.env.example +0 -0
  17. {iointel-1.3.2 → iointel-1.3.3}/iointel/client/__init__.py +0 -0
  18. {iointel-1.3.2 → iointel-1.3.3}/iointel/client/client.py +0 -0
  19. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/__init__.py +0 -0
  20. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agent_methods/__init__.py +0 -0
  21. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agent_methods/agents/__init__.py +0 -0
  22. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agent_methods/agents/agents_factory.py +0 -0
  23. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agent_methods/agents/tool_factory.py +0 -0
  24. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agent_methods/data_models/__init__.py +0 -0
  25. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agent_methods/prompts/__init__.py +0 -0
  26. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agent_methods/prompts/instructions.py +0 -0
  27. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agent_methods/tools/__init__.py +0 -0
  28. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agent_methods/tools/coinmarketcap.py +0 -0
  29. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agent_methods/tools/duckduckgo.py +0 -0
  30. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agent_methods/tools/firecrawl.py +0 -0
  31. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agent_methods/tools/r2r.py +0 -0
  32. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agent_methods/tools/searxng.py +0 -0
  33. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agent_methods/tools/solscan.py +0 -0
  34. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agent_methods/tools/tools.py +0 -0
  35. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agent_methods/tools/utils.py +0 -0
  36. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agent_methods/tools/wolfram.py +0 -0
  37. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agents.py +0 -0
  38. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/code_parsers/__init__.py +0 -0
  39. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/code_parsers/jscode_parser.py +0 -0
  40. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/code_parsers/pycode_parser.py +0 -0
  41. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/memory.py +0 -0
  42. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/task.py +0 -0
  43. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/utilities/constants.py +0 -0
  44. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/utilities/decorators.py +0 -0
  45. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/utilities/exceptions.py +0 -0
  46. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/utilities/func_metadata.py +0 -0
  47. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/utilities/graph_nodes.py +0 -0
  48. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/utilities/helpers.py +0 -0
  49. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/utilities/registries.py +0 -0
  50. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/utilities/rich.py +0 -0
  51. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/utilities/runners.py +0 -0
  52. {iointel-1.3.2 → iointel-1.3.3}/iointel/src/utilities/stages.py +0 -0
  53. {iointel-1.3.2 → iointel-1.3.3}/pyproject.toml +0 -0
  54. {iointel-1.3.2 → iointel-1.3.3}/test-runner +0 -0
  55. {iointel-1.3.2 → iointel-1.3.3}/tests/conftest.py +0 -0
  56. {iointel-1.3.2 → iointel-1.3.3}/tests/test_agents.py +0 -0
  57. {iointel-1.3.2 → iointel-1.3.3}/tests/test_client.py +0 -0
  58. {iointel-1.3.2 → iointel-1.3.3}/tests/test_stages.py +0 -0
  59. {iointel-1.3.2 → iointel-1.3.3}/tests/test_tasks.py +0 -0
  60. {iointel-1.3.2 → iointel-1.3.3}/tests/test_tools_isolated/test_coinmarketcap.py +0 -0
  61. {iointel-1.3.2 → iointel-1.3.3}/tests/test_tools_isolated/test_duckduckgo.py +0 -0
  62. {iointel-1.3.2 → iointel-1.3.3}/tests/test_tools_isolated/test_firecrawl_tool.py +0 -0
  63. {iointel-1.3.2 → iointel-1.3.3}/tests/test_tools_isolated/test_r2r.py +0 -0
  64. {iointel-1.3.2 → iointel-1.3.3}/tests/test_tools_isolated/test_searxng.py +0 -0
  65. {iointel-1.3.2 → iointel-1.3.3}/tests/test_tools_isolated/test_solscan.py +0 -0
  66. {iointel-1.3.2 → iointel-1.3.3}/tests/test_tools_isolated/test_wolfram.py +0 -0
  67. {iointel-1.3.2 → iointel-1.3.3}/tests/test_tools_with_agents/test_basic_agent_tools.py +0 -0
  68. {iointel-1.3.2 → iointel-1.3.3}/tests/test_tools_with_agents/test_coinmarketcap_agent.py +0 -0
  69. {iointel-1.3.2 → iointel-1.3.3}/tests/test_tools_with_agents/test_crawl_agent.py +0 -0
  70. {iointel-1.3.2 → iointel-1.3.3}/tests/test_tools_with_agents/test_duckduckgo_agent.py +0 -0
  71. {iointel-1.3.2 → iointel-1.3.3}/tests/test_tools_with_agents/test_searxng_agent.py +0 -0
  72. {iointel-1.3.2 → iointel-1.3.3}/tests/test_tools_with_agents/test_wolframalpha_agent.py +0 -0
  73. {iointel-1.3.2 → iointel-1.3.3}/tests/test_utilities.py +0 -0
  74. {iointel-1.3.2 → iointel-1.3.3}/tests/test_workflows.py +0 -0
  75. {iointel-1.3.2 → iointel-1.3.3}/uv.lock +0 -0
@@ -11,4 +11,8 @@ dist
11
11
  .idea
12
12
 
13
13
  *.ipynb
14
- *.ipynb_checkpoints
14
+ *.ipynb_checkpoints
15
+
16
+ # virtual environments
17
+ venv
18
+ .venv
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: iointel
3
- Version: 1.3.2
3
+ Version: 1.3.3
4
4
  Summary: A framework to create agents, tasks, and workflows.
5
5
  License-File: LICENSE
6
6
  Keywords: AI,Agents,LLM,framework,tools
@@ -117,7 +117,7 @@ Users can define tasks (like `sentiment`, `translate_text`, etc.) in a **local**
117
117
 
118
118
  - A **task** is a single step in a workflow, e.g., `schedule_reminder`, `sentiment`, `translate_text`, etc.
119
119
  - Tasks are managed by the `Workflow` class in `workflow.py`.
120
- - Tasks can be chained for multi-step logic into a workflow (e.g., `await Workflow(text="...").translate_text().sentiment().run_tasks()`).
120
+ - Tasks can be chained for multi-step logic into a workflow (e.g., `await Workflow(objective="...").translate_text().sentiment().run_tasks()`).
121
121
 
122
122
  ### Client Mode vs Local Mode<a id="client-mode-vs-local-mode"></a>
123
123
 
@@ -199,7 +199,7 @@ In Python code, you can create tasks by instantiating the Tasks class and chaini
199
199
  ```python
200
200
  from iointel import Workflow
201
201
 
202
- tasks = Workflow(text="This is the text to analyze", client_mode=False)
202
+ tasks = Workflow(objective="This is the text to analyze", client_mode=False)
203
203
  (
204
204
  tasks
205
205
  .sentiment(agents=[my_agent])
@@ -214,14 +214,14 @@ Because client_mode=False, everything runs locally.
214
214
  ### Running a Local Workflow<a id="running-a-local-workflow"></a>
215
215
 
216
216
  ```python
217
- tasks = Workflow(text="Breaking news: local sports team wins!", client_mode=False)
217
+ tasks = Workflow(objective="Breaking news: local sports team wins!", client_mode=False)
218
218
  await tasks.summarize_text(max_words=50).run_tasks()
219
219
  ```
220
220
 
221
221
  ### Running a Remote Workflow (Client Mode)<a id="running-a-remote-workflow-client-mode"></a>
222
222
 
223
223
  ```python
224
- tasks = Workflow(text="Breaking news: local sports team wins!", client_mode=True)
224
+ tasks = Workflow(objective="Breaking news: local sports team wins!", client_mode=True)
225
225
  await tasks.summarize_text(max_words=50).run_tasks()
226
226
  ```
227
227
  Now, summarize_text calls the client function (e.g., summarize_task(...)) instead of local logic.
@@ -84,7 +84,7 @@ Users can define tasks (like `sentiment`, `translate_text`, etc.) in a **local**
84
84
 
85
85
  - A **task** is a single step in a workflow, e.g., `schedule_reminder`, `sentiment`, `translate_text`, etc.
86
86
  - Tasks are managed by the `Workflow` class in `workflow.py`.
87
- - Tasks can be chained for multi-step logic into a workflow (e.g., `await Workflow(text="...").translate_text().sentiment().run_tasks()`).
87
+ - Tasks can be chained for multi-step logic into a workflow (e.g., `await Workflow(objective="...").translate_text().sentiment().run_tasks()`).
88
88
 
89
89
  ### Client Mode vs Local Mode<a id="client-mode-vs-local-mode"></a>
90
90
 
@@ -166,7 +166,7 @@ In Python code, you can create tasks by instantiating the Tasks class and chaini
166
166
  ```python
167
167
  from iointel import Workflow
168
168
 
169
- tasks = Workflow(text="This is the text to analyze", client_mode=False)
169
+ tasks = Workflow(objective="This is the text to analyze", client_mode=False)
170
170
  (
171
171
  tasks
172
172
  .sentiment(agents=[my_agent])
@@ -181,14 +181,14 @@ Because client_mode=False, everything runs locally.
181
181
  ### Running a Local Workflow<a id="running-a-local-workflow"></a>
182
182
 
183
183
  ```python
184
- tasks = Workflow(text="Breaking news: local sports team wins!", client_mode=False)
184
+ tasks = Workflow(objective="Breaking news: local sports team wins!", client_mode=False)
185
185
  await tasks.summarize_text(max_words=50).run_tasks()
186
186
  ```
187
187
 
188
188
  ### Running a Remote Workflow (Client Mode)<a id="running-a-remote-workflow-client-mode"></a>
189
189
 
190
190
  ```python
191
- tasks = Workflow(text="Breaking news: local sports team wins!", client_mode=True)
191
+ tasks = Workflow(objective="Breaking news: local sports team wins!", client_mode=True)
192
192
  await tasks.summarize_text(max_words=50).run_tasks()
193
193
  ```
194
194
  Now, summarize_text calls the client function (e.g., summarize_task(...)) instead of local logic.
@@ -45,4 +45,4 @@ __all__ = [
45
45
  ]
46
46
 
47
47
 
48
- __version__ = "1.3.2"
48
+ __version__ = "1.3.3"
@@ -446,12 +446,6 @@ class TranslationResult(BaseModel):
446
446
  Activation = Annotated[float, Field(ge=0, le=1)]
447
447
 
448
448
 
449
- class ModerationException(Exception):
450
- """Exception raised when a message is not allowed."""
451
-
452
- ...
453
-
454
-
455
449
  class ViolationActivation(TypedDict):
456
450
  """Violation activation."""
457
451
 
@@ -463,6 +457,14 @@ class ViolationActivation(TypedDict):
463
457
  dangerous_content: Activation
464
458
 
465
459
 
460
+ class ModerationException(Exception):
461
+ """Exception raised when a message is not allowed."""
462
+
463
+ def __init__(self, *args, violations: ViolationActivation):
464
+ super().__init__(*args)
465
+ self.violations = violations
466
+
467
+
466
468
  ##### task and workflow models ########
467
469
  class BaseStage(BaseModel):
468
470
  stage_id: Optional[int] = None
@@ -225,17 +225,19 @@ async def execute_moderation(
225
225
  ).execute()
226
226
 
227
227
  if result["extreme_profanity"] > threshold:
228
- raise ModerationException("Extreme profanity detected")
228
+ raise ModerationException("Extreme profanity detected", violations=result)
229
229
  elif result["sexually_explicit"] > threshold:
230
- raise ModerationException("Sexually explicit content detected")
230
+ raise ModerationException(
231
+ "Sexually explicit content detected", violations=result
232
+ )
231
233
  elif result["hate_speech"] > threshold:
232
- raise ModerationException("Hate speech detected")
234
+ raise ModerationException("Hate speech detected", violations=result)
233
235
  elif result["harassment"] > threshold:
234
- raise ModerationException("Harassment detected")
236
+ raise ModerationException("Harassment detected", violations=result)
235
237
  elif result["self_harm"] > threshold:
236
- raise ModerationException("Self harm detected")
238
+ raise ModerationException("Self harm detected", violations=result)
237
239
  elif result["dangerous_content"] > threshold:
238
- raise ModerationException("Dangeme profanity detected")
240
+ raise ModerationException("Dangeme profanity detected", violations=result)
239
241
 
240
242
  return result
241
243
 
@@ -1,6 +1,7 @@
1
1
  from typing import List, Optional, Any
2
2
  import uuid
3
3
  import inspect
4
+ import warnings
4
5
  import yaml
5
6
  from pathlib import Path
6
7
  from collections import defaultdict
@@ -59,7 +60,7 @@ class Workflow:
59
60
  Manages a chain of tasks and runs them sequentially.
60
61
 
61
62
  Example usage:
62
- workflow = Workflow(text="Some input text", client_mode=False, agents=[swarm])
63
+ workflow = Workflow(objective="Some input text", client_mode=False, agents=[swarm])
63
64
  workflow.summarize_text(max_words=50).custom(name="do-fancy-thing", objective="Fancy step", agents=[my_agent])
64
65
  results = await workflow.run_tasks()
65
66
  """
@@ -67,9 +68,17 @@ class Workflow:
67
68
  def __init__(
68
69
  self,
69
70
  objective: str = "",
71
+ text: str | None = None,
70
72
  client_mode: bool = True,
71
73
  agents: Optional[List[Any]] = None,
72
74
  ):
75
+ if text is not None:
76
+ if objective:
77
+ raise ValueError("Both `text` and `objective` parameters set")
78
+ objective = text
79
+ warnings.warn(
80
+ "`text` parameter is deprecated, please use `objective` instead"
81
+ )
73
82
  self.tasks: List[dict] = []
74
83
  self.objective = objective
75
84
  self.client_mode = client_mode
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