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.
- {iointel-1.3.2 → iointel-1.3.3}/.gitignore +5 -1
- {iointel-1.3.2 → iointel-1.3.3}/PKG-INFO +5 -5
- {iointel-1.3.2 → iointel-1.3.3}/README.md +4 -4
- {iointel-1.3.2 → iointel-1.3.3}/iointel/__init__.py +1 -1
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agent_methods/data_models/datamodels.py +8 -6
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/chainables.py +8 -6
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/workflow.py +10 -1
- {iointel-1.3.2 → iointel-1.3.3}/.gitattributes +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/.github/workflows/codeql.yaml +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/.github/workflows/linting.yaml +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/.github/workflows/release.yaml +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/.github/workflows/tests.yaml +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/.pre-commit-config.yaml +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/LICENSE +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/Makefile +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/creds.env.example +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/iointel/client/__init__.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/iointel/client/client.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/__init__.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agent_methods/__init__.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agent_methods/agents/__init__.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agent_methods/agents/agents_factory.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agent_methods/agents/tool_factory.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agent_methods/data_models/__init__.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agent_methods/prompts/__init__.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agent_methods/prompts/instructions.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agent_methods/tools/__init__.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agent_methods/tools/coinmarketcap.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agent_methods/tools/duckduckgo.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agent_methods/tools/firecrawl.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agent_methods/tools/r2r.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agent_methods/tools/searxng.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agent_methods/tools/solscan.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agent_methods/tools/tools.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agent_methods/tools/utils.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agent_methods/tools/wolfram.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/agents.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/code_parsers/__init__.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/code_parsers/jscode_parser.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/code_parsers/pycode_parser.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/memory.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/task.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/utilities/constants.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/utilities/decorators.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/utilities/exceptions.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/utilities/func_metadata.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/utilities/graph_nodes.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/utilities/helpers.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/utilities/registries.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/utilities/rich.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/utilities/runners.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/iointel/src/utilities/stages.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/pyproject.toml +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/test-runner +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/tests/conftest.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/tests/test_agents.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/tests/test_client.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/tests/test_stages.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/tests/test_tasks.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/tests/test_tools_isolated/test_coinmarketcap.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/tests/test_tools_isolated/test_duckduckgo.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/tests/test_tools_isolated/test_firecrawl_tool.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/tests/test_tools_isolated/test_r2r.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/tests/test_tools_isolated/test_searxng.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/tests/test_tools_isolated/test_solscan.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/tests/test_tools_isolated/test_wolfram.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/tests/test_tools_with_agents/test_basic_agent_tools.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/tests/test_tools_with_agents/test_coinmarketcap_agent.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/tests/test_tools_with_agents/test_crawl_agent.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/tests/test_tools_with_agents/test_duckduckgo_agent.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/tests/test_tools_with_agents/test_searxng_agent.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/tests/test_tools_with_agents/test_wolframalpha_agent.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/tests/test_utilities.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/tests/test_workflows.py +0 -0
- {iointel-1.3.2 → iointel-1.3.3}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: iointel
|
|
3
|
-
Version: 1.3.
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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.
|
|
@@ -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(
|
|
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(
|
|
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
|
|
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
|
|
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
|