iointel 1.3.1__tar.gz → 1.3.2__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.1 → iointel-1.3.2}/PKG-INFO +1 -1
- {iointel-1.3.1 → iointel-1.3.2}/iointel/__init__.py +4 -4
- {iointel-1.3.1 → iointel-1.3.2}/iointel/src/agent_methods/data_models/datamodels.py +1 -1
- {iointel-1.3.1 → iointel-1.3.2}/iointel/src/agents.py +3 -3
- iointel-1.3.2/iointel/src/utilities/rich.py +39 -0
- {iointel-1.3.1 → iointel-1.3.2}/iointel/src/workflow.py +13 -2
- iointel-1.3.2/tests/test_utilities.py +18 -0
- iointel-1.3.1/iointel/src/utilities/magic.py +0 -9
- iointel-1.3.1/iointel/src/utilities/rich.py +0 -6
- {iointel-1.3.1 → iointel-1.3.2}/.gitattributes +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/.github/workflows/codeql.yaml +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/.github/workflows/linting.yaml +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/.github/workflows/release.yaml +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/.github/workflows/tests.yaml +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/.gitignore +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/.pre-commit-config.yaml +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/LICENSE +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/Makefile +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/README.md +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/creds.env.example +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/iointel/client/__init__.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/iointel/client/client.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/iointel/src/__init__.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/iointel/src/agent_methods/__init__.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/iointel/src/agent_methods/agents/__init__.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/iointel/src/agent_methods/agents/agents_factory.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/iointel/src/agent_methods/agents/tool_factory.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/iointel/src/agent_methods/data_models/__init__.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/iointel/src/agent_methods/prompts/__init__.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/iointel/src/agent_methods/prompts/instructions.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/iointel/src/agent_methods/tools/__init__.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/iointel/src/agent_methods/tools/coinmarketcap.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/iointel/src/agent_methods/tools/duckduckgo.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/iointel/src/agent_methods/tools/firecrawl.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/iointel/src/agent_methods/tools/r2r.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/iointel/src/agent_methods/tools/searxng.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/iointel/src/agent_methods/tools/solscan.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/iointel/src/agent_methods/tools/tools.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/iointel/src/agent_methods/tools/utils.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/iointel/src/agent_methods/tools/wolfram.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/iointel/src/chainables.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/iointel/src/code_parsers/__init__.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/iointel/src/code_parsers/jscode_parser.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/iointel/src/code_parsers/pycode_parser.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/iointel/src/memory.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/iointel/src/task.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/iointel/src/utilities/constants.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/iointel/src/utilities/decorators.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/iointel/src/utilities/exceptions.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/iointel/src/utilities/func_metadata.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/iointel/src/utilities/graph_nodes.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/iointel/src/utilities/helpers.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/iointel/src/utilities/registries.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/iointel/src/utilities/runners.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/iointel/src/utilities/stages.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/pyproject.toml +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/test-runner +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/tests/conftest.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/tests/test_agents.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/tests/test_client.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/tests/test_stages.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/tests/test_tasks.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/tests/test_tools_isolated/test_coinmarketcap.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/tests/test_tools_isolated/test_duckduckgo.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/tests/test_tools_isolated/test_firecrawl_tool.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/tests/test_tools_isolated/test_r2r.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/tests/test_tools_isolated/test_searxng.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/tests/test_tools_isolated/test_solscan.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/tests/test_tools_isolated/test_wolfram.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/tests/test_tools_with_agents/test_basic_agent_tools.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/tests/test_tools_with_agents/test_coinmarketcap_agent.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/tests/test_tools_with_agents/test_crawl_agent.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/tests/test_tools_with_agents/test_duckduckgo_agent.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/tests/test_tools_with_agents/test_searxng_agent.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/tests/test_tools_with_agents/test_wolframalpha_agent.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/tests/test_workflows.py +0 -0
- {iointel-1.3.1 → iointel-1.3.2}/uv.lock +0 -0
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
from .src.utilities.magic import (
|
|
2
|
-
UNUSED as UNUSED,
|
|
3
|
-
) # this performs some magic to stop prefect mucking with logging setup
|
|
4
1
|
from .src.agents import Agent
|
|
5
2
|
from .src.memory import AsyncMemory
|
|
6
3
|
from .src.workflow import Workflow
|
|
@@ -8,6 +5,7 @@ from .src.utilities.runners import run_agents, run_agents_stream
|
|
|
8
5
|
from .src.agent_methods.tools.wolfram import query_wolfram
|
|
9
6
|
from .src.agent_methods.data_models.datamodels import PersonaConfig
|
|
10
7
|
from .src.utilities.decorators import register_custom_task, register_tool
|
|
8
|
+
from .src.utilities.rich import pretty_output
|
|
11
9
|
|
|
12
10
|
from .src.code_parsers.pycode_parser import (
|
|
13
11
|
PythonModule,
|
|
@@ -42,7 +40,9 @@ __all__ = [
|
|
|
42
40
|
"PythonCodeGenerator",
|
|
43
41
|
###tools###
|
|
44
42
|
"query_wolfram",
|
|
43
|
+
###configuration###
|
|
44
|
+
"pretty_output",
|
|
45
45
|
]
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
__version__ = "1.3.
|
|
48
|
+
__version__ = "1.3.2"
|
|
@@ -406,7 +406,7 @@ class AgentParams(BaseModel):
|
|
|
406
406
|
description="Context to be passed to the agent.",
|
|
407
407
|
)
|
|
408
408
|
# memories: Optional[list[Memory]] = Field(default_factory=list)
|
|
409
|
-
memory: Optional[AsyncMemory] =
|
|
409
|
+
memory: Optional[AsyncMemory] = None
|
|
410
410
|
|
|
411
411
|
model_settings: Optional[Dict[str, Any]] = Field(default_factory=dict)
|
|
412
412
|
output_type: Optional[Any] = str
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from .memory import AsyncMemory
|
|
2
2
|
from .agent_methods.data_models.datamodels import PersonaConfig, Tool
|
|
3
|
-
from .utilities.rich import console
|
|
3
|
+
from .utilities.rich import console, pretty_output
|
|
4
4
|
from .utilities.constants import get_api_url, get_base_model, get_api_key
|
|
5
5
|
from .utilities.registries import TOOLS_REGISTRY
|
|
6
6
|
from .utilities.helpers import supports_tool_choice_required
|
|
@@ -230,7 +230,7 @@ class Agent(BaseModel):
|
|
|
230
230
|
self,
|
|
231
231
|
query: str,
|
|
232
232
|
conversation_id: Optional[str] = None,
|
|
233
|
-
pretty=
|
|
233
|
+
pretty=None,
|
|
234
234
|
message_history_limit=100,
|
|
235
235
|
**kwargs,
|
|
236
236
|
):
|
|
@@ -281,7 +281,7 @@ class Agent(BaseModel):
|
|
|
281
281
|
await self.memory.store_run_history(conversation_id, result)
|
|
282
282
|
except Exception as e:
|
|
283
283
|
print("Error storing run history:", e)
|
|
284
|
-
if pretty:
|
|
284
|
+
if pretty or (pretty is None and pretty_output.is_enabled):
|
|
285
285
|
task_header = Text(
|
|
286
286
|
f" Objective: {query} ", style="bold white on dark_green"
|
|
287
287
|
)
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
from contextlib import contextmanager
|
|
2
|
+
from rich.console import Console
|
|
3
|
+
from rich.theme import Theme
|
|
4
|
+
|
|
5
|
+
custom_theme = Theme({"electric_blue": "#7DF9FF"})
|
|
6
|
+
|
|
7
|
+
console = Console(theme=custom_theme)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class PrettyController:
|
|
11
|
+
def __init__(self):
|
|
12
|
+
self._enabled = True
|
|
13
|
+
|
|
14
|
+
@property
|
|
15
|
+
def is_enabled(self):
|
|
16
|
+
return self._enabled
|
|
17
|
+
|
|
18
|
+
def _onoff(self, enabled: bool):
|
|
19
|
+
@contextmanager
|
|
20
|
+
def inner(this=self):
|
|
21
|
+
old_value, this._enabled = this._enabled, enabled
|
|
22
|
+
try:
|
|
23
|
+
yield this
|
|
24
|
+
finally:
|
|
25
|
+
this._enabled = old_value
|
|
26
|
+
|
|
27
|
+
return inner()
|
|
28
|
+
|
|
29
|
+
def enabled(self):
|
|
30
|
+
return self._onoff(True)
|
|
31
|
+
|
|
32
|
+
def disabled(self):
|
|
33
|
+
return self._onoff(False)
|
|
34
|
+
|
|
35
|
+
def global_onoff(self, enabled: bool):
|
|
36
|
+
self._enabled = enabled
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
pretty_output = PrettyController()
|
|
@@ -28,6 +28,7 @@ from .utilities.stages import (
|
|
|
28
28
|
WhileStage,
|
|
29
29
|
FallbackStage,
|
|
30
30
|
)
|
|
31
|
+
from .utilities.rich import pretty_output
|
|
31
32
|
|
|
32
33
|
from .utilities.graph_nodes import WorkflowState, TaskNode, make_task_node
|
|
33
34
|
from pydantic_graph import Graph, End, GraphRunContext
|
|
@@ -225,7 +226,11 @@ class Workflow:
|
|
|
225
226
|
result = await result.execute()
|
|
226
227
|
return result
|
|
227
228
|
|
|
228
|
-
async def execute_graph_streaming(
|
|
229
|
+
async def execute_graph_streaming(
|
|
230
|
+
self, graph, initial_state, pretty: Optional[bool] = None
|
|
231
|
+
):
|
|
232
|
+
if pretty is None:
|
|
233
|
+
pretty = pretty_output.is_enabled
|
|
229
234
|
nodes = list(graph.node_defs.values())
|
|
230
235
|
total_tasks = len(nodes)
|
|
231
236
|
|
|
@@ -240,6 +245,7 @@ class Workflow:
|
|
|
240
245
|
TaskProgressColumn(),
|
|
241
246
|
TimeElapsedColumn(),
|
|
242
247
|
transient=True,
|
|
248
|
+
disable=not pretty,
|
|
243
249
|
) as progress:
|
|
244
250
|
task_progress = progress.add_task(
|
|
245
251
|
"[cyan]Executing Tasks...", total=total_tasks
|
|
@@ -295,7 +301,11 @@ class Workflow:
|
|
|
295
301
|
|
|
296
302
|
return state
|
|
297
303
|
|
|
298
|
-
async def execute_graph(
|
|
304
|
+
async def execute_graph(
|
|
305
|
+
self, graph: Graph, initial_state: WorkflowState, pretty: Optional[bool] = None
|
|
306
|
+
):
|
|
307
|
+
if pretty is None:
|
|
308
|
+
pretty = pretty_output.is_enabled
|
|
299
309
|
nodes = list(graph.node_defs.values())
|
|
300
310
|
total_tasks = len(nodes)
|
|
301
311
|
|
|
@@ -306,6 +316,7 @@ class Workflow:
|
|
|
306
316
|
TaskProgressColumn(),
|
|
307
317
|
TimeElapsedColumn(),
|
|
308
318
|
transient=True,
|
|
319
|
+
disable=not pretty,
|
|
309
320
|
) as progress:
|
|
310
321
|
task_progress = progress.add_task(
|
|
311
322
|
"[cyan]Executing Tasks...", total=total_tasks
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from iointel import pretty_output
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def test_pretty_context():
|
|
5
|
+
assert pretty_output.is_enabled, "Pretty output not enabled"
|
|
6
|
+
with pretty_output.disabled() as ctx:
|
|
7
|
+
assert not pretty_output.is_enabled, "Pretty output not disabled"
|
|
8
|
+
assert ctx is pretty_output, "Wrong context manager instance"
|
|
9
|
+
assert pretty_output.is_enabled, "Pretty output not enabled"
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def test_pretty_global():
|
|
13
|
+
assert pretty_output.is_enabled, "Pretty output not enabled"
|
|
14
|
+
try:
|
|
15
|
+
pretty_output.global_onoff(False)
|
|
16
|
+
assert not pretty_output.is_enabled, "Pretty output not disabled"
|
|
17
|
+
finally:
|
|
18
|
+
pretty_output.global_onoff(True)
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
# turn off most prefect log messages, as they aren't useful
|
|
5
|
-
# to end user, but might hurt UX for inexperienced ones
|
|
6
|
-
for env_name in ("PREFECT_LOGGING_SERVER_LEVEL", "PREFECT_LOGGING_LEVEL"):
|
|
7
|
-
os.environ[env_name] = os.environ.get(env_name, "CRITICAL")
|
|
8
|
-
|
|
9
|
-
UNUSED = None
|
|
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
|