waldiez 0.5.6__py3-none-any.whl → 0.5.8__py3-none-any.whl
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 waldiez might be problematic. Click here for more details.
- waldiez/_version.py +1 -1
- waldiez/cli.py +17 -2
- waldiez/exporter.py +1 -1
- waldiez/exporting/agent/code_execution.py +8 -1
- waldiez/exporting/agent/exporter.py +2 -1
- waldiez/exporting/agent/extras/captain_agent_extras.py +1 -0
- waldiez/exporting/agent/extras/doc_agent_extras.py +2 -3
- waldiez/exporting/agent/extras/group_manager_agent_extas.py +1 -0
- waldiez/exporting/agent/extras/handoffs/after_work.py +4 -4
- waldiez/exporting/agent/extras/handoffs/target.py +3 -0
- waldiez/exporting/agent/extras/rag/chroma_extras.py +0 -4
- waldiez/exporting/agent/extras/rag/mongo_extras.py +0 -1
- waldiez/exporting/agent/extras/rag/pgvector_extras.py +0 -2
- waldiez/exporting/agent/extras/rag/qdrant_extras.py +0 -3
- waldiez/exporting/agent/extras/rag/vector_db_extras.py +3 -2
- waldiez/exporting/agent/factory.py +11 -11
- waldiez/exporting/agent/processor.py +3 -2
- waldiez/exporting/chats/exporter.py +2 -2
- waldiez/exporting/chats/factory.py +5 -5
- waldiez/exporting/chats/processor.py +22 -1
- waldiez/exporting/chats/utils/common.py +45 -1
- waldiez/exporting/chats/utils/group.py +1 -1
- waldiez/exporting/chats/utils/sequential.py +3 -68
- waldiez/exporting/chats/utils/single.py +1 -38
- waldiez/exporting/core/context.py +39 -38
- waldiez/exporting/core/exporter.py +10 -10
- waldiez/exporting/core/exporters.py +36 -0
- waldiez/exporting/core/extras/base.py +2 -2
- waldiez/exporting/core/extras/chat_extras.py +4 -2
- waldiez/exporting/core/extras/path_resolver.py +6 -4
- waldiez/exporting/core/extras/serializer.py +1 -0
- waldiez/exporting/core/protocols.py +6 -0
- waldiez/exporting/core/result.py +8 -7
- waldiez/exporting/core/types.py +2 -2
- waldiez/exporting/core/utils/llm_config.py +2 -0
- waldiez/exporting/flow/execution_generator.py +54 -32
- waldiez/exporting/flow/factory.py +2 -2
- waldiez/exporting/flow/file_generator.py +8 -7
- waldiez/exporting/flow/merger.py +8 -7
- waldiez/exporting/flow/orchestrator.py +22 -8
- waldiez/exporting/flow/utils/__init__.py +2 -0
- waldiez/exporting/flow/utils/common.py +20 -11
- waldiez/exporting/flow/utils/importing.py +2 -1
- waldiez/exporting/flow/utils/logging.py +5 -2
- waldiez/exporting/models/exporter.py +2 -1
- waldiez/exporting/models/factory.py +6 -7
- waldiez/exporting/tools/exporter.py +7 -6
- waldiez/exporting/tools/factory.py +4 -5
- waldiez/exporting/tools/processor.py +9 -4
- waldiez/exporting/tools/registration.py +1 -0
- waldiez/io/_ws.py +2 -0
- waldiez/io/models/content/audio.py +1 -0
- waldiez/io/models/content/file.py +1 -0
- waldiez/io/models/content/image.py +1 -0
- waldiez/io/models/content/text.py +1 -0
- waldiez/io/models/content/video.py +1 -0
- waldiez/io/models/user_input.py +1 -0
- waldiez/io/models/user_response.py +1 -0
- waldiez/io/mqtt.py +6 -3
- waldiez/io/redis.py +7 -9
- waldiez/io/structured.py +8 -6
- waldiez/io/utils.py +11 -4
- waldiez/io/ws.py +4 -3
- waldiez/logger.py +11 -1
- waldiez/models/agents/agent/agent.py +1 -0
- waldiez/models/agents/agent/agent_data.py +2 -2
- waldiez/models/agents/agent/nested_chat.py +1 -4
- waldiez/models/agents/agent/termination_message.py +0 -7
- waldiez/models/agents/agent/update_system_message.py +2 -2
- waldiez/models/agents/doc_agent/doc_agent_data.py +33 -26
- waldiez/models/agents/doc_agent/rag_query_engine.py +1 -1
- waldiez/models/agents/extra_requirements.py +5 -5
- waldiez/models/agents/group_manager/group_manager.py +3 -7
- waldiez/models/agents/group_manager/speakers.py +0 -7
- waldiez/models/agents/rag_user_proxy/rag_user_proxy.py +0 -2
- waldiez/models/agents/rag_user_proxy/rag_user_proxy_data.py +0 -2
- waldiez/models/agents/rag_user_proxy/retrieve_config.py +1 -17
- waldiez/models/agents/rag_user_proxy/vector_db_config.py +0 -5
- waldiez/models/chat/chat_data.py +0 -2
- waldiez/models/chat/chat_summary.py +5 -3
- waldiez/models/common/handoff.py +26 -18
- waldiez/models/common/naming.py +1 -0
- waldiez/models/flow/flow.py +9 -7
- waldiez/models/model/_llm.py +4 -2
- waldiez/models/model/extra_requirements.py +3 -3
- waldiez/models/model/model.py +5 -4
- waldiez/models/tool/extra_requirements.py +2 -2
- waldiez/models/tool/predefined/_google.py +7 -12
- waldiez/models/tool/predefined/_perplexity.py +13 -9
- waldiez/models/tool/predefined/_searxng.py +4 -1
- waldiez/models/tool/predefined/_tavily.py +0 -6
- waldiez/models/tool/predefined/_wikipedia.py +5 -1
- waldiez/models/tool/predefined/_youtube.py +0 -4
- waldiez/models/tool/tool.py +7 -7
- waldiez/models/tool/tool_data.py +39 -2
- waldiez/models/waldiez.py +29 -29
- waldiez/runner.py +18 -13
- waldiez/running/base_runner.py +96 -40
- waldiez/running/environment.py +2 -0
- waldiez/running/patch_io_stream.py +2 -0
- waldiez/running/post_run.py +3 -0
- waldiez/running/pre_run.py +1 -0
- waldiez/running/protocol.py +50 -48
- waldiez/running/run_results.py +2 -10
- waldiez/running/standard_runner.py +37 -13
- waldiez/running/timeline_processor.py +12 -1
- waldiez/running/utils.py +2 -0
- waldiez/utils/conflict_checker.py +1 -1
- waldiez/utils/version.py +1 -0
- {waldiez-0.5.6.dist-info → waldiez-0.5.8.dist-info}/METADATA +68 -65
- {waldiez-0.5.6.dist-info → waldiez-0.5.8.dist-info}/RECORD +115 -116
- waldiez/exporting/agent/extras/group/target.py +0 -178
- {waldiez-0.5.6.dist-info → waldiez-0.5.8.dist-info}/WHEEL +0 -0
- {waldiez-0.5.6.dist-info → waldiez-0.5.8.dist-info}/entry_points.txt +0 -0
- {waldiez-0.5.6.dist-info → waldiez-0.5.8.dist-info}/licenses/LICENSE +0 -0
- {waldiez-0.5.6.dist-info → waldiez-0.5.8.dist-info}/licenses/NOTICE.md +0 -0
waldiez/running/protocol.py
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
# SPDX-License-Identifier: Apache-2.0.
|
|
2
2
|
# Copyright (c) 2024 - 2025 Waldiez and contributors.
|
|
3
|
-
|
|
3
|
+
# pyright: reportReturnType=false
|
|
4
4
|
"""Waldiez Runner protocol."""
|
|
5
5
|
|
|
6
6
|
from pathlib import Path
|
|
7
|
-
from typing import
|
|
8
|
-
|
|
9
|
-
if TYPE_CHECKING:
|
|
10
|
-
from autogen.io.run_response import ( # type: ignore[import-untyped]
|
|
11
|
-
AsyncRunResponseProtocol,
|
|
12
|
-
RunResponseProtocol,
|
|
13
|
-
)
|
|
7
|
+
from typing import Any, Protocol, runtime_checkable
|
|
14
8
|
|
|
15
9
|
|
|
16
10
|
@runtime_checkable
|
|
@@ -63,6 +57,9 @@ class WaldiezRunnerProtocol(Protocol):
|
|
|
63
57
|
uploads_root: str | Path | None,
|
|
64
58
|
structured_io: bool | None = None,
|
|
65
59
|
skip_mmd: bool = False,
|
|
60
|
+
skip_timeline: bool = False,
|
|
61
|
+
dot_env: str | Path | None = None,
|
|
62
|
+
**kwargs: Any,
|
|
66
63
|
) -> None:
|
|
67
64
|
"""Start running the Waldiez flow in a non-blocking way.
|
|
68
65
|
|
|
@@ -78,6 +75,12 @@ class WaldiezRunnerProtocol(Protocol):
|
|
|
78
75
|
Whether to use structured IO instead of the default 'input/print'.
|
|
79
76
|
skip_mmd : bool
|
|
80
77
|
Whether to skip generating the mermaid diagram.
|
|
78
|
+
skip_timeline : bool
|
|
79
|
+
Whether to skip generating the timeline JSON.
|
|
80
|
+
dot_env : str | Path | None
|
|
81
|
+
The path to the .env file, if any.
|
|
82
|
+
**kwargs : Any
|
|
83
|
+
Additional keyword arguments for the start method.
|
|
81
84
|
|
|
82
85
|
Raises
|
|
83
86
|
------
|
|
@@ -91,6 +94,9 @@ class WaldiezRunnerProtocol(Protocol):
|
|
|
91
94
|
uploads_root: str | Path | None,
|
|
92
95
|
structured_io: bool | None = None,
|
|
93
96
|
skip_mmd: bool = False,
|
|
97
|
+
skip_timeline: bool = False,
|
|
98
|
+
dot_env: str | Path | None = None,
|
|
99
|
+
**kwargs: Any,
|
|
94
100
|
) -> None:
|
|
95
101
|
"""Asynchronously start running the Waldiez flow in a non-blocking way.
|
|
96
102
|
|
|
@@ -106,6 +112,12 @@ class WaldiezRunnerProtocol(Protocol):
|
|
|
106
112
|
Whether to use structured IO instead of the default 'input/print'.
|
|
107
113
|
skip_mmd : bool
|
|
108
114
|
Whether to skip generating the mermaid diagram.
|
|
115
|
+
skip_timeline : bool
|
|
116
|
+
Whether to skip generating the timeline JSON.
|
|
117
|
+
dot_env : str | Path | None
|
|
118
|
+
The path to the .env file, if any.
|
|
119
|
+
**kwargs : Any
|
|
120
|
+
Additional keyword arguments for the start method.
|
|
109
121
|
|
|
110
122
|
Raises
|
|
111
123
|
------
|
|
@@ -119,10 +131,10 @@ class WaldiezRunnerProtocol(Protocol):
|
|
|
119
131
|
uploads_root: str | Path | None,
|
|
120
132
|
structured_io: bool | None = None,
|
|
121
133
|
skip_mmd: bool = False,
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
]:
|
|
134
|
+
skip_timeline: bool = False,
|
|
135
|
+
dot_env: str | Path | None = None,
|
|
136
|
+
**kwargs: Any,
|
|
137
|
+
) -> list[dict[str, Any]]:
|
|
126
138
|
"""Run the Waldiez flow in a blocking way.
|
|
127
139
|
|
|
128
140
|
Parameters
|
|
@@ -135,15 +147,17 @@ class WaldiezRunnerProtocol(Protocol):
|
|
|
135
147
|
Whether to use structured IO instead of the default 'input/print'.
|
|
136
148
|
skip_mmd : bool
|
|
137
149
|
Whether to skip generating the mermaid diagram.
|
|
150
|
+
skip_timeline : bool
|
|
151
|
+
Whether to skip generating the timeline JSON.
|
|
152
|
+
dot_env : str | Path | None
|
|
153
|
+
The path to the .env file, if any.
|
|
154
|
+
**kwargs : Any
|
|
155
|
+
Additional keyword arguments for the run method.
|
|
138
156
|
|
|
139
157
|
Returns
|
|
140
158
|
-------
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
list["AsyncRunResponseProtocol"],
|
|
144
|
-
]
|
|
145
|
-
The result of the run, which can be a list of RunResponseProtocol
|
|
146
|
-
or a list of AsyncRunResponseProtocol.
|
|
159
|
+
list[dict[str, Any]]
|
|
160
|
+
The result of the run.
|
|
147
161
|
"""
|
|
148
162
|
|
|
149
163
|
async def a_run(
|
|
@@ -152,10 +166,10 @@ class WaldiezRunnerProtocol(Protocol):
|
|
|
152
166
|
uploads_root: str | Path | None,
|
|
153
167
|
structured_io: bool | None = None,
|
|
154
168
|
skip_mmd: bool = False,
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
]:
|
|
169
|
+
skip_timeline: bool = False,
|
|
170
|
+
dot_env: str | Path | None = None,
|
|
171
|
+
**kwargs: Any,
|
|
172
|
+
) -> list[dict[str, Any]]:
|
|
159
173
|
"""Run the Waldiez flow.
|
|
160
174
|
|
|
161
175
|
Parameters
|
|
@@ -168,23 +182,22 @@ class WaldiezRunnerProtocol(Protocol):
|
|
|
168
182
|
Whether to use structured IO instead of the default 'input/print'.
|
|
169
183
|
skip_mmd : bool
|
|
170
184
|
Whether to skip generating the mermaid diagram.
|
|
185
|
+
skip_timeline : bool
|
|
186
|
+
Whether to skip generating the timeline JSON.
|
|
187
|
+
dot_env : str | Path | None
|
|
188
|
+
The path to the .env file, if any.
|
|
189
|
+
**kwargs : Any
|
|
190
|
+
Additional keyword arguments for the a_run method.
|
|
171
191
|
|
|
172
192
|
Returns
|
|
173
193
|
-------
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
list["AsyncRunResponseProtocol"],
|
|
177
|
-
]
|
|
178
|
-
The result of the run, which can be a list of RunResponseProtocol
|
|
179
|
-
or a list of AsyncRunResponseProtocol.
|
|
194
|
+
list[dict[str, Any]]
|
|
195
|
+
The result of the run.
|
|
180
196
|
"""
|
|
181
197
|
|
|
182
198
|
def after_run(
|
|
183
199
|
self,
|
|
184
|
-
results:
|
|
185
|
-
list["RunResponseProtocol"],
|
|
186
|
-
list["AsyncRunResponseProtocol"],
|
|
187
|
-
],
|
|
200
|
+
results: list[dict[str, Any]],
|
|
188
201
|
output_file: Path,
|
|
189
202
|
uploads_root: Path | None,
|
|
190
203
|
temp_dir: Path,
|
|
@@ -195,12 +208,8 @@ class WaldiezRunnerProtocol(Protocol):
|
|
|
195
208
|
|
|
196
209
|
Parameters
|
|
197
210
|
----------
|
|
198
|
-
results :
|
|
199
|
-
|
|
200
|
-
list["AsyncRunResponseProtocol"],
|
|
201
|
-
]
|
|
202
|
-
The results of the run, which can be a list of RunResponseProtocol
|
|
203
|
-
or a list of AsyncRunResponseProtocol.
|
|
211
|
+
results : list[dict[str, Any]]
|
|
212
|
+
The results of the run.
|
|
204
213
|
output_file : Path
|
|
205
214
|
The path to the output file.
|
|
206
215
|
uploads_root : Path | None
|
|
@@ -215,10 +224,7 @@ class WaldiezRunnerProtocol(Protocol):
|
|
|
215
224
|
|
|
216
225
|
async def a_after_run(
|
|
217
226
|
self,
|
|
218
|
-
results:
|
|
219
|
-
list["RunResponseProtocol"],
|
|
220
|
-
list["AsyncRunResponseProtocol"],
|
|
221
|
-
],
|
|
227
|
+
results: list[dict[str, Any]],
|
|
222
228
|
output_file: Path,
|
|
223
229
|
uploads_root: Path | None,
|
|
224
230
|
temp_dir: Path,
|
|
@@ -229,12 +235,8 @@ class WaldiezRunnerProtocol(Protocol):
|
|
|
229
235
|
|
|
230
236
|
Parameters
|
|
231
237
|
----------
|
|
232
|
-
results :
|
|
233
|
-
|
|
234
|
-
list["AsyncRunResponseProtocol"]
|
|
235
|
-
]
|
|
236
|
-
The results of the run, which can be a list of RunResponseProtocol
|
|
237
|
-
or a list of AsyncRunResponseProtocol.
|
|
238
|
+
results : list[dict[str, Any]]
|
|
239
|
+
The results of the run.
|
|
238
240
|
output_file : Path
|
|
239
241
|
The path to the output file.
|
|
240
242
|
uploads_root : Path | None
|
waldiez/running/run_results.py
CHANGED
|
@@ -3,20 +3,12 @@
|
|
|
3
3
|
|
|
4
4
|
"""Waldiez run results module."""
|
|
5
5
|
|
|
6
|
-
from typing import
|
|
7
|
-
|
|
8
|
-
if TYPE_CHECKING:
|
|
9
|
-
from autogen.io.run_response import ( # type: ignore[import-untyped]
|
|
10
|
-
AsyncRunResponseProtocol,
|
|
11
|
-
RunResponseProtocol,
|
|
12
|
-
)
|
|
6
|
+
from typing import Any, TypedDict
|
|
13
7
|
|
|
14
8
|
|
|
15
9
|
class WaldiezRunResults(TypedDict):
|
|
16
10
|
"""Results of the Waldiez run."""
|
|
17
11
|
|
|
18
|
-
results:
|
|
19
|
-
list["RunResponseProtocol"], list["AsyncRunResponseProtocol"]
|
|
20
|
-
]
|
|
12
|
+
results: list[dict[str, Any]]
|
|
21
13
|
exception: Exception | None
|
|
22
14
|
completed: bool
|
|
@@ -15,6 +15,7 @@ variables specified in the waldiez file are set.
|
|
|
15
15
|
"""
|
|
16
16
|
|
|
17
17
|
import asyncio
|
|
18
|
+
import getpass
|
|
18
19
|
import importlib.util
|
|
19
20
|
import sys
|
|
20
21
|
import threading
|
|
@@ -31,10 +32,7 @@ from .utils import chdir
|
|
|
31
32
|
|
|
32
33
|
if TYPE_CHECKING:
|
|
33
34
|
from autogen.events import BaseEvent # type: ignore
|
|
34
|
-
from autogen.
|
|
35
|
-
AsyncRunResponseProtocol,
|
|
36
|
-
RunResponseProtocol,
|
|
37
|
-
)
|
|
35
|
+
from autogen.messages import BaseMessage # type: ignore
|
|
38
36
|
|
|
39
37
|
|
|
40
38
|
class WaldiezStandardRunner(WaldiezBaseRunner):
|
|
@@ -46,6 +44,8 @@ class WaldiezStandardRunner(WaldiezBaseRunner):
|
|
|
46
44
|
output_path: str | Path | None = None,
|
|
47
45
|
uploads_root: str | Path | None = None,
|
|
48
46
|
structured_io: bool = False,
|
|
47
|
+
dot_env: str | Path | None = None,
|
|
48
|
+
**kwargs: Any,
|
|
49
49
|
) -> None:
|
|
50
50
|
"""Initialize the Waldiez manager."""
|
|
51
51
|
super().__init__(
|
|
@@ -53,6 +53,8 @@ class WaldiezStandardRunner(WaldiezBaseRunner):
|
|
|
53
53
|
output_path=output_path,
|
|
54
54
|
uploads_root=uploads_root,
|
|
55
55
|
structured_io=structured_io,
|
|
56
|
+
dot_env=dot_env,
|
|
57
|
+
**kwargs,
|
|
56
58
|
)
|
|
57
59
|
self._execution_thread: threading.Thread | None = None
|
|
58
60
|
self._loaded_module: ModuleType | None = None
|
|
@@ -77,6 +79,26 @@ class WaldiezStandardRunner(WaldiezBaseRunner):
|
|
|
77
79
|
self._loaded_module = module
|
|
78
80
|
return module
|
|
79
81
|
|
|
82
|
+
@staticmethod
|
|
83
|
+
def standard_input(prompt: str, *, password: bool = False) -> str:
|
|
84
|
+
"""Fallback / common input function for the workflow.
|
|
85
|
+
|
|
86
|
+
Parameters
|
|
87
|
+
----------
|
|
88
|
+
prompt : str
|
|
89
|
+
The prompt to display to the user.
|
|
90
|
+
password : bool, optional
|
|
91
|
+
If True, use getpass to hide input (default is False).
|
|
92
|
+
|
|
93
|
+
Returns
|
|
94
|
+
-------
|
|
95
|
+
str
|
|
96
|
+
The user input as a string.
|
|
97
|
+
"""
|
|
98
|
+
if password:
|
|
99
|
+
return getpass.getpass(prompt)
|
|
100
|
+
return input(prompt)
|
|
101
|
+
|
|
80
102
|
def _run(
|
|
81
103
|
self,
|
|
82
104
|
temp_dir: Path,
|
|
@@ -84,7 +106,8 @@ class WaldiezStandardRunner(WaldiezBaseRunner):
|
|
|
84
106
|
uploads_root: Path | None,
|
|
85
107
|
skip_mmd: bool,
|
|
86
108
|
skip_timeline: bool,
|
|
87
|
-
|
|
109
|
+
**kwargs: Any,
|
|
110
|
+
) -> list[dict[str, Any]]:
|
|
88
111
|
"""Run the Waldiez workflow."""
|
|
89
112
|
from autogen.io import IOStream # type: ignore
|
|
90
113
|
|
|
@@ -93,7 +116,7 @@ class WaldiezStandardRunner(WaldiezBaseRunner):
|
|
|
93
116
|
self._print: Callable[..., None] = print
|
|
94
117
|
self._input: (
|
|
95
118
|
Callable[..., str] | Callable[..., Coroutine[Any, Any, str]]
|
|
96
|
-
) =
|
|
119
|
+
) = WaldiezStandardRunner.standard_input
|
|
97
120
|
results_container: WaldiezRunResults = {
|
|
98
121
|
"results": [],
|
|
99
122
|
"exception": None,
|
|
@@ -134,7 +157,7 @@ class WaldiezStandardRunner(WaldiezBaseRunner):
|
|
|
134
157
|
|
|
135
158
|
def _on_event(
|
|
136
159
|
self,
|
|
137
|
-
event: "BaseEvent",
|
|
160
|
+
event: Union["BaseEvent", "BaseMessage"],
|
|
138
161
|
) -> bool:
|
|
139
162
|
"""Process an event from the workflow."""
|
|
140
163
|
self._event_count += 1
|
|
@@ -162,7 +185,7 @@ class WaldiezStandardRunner(WaldiezBaseRunner):
|
|
|
162
185
|
)
|
|
163
186
|
event.content.respond(user_input)
|
|
164
187
|
else:
|
|
165
|
-
self._send(event)
|
|
188
|
+
self._send(event) # pyright: ignore
|
|
166
189
|
self._processed_events += 1
|
|
167
190
|
except Exception as e:
|
|
168
191
|
raise RuntimeError(
|
|
@@ -248,7 +271,7 @@ class WaldiezStandardRunner(WaldiezBaseRunner):
|
|
|
248
271
|
|
|
249
272
|
async def _a_on_event(
|
|
250
273
|
self,
|
|
251
|
-
event: "BaseEvent",
|
|
274
|
+
event: Union["BaseEvent", "BaseMessage"],
|
|
252
275
|
) -> bool:
|
|
253
276
|
"""Process an event from the workflow asynchronously."""
|
|
254
277
|
self._event_count += 1
|
|
@@ -278,7 +301,7 @@ class WaldiezStandardRunner(WaldiezBaseRunner):
|
|
|
278
301
|
user_input = await user_input
|
|
279
302
|
await event.content.respond(user_input)
|
|
280
303
|
else:
|
|
281
|
-
self._send(event)
|
|
304
|
+
self._send(event) # pyright: ignore
|
|
282
305
|
self._processed_events += 1
|
|
283
306
|
except Exception as e:
|
|
284
307
|
raise RuntimeError(
|
|
@@ -293,18 +316,19 @@ class WaldiezStandardRunner(WaldiezBaseRunner):
|
|
|
293
316
|
uploads_root: Path | None,
|
|
294
317
|
skip_mmd: bool = False,
|
|
295
318
|
skip_timeline: bool = False,
|
|
296
|
-
|
|
319
|
+
**kwargs: Any,
|
|
320
|
+
) -> list[dict[str, Any]]:
|
|
297
321
|
"""Run the Waldiez workflow asynchronously."""
|
|
298
322
|
|
|
299
323
|
# fmt: off
|
|
300
|
-
async def _execute_workflow() ->
|
|
324
|
+
async def _execute_workflow() -> list[dict[str, Any]]:
|
|
301
325
|
# fmt: on
|
|
302
326
|
"""Execute the workflow in an async context."""
|
|
303
327
|
from autogen.io import IOStream # pyright: ignore
|
|
304
328
|
|
|
305
329
|
from waldiez.io import StructuredIOStream
|
|
306
330
|
|
|
307
|
-
results:
|
|
331
|
+
results: list[dict[str, Any]] = []
|
|
308
332
|
try:
|
|
309
333
|
self._loaded_module = self._load_module(output_file, temp_dir)
|
|
310
334
|
if self._stop_requested.is_set():
|
|
@@ -64,6 +64,7 @@ DEFAULT_AGENT_COLOR = "#E5E7EB"
|
|
|
64
64
|
LOG = WaldiezLogger()
|
|
65
65
|
|
|
66
66
|
|
|
67
|
+
# noinspection PyMethodMayBeStatic
|
|
67
68
|
class TimelineProcessor:
|
|
68
69
|
"""Class to process timeline data from CSV files."""
|
|
69
70
|
|
|
@@ -147,6 +148,7 @@ class TimelineProcessor:
|
|
|
147
148
|
default_name,
|
|
148
149
|
)
|
|
149
150
|
else:
|
|
151
|
+
# noinspection PyTypeChecker
|
|
150
152
|
last_valid_name = current_name
|
|
151
153
|
|
|
152
154
|
return data
|
|
@@ -215,6 +217,7 @@ class TimelineProcessor:
|
|
|
215
217
|
pd.Timestamp
|
|
216
218
|
The parsed datetime.
|
|
217
219
|
"""
|
|
220
|
+
# noinspection PyBroadException
|
|
218
221
|
try:
|
|
219
222
|
return pd.to_datetime(date_str)
|
|
220
223
|
except Exception:
|
|
@@ -223,6 +226,7 @@ class TimelineProcessor:
|
|
|
223
226
|
return coerced
|
|
224
227
|
return pd.Timestamp("1970-01-01")
|
|
225
228
|
|
|
229
|
+
# noinspection PyMethodMayBeStatic
|
|
226
230
|
def generate_agent_colors(self, agent_names: list[str]) -> dict[str, str]:
|
|
227
231
|
"""Generate color mapping for agents.
|
|
228
232
|
|
|
@@ -502,7 +506,11 @@ class TimelineProcessor:
|
|
|
502
506
|
if matches:
|
|
503
507
|
# Return the first match, but prefer longer matches
|
|
504
508
|
best_match = max(matches, key=len)
|
|
505
|
-
return
|
|
509
|
+
return (
|
|
510
|
+
best_match
|
|
511
|
+
if isinstance(best_match, str)
|
|
512
|
+
else str(best_match)
|
|
513
|
+
)
|
|
506
514
|
|
|
507
515
|
# Last resort: look for any word that might be a model name
|
|
508
516
|
# This catches custom or unknown models
|
|
@@ -520,6 +528,7 @@ class TimelineProcessor:
|
|
|
520
528
|
|
|
521
529
|
return "Unknown"
|
|
522
530
|
|
|
531
|
+
# noinspection PyTypeChecker
|
|
523
532
|
def is_human_input_waiting_period(
|
|
524
533
|
self,
|
|
525
534
|
prev_session: Series,
|
|
@@ -631,6 +640,7 @@ class TimelineProcessor:
|
|
|
631
640
|
|
|
632
641
|
return False
|
|
633
642
|
|
|
643
|
+
# noinspection PyTypeChecker
|
|
634
644
|
def categorize_gap_activity(
|
|
635
645
|
self,
|
|
636
646
|
prev_session: Series,
|
|
@@ -727,6 +737,7 @@ class TimelineProcessor:
|
|
|
727
737
|
"detail": f"Processing ({gap_duration:.1f}s)",
|
|
728
738
|
}
|
|
729
739
|
|
|
740
|
+
# noinspection PyUnusedLocal
|
|
730
741
|
def compress_timeline(
|
|
731
742
|
self,
|
|
732
743
|
) -> tuple[list[dict[str, Any]], list[dict[str, Any]], float, float]:
|
waldiez/running/utils.py
CHANGED
|
@@ -40,6 +40,6 @@ def check_conflicts() -> None: # pragma: no cover
|
|
|
40
40
|
"""Check for conflicts."""
|
|
41
41
|
# pylint: disable=global-statement
|
|
42
42
|
global __waldiez_checked_conflicts
|
|
43
|
-
if __waldiez_checked_conflicts
|
|
43
|
+
if not __waldiez_checked_conflicts:
|
|
44
44
|
__waldiez_checked_conflicts = True
|
|
45
45
|
_check_conflicts()
|
waldiez/utils/version.py
CHANGED
|
@@ -10,6 +10,7 @@ from pathlib import Path
|
|
|
10
10
|
|
|
11
11
|
def _get_waldiez_version_from_importlib() -> str | None:
|
|
12
12
|
"""Get the Waldiez version from the version package."""
|
|
13
|
+
# noinspection PyBroadException
|
|
13
14
|
try:
|
|
14
15
|
return version("waldiez")
|
|
15
16
|
except Exception: # pylint: disable=broad-exception-caught
|