waldiez 0.1.5__py3-none-any.whl → 0.1.7__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/__init__.py +0 -2
- waldiez/_version.py +1 -1
- waldiez/cli.py +10 -6
- waldiez/exporting/chats/helpers.py +24 -0
- waldiez/exporting/chats/nested.py +2 -0
- waldiez/{stream → io/stream}/provider.py +5 -1
- waldiez/{stream → io/stream}/server.py +50 -24
- waldiez/models/waldiez.py +13 -3
- waldiez/runner.py +24 -10
- {waldiez-0.1.5.dist-info → waldiez-0.1.7.dist-info}/METADATA +41 -12
- {waldiez-0.1.5.dist-info → waldiez-0.1.7.dist-info}/RECORD +17 -17
- /waldiez/{io_stream.py → io/__init__.py} +0 -0
- /waldiez/{stream → io/stream}/__init__.py +0 -0
- /waldiez/{stream → io/stream}/consumer.py +0 -0
- {waldiez-0.1.5.dist-info → waldiez-0.1.7.dist-info}/WHEEL +0 -0
- {waldiez-0.1.5.dist-info → waldiez-0.1.7.dist-info}/entry_points.txt +0 -0
- {waldiez-0.1.5.dist-info → waldiez-0.1.7.dist-info}/licenses/LICENSE +0 -0
waldiez/__init__.py
CHANGED
|
@@ -2,14 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
from ._version import __version__
|
|
4
4
|
from .exporter import WaldiezExporter
|
|
5
|
-
from .io_stream import WaldiezIOStream
|
|
6
5
|
from .models import Waldiez
|
|
7
6
|
from .runner import WaldiezRunner
|
|
8
7
|
|
|
9
8
|
__all__ = [
|
|
10
9
|
"Waldiez",
|
|
11
10
|
"WaldiezExporter",
|
|
12
|
-
"WaldiezIOStream",
|
|
13
11
|
"WaldiezRunner",
|
|
14
12
|
"__version__",
|
|
15
13
|
]
|
waldiez/_version.py
CHANGED
waldiez/cli.py
CHANGED
|
@@ -6,14 +6,15 @@ import logging
|
|
|
6
6
|
import os
|
|
7
7
|
import sys
|
|
8
8
|
from pathlib import Path
|
|
9
|
-
from typing import Any, Dict, Optional
|
|
10
|
-
|
|
11
|
-
from autogen import ChatResult # type: ignore[import-untyped]
|
|
9
|
+
from typing import TYPE_CHECKING, Any, Dict, Optional
|
|
12
10
|
|
|
13
11
|
from . import Waldiez, __version__
|
|
14
12
|
from .exporter import WaldiezExporter
|
|
15
13
|
from .runner import WaldiezRunner
|
|
16
14
|
|
|
15
|
+
if TYPE_CHECKING:
|
|
16
|
+
from autogen import ChatResult # type: ignore[import-untyped]
|
|
17
|
+
|
|
17
18
|
|
|
18
19
|
def get_parser() -> argparse.ArgumentParser:
|
|
19
20
|
"""Get the argument parser for the Waldiez package.
|
|
@@ -28,7 +29,7 @@ def get_parser() -> argparse.ArgumentParser:
|
|
|
28
29
|
prog="waldiez",
|
|
29
30
|
)
|
|
30
31
|
parser.add_argument(
|
|
31
|
-
"
|
|
32
|
+
"file",
|
|
32
33
|
type=str,
|
|
33
34
|
help="Path to the Waldiez flow (*.waldiez) file.",
|
|
34
35
|
)
|
|
@@ -66,7 +67,7 @@ def get_parser() -> argparse.ArgumentParser:
|
|
|
66
67
|
return parser
|
|
67
68
|
|
|
68
69
|
|
|
69
|
-
def _log_result(result: ChatResult) -> None:
|
|
70
|
+
def _log_result(result: "ChatResult") -> None:
|
|
70
71
|
"""Log the result of the Waldiez flow."""
|
|
71
72
|
logger = logging.getLogger("waldiez::cli")
|
|
72
73
|
logger.info("Chat History:\n")
|
|
@@ -94,9 +95,12 @@ def _run(data: Dict[str, Any], output_path: Optional[str]) -> None:
|
|
|
94
95
|
def main() -> None:
|
|
95
96
|
"""Parse the command line arguments and run the Waldiez flow."""
|
|
96
97
|
parser = get_parser()
|
|
98
|
+
if len(sys.argv) == 1:
|
|
99
|
+
parser.print_help()
|
|
100
|
+
sys.exit(0)
|
|
97
101
|
args = parser.parse_args()
|
|
98
102
|
logger = _get_logger()
|
|
99
|
-
waldiez_file: str = args.
|
|
103
|
+
waldiez_file: str = args.file
|
|
100
104
|
if not os.path.exists(waldiez_file):
|
|
101
105
|
logger.error("File not found: %s", waldiez_file)
|
|
102
106
|
sys.exit(1)
|
|
@@ -76,6 +76,7 @@ def export_single_chat_string(
|
|
|
76
76
|
tab = " " * tabs
|
|
77
77
|
chat, sender, recipient = flow
|
|
78
78
|
chat_args = chat.get_chat_args(sender=sender)
|
|
79
|
+
chat_args = escape_summary_args_quotes(chat_args)
|
|
79
80
|
if not chat_args:
|
|
80
81
|
return _get_empty_simple_chat_string(
|
|
81
82
|
tab,
|
|
@@ -191,6 +192,28 @@ def export_multiple_chats_string(
|
|
|
191
192
|
return content, additional_methods_string
|
|
192
193
|
|
|
193
194
|
|
|
195
|
+
def escape_summary_args_quotes(chat_args: Dict[str, Any]) -> Dict[str, Any]:
|
|
196
|
+
"""Escape quotes in the summary args if they are strings.
|
|
197
|
+
|
|
198
|
+
Parameters
|
|
199
|
+
----------
|
|
200
|
+
chat_args : Dict[str, Any]
|
|
201
|
+
The chat arguments.
|
|
202
|
+
|
|
203
|
+
Returns
|
|
204
|
+
-------
|
|
205
|
+
Dict[str, Any]
|
|
206
|
+
The chat arguments with the summary prompt escaped.
|
|
207
|
+
"""
|
|
208
|
+
if "summary_args" in chat_args and isinstance(
|
|
209
|
+
chat_args["summary_args"], dict
|
|
210
|
+
):
|
|
211
|
+
for key, value in chat_args["summary_args"].items():
|
|
212
|
+
if isinstance(value, str):
|
|
213
|
+
chat_args["summary_args"][key] = get_escaped_string(value)
|
|
214
|
+
return chat_args
|
|
215
|
+
|
|
216
|
+
|
|
194
217
|
def _get_chat_message_string(
|
|
195
218
|
chat: WaldiezChat,
|
|
196
219
|
chat_names: Dict[str, str],
|
|
@@ -264,6 +287,7 @@ def _get_chat_dict_string(
|
|
|
264
287
|
"""
|
|
265
288
|
tab = " " * tabs
|
|
266
289
|
chat_args = chat.get_chat_args(sender=sender)
|
|
290
|
+
chat_args = escape_summary_args_quotes(chat_args)
|
|
267
291
|
chat_string = "{"
|
|
268
292
|
chat_string += "\n" + f'{tab} "sender": {agent_names[sender.id]},'
|
|
269
293
|
chat_string += "\n" + f'{tab} "recipient": {agent_names[recipient.id]},'
|
|
@@ -10,6 +10,7 @@ from waldiez.models import (
|
|
|
10
10
|
)
|
|
11
11
|
|
|
12
12
|
from ..utils import get_escaped_string, get_object_string
|
|
13
|
+
from .helpers import escape_summary_args_quotes
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
def get_nested_chat_trigger_agent_names(
|
|
@@ -81,6 +82,7 @@ def get_nested_chat_message_string(
|
|
|
81
82
|
sender_name = agent_names[sender_id]
|
|
82
83
|
recipient_name = agent_names[recipient_id]
|
|
83
84
|
chat_dict = waldiez_chat.get_chat_args()
|
|
85
|
+
chat_dict = escape_summary_args_quotes(chat_dict)
|
|
84
86
|
chat_dict["recipient"] = recipient_name
|
|
85
87
|
if sender_name:
|
|
86
88
|
chat_dict["sender"] = sender_name
|
|
@@ -185,7 +185,11 @@ class InputProviderWrapper:
|
|
|
185
185
|
"""Stop the provider."""
|
|
186
186
|
if self.thread:
|
|
187
187
|
self.thread.running = False
|
|
188
|
-
|
|
188
|
+
try:
|
|
189
|
+
self.thread.socket.close()
|
|
190
|
+
except OSError: # pragma: no cover
|
|
191
|
+
pass
|
|
192
|
+
self.thread.join(timeout=0)
|
|
189
193
|
del self.thread
|
|
190
194
|
self.thread = None
|
|
191
195
|
|
|
@@ -7,6 +7,7 @@ and forwards messages between them.
|
|
|
7
7
|
# pylint: disable=import-outside-toplevel,no-member,reimported,unused-import,redefined-outer-name,invalid-name # noqa
|
|
8
8
|
import logging
|
|
9
9
|
import sys
|
|
10
|
+
import time
|
|
10
11
|
from threading import Thread
|
|
11
12
|
from types import TracebackType
|
|
12
13
|
from typing import Dict, Optional, Type, cast
|
|
@@ -179,7 +180,6 @@ class TCPServerThread(Thread):
|
|
|
179
180
|
self,
|
|
180
181
|
interface: str,
|
|
181
182
|
port: int,
|
|
182
|
-
timeout: Optional[float] = None,
|
|
183
183
|
) -> None:
|
|
184
184
|
"""Create a new TCP server.
|
|
185
185
|
|
|
@@ -189,33 +189,53 @@ class TCPServerThread(Thread):
|
|
|
189
189
|
Interface to listen on. Defaults to '' (all interfaces)
|
|
190
190
|
port : int
|
|
191
191
|
Port to listen on.
|
|
192
|
-
timeout : Optional[float]
|
|
193
|
-
Timeout for the server.
|
|
194
192
|
"""
|
|
195
193
|
super().__init__(
|
|
196
194
|
name="TCPServerThread",
|
|
197
|
-
daemon=
|
|
195
|
+
daemon=False,
|
|
198
196
|
target=self.run,
|
|
199
197
|
)
|
|
200
|
-
from twisted.internet.endpoints import TCP4ServerEndpoint
|
|
201
|
-
|
|
202
|
-
self.timeout = timeout
|
|
203
198
|
self.reactor = get_reactor()
|
|
204
199
|
self._port = port
|
|
205
|
-
|
|
200
|
+
self._interface = interface
|
|
201
|
+
self._initialize()
|
|
202
|
+
|
|
203
|
+
def _initialize(self) -> None:
|
|
204
|
+
"""Initialize the server."""
|
|
205
|
+
from twisted.internet.endpoints import TCP4ServerEndpoint
|
|
206
|
+
|
|
207
|
+
self.endpoint = TCP4ServerEndpoint( # type: ignore[no-untyped-call]
|
|
206
208
|
self.reactor,
|
|
207
|
-
|
|
208
|
-
interface=
|
|
209
|
+
self._port,
|
|
210
|
+
interface=self._interface,
|
|
209
211
|
)
|
|
210
212
|
server_factory = ServerFactory()
|
|
211
|
-
deferred = endpoint.listen(server_factory) # type: ignore
|
|
213
|
+
deferred = self.endpoint.listen(server_factory) # type: ignore
|
|
212
214
|
deferred.addCallback(callback=self.on_start)
|
|
215
|
+
deferred.addErrback(errback=self.on_error)
|
|
213
216
|
|
|
214
217
|
@property
|
|
215
218
|
def port(self) -> int:
|
|
216
219
|
"""Get the port."""
|
|
217
220
|
return self._port
|
|
218
221
|
|
|
222
|
+
def on_error(self, failure: Failure) -> None: # pragma: no cover
|
|
223
|
+
"""On error callback.
|
|
224
|
+
|
|
225
|
+
Parameters
|
|
226
|
+
----------
|
|
227
|
+
failure : Failure
|
|
228
|
+
The failure.
|
|
229
|
+
|
|
230
|
+
Raises
|
|
231
|
+
------
|
|
232
|
+
RuntimeError
|
|
233
|
+
If the failure is not handled.
|
|
234
|
+
"""
|
|
235
|
+
LOGGER.error(failure.getErrorMessage())
|
|
236
|
+
del self.endpoint
|
|
237
|
+
self._initialize()
|
|
238
|
+
|
|
219
239
|
def on_start(self, port: Port) -> None:
|
|
220
240
|
"""On connect callback.
|
|
221
241
|
|
|
@@ -257,12 +277,7 @@ class ServerWrapper:
|
|
|
257
277
|
server: TCPServerThread
|
|
258
278
|
timeout: float
|
|
259
279
|
|
|
260
|
-
def __init__(
|
|
261
|
-
self,
|
|
262
|
-
interface: str,
|
|
263
|
-
port: int,
|
|
264
|
-
timeout: Optional[float] = None,
|
|
265
|
-
) -> None:
|
|
280
|
+
def __init__(self, interface: str, port: int) -> None:
|
|
266
281
|
"""Create a new TCP server.
|
|
267
282
|
|
|
268
283
|
Parameters
|
|
@@ -272,10 +287,21 @@ class ServerWrapper:
|
|
|
272
287
|
port : int
|
|
273
288
|
Port to listen on.
|
|
274
289
|
"""
|
|
275
|
-
self.
|
|
290
|
+
self._interface = interface
|
|
291
|
+
self._port = port
|
|
292
|
+
self._init_server()
|
|
293
|
+
|
|
294
|
+
def _init_server(self) -> None:
|
|
295
|
+
"""Initialize the server."""
|
|
276
296
|
self.server = TCPServerThread(
|
|
277
|
-
interface=
|
|
297
|
+
interface=self._interface, port=self._port
|
|
278
298
|
)
|
|
299
|
+
retries = 0
|
|
300
|
+
while self.server.factory is None and retries < 30: # pragma: no cover
|
|
301
|
+
retries += 1
|
|
302
|
+
time.sleep(1)
|
|
303
|
+
if self.server.factory is None: # pragma: no cover
|
|
304
|
+
raise RuntimeError("Server not started")
|
|
279
305
|
|
|
280
306
|
@property
|
|
281
307
|
def port(self) -> int:
|
|
@@ -286,7 +312,7 @@ class ServerWrapper:
|
|
|
286
312
|
RuntimeError
|
|
287
313
|
If the server is not running
|
|
288
314
|
"""
|
|
289
|
-
if self.server.factory is None:
|
|
315
|
+
if self.server.factory is None: # pragma: no cover
|
|
290
316
|
raise RuntimeError("server is not running")
|
|
291
317
|
return self.server.port
|
|
292
318
|
|
|
@@ -298,8 +324,9 @@ class ServerWrapper:
|
|
|
298
324
|
RuntimeError
|
|
299
325
|
If the server is not running
|
|
300
326
|
"""
|
|
301
|
-
if self.server is None:
|
|
302
|
-
|
|
327
|
+
if self.server.factory is None: # pragma: no cover
|
|
328
|
+
del self.server
|
|
329
|
+
self._init_server()
|
|
303
330
|
self.server.start()
|
|
304
331
|
|
|
305
332
|
def stop(self) -> None:
|
|
@@ -340,7 +367,7 @@ class TCPServer:
|
|
|
340
367
|
@property
|
|
341
368
|
def port(self) -> int:
|
|
342
369
|
"""Get the port."""
|
|
343
|
-
if self._wrapper is None:
|
|
370
|
+
if self._wrapper is None: # pragma: no cover
|
|
344
371
|
return self._port
|
|
345
372
|
return self._wrapper.port
|
|
346
373
|
|
|
@@ -348,7 +375,6 @@ class TCPServer:
|
|
|
348
375
|
"""Initialize the wrapper."""
|
|
349
376
|
self._wrapper = ServerWrapper(
|
|
350
377
|
port=self._port,
|
|
351
|
-
timeout=self._timeout,
|
|
352
378
|
interface=self._interface,
|
|
353
379
|
)
|
|
354
380
|
|
waldiez/models/waldiez.py
CHANGED
|
@@ -7,12 +7,10 @@ definitions and their optional additional skills to be used.
|
|
|
7
7
|
|
|
8
8
|
import json
|
|
9
9
|
from dataclasses import dataclass
|
|
10
|
+
from functools import cache
|
|
10
11
|
from pathlib import Path
|
|
11
12
|
from typing import Any, Dict, Iterator, List, Optional, Tuple, Union
|
|
12
13
|
|
|
13
|
-
# let's be strict with autogen version
|
|
14
|
-
from autogen.version import __version__ as autogen_version # type: ignore
|
|
15
|
-
|
|
16
14
|
from .agents import WaldiezAgent
|
|
17
15
|
from .chat import WaldiezChat
|
|
18
16
|
from .flow import WaldiezFlow
|
|
@@ -203,6 +201,7 @@ class Waldiez:
|
|
|
203
201
|
@property
|
|
204
202
|
def requirements(self) -> List[str]:
|
|
205
203
|
"""Get the flow requirements."""
|
|
204
|
+
autogen_version = _get_autogen_version()
|
|
206
205
|
requirements_list = filter(
|
|
207
206
|
lambda requirement: not (
|
|
208
207
|
requirement.startswith("pyautogen")
|
|
@@ -299,3 +298,14 @@ def _get_flow(
|
|
|
299
298
|
if "requirements" not in data:
|
|
300
299
|
data["requirements"] = []
|
|
301
300
|
return data
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
@cache
|
|
304
|
+
def _get_autogen_version() -> str:
|
|
305
|
+
"""Get the autogen version."""
|
|
306
|
+
# pylint: disable=import-outside-toplevel
|
|
307
|
+
try:
|
|
308
|
+
from autogen.version import __version__ as atg_version # type: ignore
|
|
309
|
+
except ImportError: # pragma: no cover
|
|
310
|
+
atg_version = "0.0.0"
|
|
311
|
+
return atg_version
|
waldiez/runner.py
CHANGED
|
@@ -19,14 +19,25 @@ from contextlib import contextmanager
|
|
|
19
19
|
from contextvars import ContextVar
|
|
20
20
|
from pathlib import Path
|
|
21
21
|
from types import TracebackType
|
|
22
|
-
from typing import
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
from typing import (
|
|
23
|
+
TYPE_CHECKING,
|
|
24
|
+
Callable,
|
|
25
|
+
Dict,
|
|
26
|
+
Iterator,
|
|
27
|
+
List,
|
|
28
|
+
Optional,
|
|
29
|
+
Type,
|
|
30
|
+
Union,
|
|
31
|
+
)
|
|
25
32
|
|
|
26
33
|
from .exporter import WaldiezExporter
|
|
27
|
-
from .io_stream import WaldiezIOStream
|
|
28
34
|
from .models.waldiez import Waldiez
|
|
29
35
|
|
|
36
|
+
if TYPE_CHECKING:
|
|
37
|
+
from autogen import ChatResult # type: ignore
|
|
38
|
+
|
|
39
|
+
from .io import WaldiezIOStream
|
|
40
|
+
|
|
30
41
|
|
|
31
42
|
@contextmanager
|
|
32
43
|
def _chdir(to: Union[str, Path]) -> Iterator[None]:
|
|
@@ -60,7 +71,7 @@ class WaldiezRunner:
|
|
|
60
71
|
self._waldiez = waldiez
|
|
61
72
|
self._running = False
|
|
62
73
|
self._file_path = file_path
|
|
63
|
-
self._stream: ContextVar[Optional[WaldiezIOStream]] = ContextVar(
|
|
74
|
+
self._stream: ContextVar[Optional["WaldiezIOStream"]] = ContextVar(
|
|
64
75
|
"waldiez_stream", default=None
|
|
65
76
|
)
|
|
66
77
|
self._exporter = WaldiezExporter(waldiez)
|
|
@@ -225,9 +236,9 @@ class WaldiezRunner:
|
|
|
225
236
|
|
|
226
237
|
def _do_run(
|
|
227
238
|
self, output_path: Optional[Union[str, Path]]
|
|
228
|
-
) -> Union[ChatResult, List[ChatResult]]:
|
|
239
|
+
) -> Union["ChatResult", List["ChatResult"]]:
|
|
229
240
|
"""Run the Waldiez workflow."""
|
|
230
|
-
results: Union[ChatResult, List[ChatResult]] = []
|
|
241
|
+
results: Union["ChatResult", List["ChatResult"]] = []
|
|
231
242
|
temp_dir = Path(tempfile.mkdtemp())
|
|
232
243
|
file_name = "flow.py" if not output_path else Path(output_path).name
|
|
233
244
|
if file_name.endswith((".json", ".waldiez")):
|
|
@@ -259,19 +270,22 @@ class WaldiezRunner:
|
|
|
259
270
|
def _run(
|
|
260
271
|
self,
|
|
261
272
|
output_path: Optional[Union[str, Path]],
|
|
262
|
-
) -> Union[ChatResult, List[ChatResult]]:
|
|
273
|
+
) -> Union["ChatResult", List["ChatResult"]]:
|
|
263
274
|
self._install_requirements()
|
|
264
275
|
token = self._stream.get()
|
|
265
276
|
if token is not None:
|
|
277
|
+
# pylint: disable=import-outside-toplevel
|
|
278
|
+
from .io import WaldiezIOStream
|
|
279
|
+
|
|
266
280
|
with WaldiezIOStream.set_default(token):
|
|
267
281
|
return self._do_run(output_path)
|
|
268
282
|
return self._do_run(output_path)
|
|
269
283
|
|
|
270
284
|
def run(
|
|
271
285
|
self,
|
|
272
|
-
stream: Optional[WaldiezIOStream] = None,
|
|
286
|
+
stream: Optional["WaldiezIOStream"] = None,
|
|
273
287
|
output_path: Optional[Union[str, Path]] = None,
|
|
274
|
-
) -> Union[ChatResult, List[ChatResult]]:
|
|
288
|
+
) -> Union["ChatResult", List["ChatResult"]]:
|
|
275
289
|
"""Run the Waldiez workflow.
|
|
276
290
|
|
|
277
291
|
Parameters
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: waldiez
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.7
|
|
4
4
|
Summary: waldiez
|
|
5
5
|
Project-URL: homepage, https://waldiez.github.io/py/
|
|
6
6
|
Project-URL: repository, https://github.com/waldiez/py.git
|
|
@@ -19,7 +19,7 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
19
19
|
Requires-Python: <3.13,>=3.10
|
|
20
20
|
Requires-Dist: autogen-agentchat==0.2.37
|
|
21
21
|
Requires-Dist: jupytext
|
|
22
|
-
Requires-Dist: twisted==24.
|
|
22
|
+
Requires-Dist: twisted==24.10.0
|
|
23
23
|
Provides-Extra: autogen-extras
|
|
24
24
|
Requires-Dist: autogen-agentchat[anthropic]==0.2.37; extra == 'autogen-extras'
|
|
25
25
|
Requires-Dist: autogen-agentchat[bedrock]==0.2.37; extra == 'autogen-extras'
|
|
@@ -33,12 +33,12 @@ Requires-Dist: autogen-agentchat[retrievechat-qdrant]==0.2.37; extra == 'autogen
|
|
|
33
33
|
Requires-Dist: autogen-agentchat[retrievechat]==0.2.37; extra == 'autogen-extras'
|
|
34
34
|
Requires-Dist: autogen-agentchat[together]==0.2.37; extra == 'autogen-extras'
|
|
35
35
|
Requires-Dist: autogen-agentchat[websurfer]==0.2.37; extra == 'autogen-extras'
|
|
36
|
-
Requires-Dist: chromadb==0.5.
|
|
36
|
+
Requires-Dist: chromadb==0.5.17; extra == 'autogen-extras'
|
|
37
37
|
Requires-Dist: fastembed==0.4.1; extra == 'autogen-extras'
|
|
38
|
-
Requires-Dist: pgvector==0.3.
|
|
38
|
+
Requires-Dist: pgvector==0.3.6; extra == 'autogen-extras'
|
|
39
39
|
Requires-Dist: psycopg[binary]>=3.2.3; extra == 'autogen-extras'
|
|
40
40
|
Requires-Dist: pymongo==4.10.1; extra == 'autogen-extras'
|
|
41
|
-
Requires-Dist: qdrant-client==1.12.
|
|
41
|
+
Requires-Dist: qdrant-client==1.12.1; extra == 'autogen-extras'
|
|
42
42
|
Provides-Extra: dev
|
|
43
43
|
Requires-Dist: autoflake==2.3.1; extra == 'dev'
|
|
44
44
|
Requires-Dist: bandit==1.7.10; extra == 'dev'
|
|
@@ -50,21 +50,21 @@ Requires-Dist: pre-commit==4.0.1; extra == 'dev'
|
|
|
50
50
|
Requires-Dist: pydocstyle==6.3.0; extra == 'dev'
|
|
51
51
|
Requires-Dist: pylint==3.3.1; extra == 'dev'
|
|
52
52
|
Requires-Dist: python-dotenv==1.0.1; extra == 'dev'
|
|
53
|
-
Requires-Dist: ruff==0.7.
|
|
53
|
+
Requires-Dist: ruff==0.7.2; extra == 'dev'
|
|
54
54
|
Requires-Dist: types-pyyaml==6.0.12; extra == 'dev'
|
|
55
55
|
Requires-Dist: yamllint==1.35.1; extra == 'dev'
|
|
56
56
|
Provides-Extra: docs
|
|
57
57
|
Requires-Dist: mdx-include==1.4.2; extra == 'docs'
|
|
58
58
|
Requires-Dist: mdx-truly-sane-lists==1.3; extra == 'docs'
|
|
59
59
|
Requires-Dist: mkdocs-jupyter==0.25.1; extra == 'docs'
|
|
60
|
-
Requires-Dist: mkdocs-macros-plugin==1.3.
|
|
61
|
-
Requires-Dist: mkdocs-material==9.5.
|
|
60
|
+
Requires-Dist: mkdocs-macros-plugin==1.3.7; extra == 'docs'
|
|
61
|
+
Requires-Dist: mkdocs-material==9.5.43; extra == 'docs'
|
|
62
62
|
Requires-Dist: mkdocs-minify-html-plugin==0.2.3; extra == 'docs'
|
|
63
63
|
Requires-Dist: mkdocs==1.6.1; extra == 'docs'
|
|
64
64
|
Requires-Dist: mkdocstrings-python==1.12.2; extra == 'docs'
|
|
65
65
|
Requires-Dist: mkdocstrings[crystal,python]==0.26.2; extra == 'docs'
|
|
66
66
|
Provides-Extra: test
|
|
67
|
-
Requires-Dist: pytest-cov==
|
|
67
|
+
Requires-Dist: pytest-cov==6.0.0; extra == 'test'
|
|
68
68
|
Requires-Dist: pytest-html==4.1.1; extra == 'test'
|
|
69
69
|
Requires-Dist: pytest-sugar==1.0.0; extra == 'test'
|
|
70
70
|
Requires-Dist: pytest-timeout==2.3.1; extra == 'test'
|
|
@@ -109,9 +109,37 @@ python -m pip install git+https://github.com/waldiez/py.git
|
|
|
109
109
|
|
|
110
110
|
```bash
|
|
111
111
|
# Export a Waldiez flow to a python script or a jupyter notebook
|
|
112
|
-
waldiez --export /path/to/a/flow.waldiez --output /path/to/an/output[.py|.ipynb]
|
|
112
|
+
waldiez --export /path/to/a/flow.waldiez --output /path/to/an/output/flow[.py|.ipynb]
|
|
113
113
|
# Export and run the script, optionally force generation if the output file already exists
|
|
114
|
-
waldiez /path/to/a/flow.waldiez --output /path/to/an/output[.py] [--force]
|
|
114
|
+
waldiez /path/to/a/flow.waldiez --output /path/to/an/output/flow[.py] [--force]
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Using docker/podman
|
|
118
|
+
|
|
119
|
+
```shell
|
|
120
|
+
CONTAINER_COMMAND=docker # or podman
|
|
121
|
+
# pull the image
|
|
122
|
+
$CONTAINER_COMMAND pull waldiez/py
|
|
123
|
+
# Export a Waldiez flow to a python script or a jupyter notebook
|
|
124
|
+
$CONTAINER_COMMAND run \
|
|
125
|
+
--rm \
|
|
126
|
+
-v /path/to/a/flow.waldiez:/flow.waldiez \
|
|
127
|
+
-v /path/to/an/output:/output \
|
|
128
|
+
waldiez/py --export /flow.waldiez --output /output/flow[.py|.ipynb]
|
|
129
|
+
|
|
130
|
+
# with selinux and/or podman, you might get permission (or file not found) errors, so you can try:
|
|
131
|
+
$CONTAINER_COMMAND run \
|
|
132
|
+
--rm \
|
|
133
|
+
-v /path/to/a/flow.waldiez:/flow.waldiez \
|
|
134
|
+
-v /path/to/an/output:/output \
|
|
135
|
+
--userns=keep-id \
|
|
136
|
+
--security-opt label=disable \
|
|
137
|
+
waldiez/py --export /flow.waldiez --output /output/flow[.py|.ipynb]
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
```shell
|
|
141
|
+
# Export and run the script
|
|
142
|
+
$CONTAINER_COMMAND run --rm -v /path/to/a/flow.waldiez:/flow.waldiez -v /path/to/an/output:/output waldiez/py /flow.waldiez --output /output/output[.py]
|
|
115
143
|
```
|
|
116
144
|
|
|
117
145
|
### As a library
|
|
@@ -142,7 +170,8 @@ runner.run(output_path=output_path)
|
|
|
142
170
|
|
|
143
171
|
```python
|
|
144
172
|
# Run the flow with a custom IOStream
|
|
145
|
-
from waldiez import
|
|
173
|
+
from waldiez import WaldiezRunner
|
|
174
|
+
from waldiez.io import WaldiezIOStream
|
|
146
175
|
|
|
147
176
|
flow_path = "/path/to/a/flow.waldiez"
|
|
148
177
|
output_path = "/path/to/an/output.py"
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
waldiez/__init__.py,sha256=
|
|
1
|
+
waldiez/__init__.py,sha256=AuVJ8ZOPmJoTeKQ_ryezU14tG-DFRb7djvr72a5G63Y,251
|
|
2
2
|
waldiez/__main__.py,sha256=9xR-F2ohZcRPDG6KrM7cJpXciKX-u6WdL221ckyJ04k,112
|
|
3
|
-
waldiez/_version.py,sha256=
|
|
4
|
-
waldiez/cli.py,sha256=
|
|
3
|
+
waldiez/_version.py,sha256=A8aXjNec6D58qEEhm4QLBRHEUMFlCl0k8_SIGteYnJ8,62
|
|
4
|
+
waldiez/cli.py,sha256=wStRkt056Y-F2CcuD6Zlov-ooUpWndyNesV9s_MjyHU,4798
|
|
5
5
|
waldiez/exporter.py,sha256=iKe-l_Me8NRWsXHIdBcrOrnLT9XIyp4iYi4HLuuj2jA,9342
|
|
6
|
-
waldiez/io_stream.py,sha256=YczhIw0PKEsxCSY6tAqElCqOUh8b-aEkSIGC1JjXxAs,5877
|
|
7
6
|
waldiez/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
-
waldiez/runner.py,sha256=
|
|
7
|
+
waldiez/runner.py,sha256=YDjEyu9zZF2JX22c6C1g1iYwxRDEdP2pPox6m0kJhfw,10194
|
|
9
8
|
waldiez/exporting/__init__.py,sha256=GMY7qTRpNmc7tpaCFNGLT5wX9eu26NvoNPuYX8MzP50,344
|
|
10
9
|
waldiez/exporting/agents/__init__.py,sha256=v5KA112W_EFYwXE2TSBKYyO8rRKUOUAOpFS5CMSnfRs,110
|
|
11
10
|
waldiez/exporting/agents/agent.py,sha256=otNYclKfi57CUNsM0lVLAbD7YPboe_2TnrdllBwgKzE,7228
|
|
@@ -24,8 +23,8 @@ waldiez/exporting/agents/rag_user/rag_user.py,sha256=l2RcQ2Ni5EerLk23js_aq70EKA-
|
|
|
24
23
|
waldiez/exporting/agents/rag_user/vector_db.py,sha256=64Gr_y1VTZLXi1pC4KjChsZ6DTX7cxdkDRQI3Ty_H-U,3659
|
|
25
24
|
waldiez/exporting/chats/__init__.py,sha256=v5aR1gWqSN5xeDDMIFo-ceC_Z9UgL8qJZofC2sU8HqQ,296
|
|
26
25
|
waldiez/exporting/chats/chats.py,sha256=xI5ZzWpcqYz8Kuu7B9pU6iHN16wUwHxOvYFhH5vxWuA,1259
|
|
27
|
-
waldiez/exporting/chats/helpers.py,sha256=
|
|
28
|
-
waldiez/exporting/chats/nested.py,sha256=
|
|
26
|
+
waldiez/exporting/chats/helpers.py,sha256=K-IwBAG4-t7NLBP8Qs8_a2AEoKyoLw_B6eHzgXpOshA,13352
|
|
27
|
+
waldiez/exporting/chats/nested.py,sha256=cDB22ekFrzBZj5eb-nM1oGfPc4BEDGrXTZT2AlNXRsQ,8356
|
|
29
28
|
waldiez/exporting/flow/__init__.py,sha256=WhdPrjXQAcihrS1KUtPNgbx0y1tqD5HtGykzpEAcsBM,98
|
|
30
29
|
waldiez/exporting/flow/def_main.py,sha256=YpdhqO4iFng3r7if69ZPMJAibPVNDqnrOrWvGw7CJq8,1052
|
|
31
30
|
waldiez/exporting/flow/flow.py,sha256=x2AlXr7aJJfrPMeuXQYfT9sG5GycMwf0kRkovZWKGag,6206
|
|
@@ -39,8 +38,13 @@ waldiez/exporting/utils/method_utils.py,sha256=7-RUMTylNM2W0iM1bPX2_Gn3553XZSl2s
|
|
|
39
38
|
waldiez/exporting/utils/naming.py,sha256=VdoVODQduhXIs9hQFWUVEVqTaSyNDt7rkECsuIgXYwI,3196
|
|
40
39
|
waldiez/exporting/utils/object_string.py,sha256=2kdIu4in3iUV92a2KbLWwp9POhvY-fzF_r2AGVnCKls,2166
|
|
41
40
|
waldiez/exporting/utils/path_check.py,sha256=laGSLLiiwIIKxpAp5JIbtEvurbvXGkT4Hx0lemJcA9s,976
|
|
41
|
+
waldiez/io/__init__.py,sha256=YczhIw0PKEsxCSY6tAqElCqOUh8b-aEkSIGC1JjXxAs,5877
|
|
42
|
+
waldiez/io/stream/__init__.py,sha256=6qst5j2iXmV-wDTnhgCna3llqUfJ6tkR0HBq7Vx9x-Q,197
|
|
43
|
+
waldiez/io/stream/consumer.py,sha256=VQDJEomYpGjmAtOoFBJrpCyoYzwykJUIOrdiLn08Uj4,4049
|
|
44
|
+
waldiez/io/stream/provider.py,sha256=xcjtlZeeq7q-9fh0pSKCvAXv8vzPFrqbSGzfZCQoSFw,9607
|
|
45
|
+
waldiez/io/stream/server.py,sha256=G3mUmfyswp6jQZAeqY3eemsuhRns1ls7nsMr27mdT6o,12614
|
|
42
46
|
waldiez/models/__init__.py,sha256=IMq8vzuAgmv92kHSSuZQLF38vVd31ojgOHonuHqWYj0,2888
|
|
43
|
-
waldiez/models/waldiez.py,sha256=
|
|
47
|
+
waldiez/models/waldiez.py,sha256=_odlEjyXPcvHXZVDq4wV0I3_bv27Syk3smBfMOUXIoU,9180
|
|
44
48
|
waldiez/models/agents/__init__.py,sha256=3ZyVYBHMFzZjRMIdPrBF6HLg82LPAlEubL6utL6KhfU,1856
|
|
45
49
|
waldiez/models/agents/agents.py,sha256=zIqihnoBjzaQLL_P6FcVoHddcusRNYsWPIFLZD091bE,3641
|
|
46
50
|
waldiez/models/agents/agent/__init__.py,sha256=inA0zV3dnwmcQlcObH_FLaZSURjFG31E_XUampJAnJU,746
|
|
@@ -84,12 +88,8 @@ waldiez/models/model/model_data.py,sha256=pDPKUbltaXWjCuDArgwTOEHw_igfk_DkxzFzdn
|
|
|
84
88
|
waldiez/models/skill/__init__.py,sha256=rU88bajKOGMYoHFcE8MP0jW9H0MswbQmvz5wxS35BYE,169
|
|
85
89
|
waldiez/models/skill/skill.py,sha256=fhsAI413an2_d4DBIkf7dzEuWk6rGs2t4sl97a4dj20,3473
|
|
86
90
|
waldiez/models/skill/skill_data.py,sha256=RTWn8Od6w7g-nRIpsS29sqZ8sPm5dCPiK7-qXmU-KD4,815
|
|
87
|
-
waldiez/
|
|
88
|
-
waldiez/
|
|
89
|
-
waldiez/
|
|
90
|
-
waldiez/
|
|
91
|
-
waldiez-0.1.
|
|
92
|
-
waldiez-0.1.5.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
|
93
|
-
waldiez-0.1.5.dist-info/entry_points.txt,sha256=5Po4yQXPa_QEdtTevpEBgr3rGoIvDMeQuJR2zqwBLBo,45
|
|
94
|
-
waldiez-0.1.5.dist-info/licenses/LICENSE,sha256=VQEHM6WMQLRu1qaGl3GWsoOknDwro-69eGo4NLIJPIM,1064
|
|
95
|
-
waldiez-0.1.5.dist-info/RECORD,,
|
|
91
|
+
waldiez-0.1.7.dist-info/METADATA,sha256=dGnSmaGRqnsTogxJ9sp9SNg5rxpd6iBrkJEaGtC3kJM,7726
|
|
92
|
+
waldiez-0.1.7.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
|
93
|
+
waldiez-0.1.7.dist-info/entry_points.txt,sha256=5Po4yQXPa_QEdtTevpEBgr3rGoIvDMeQuJR2zqwBLBo,45
|
|
94
|
+
waldiez-0.1.7.dist-info/licenses/LICENSE,sha256=VQEHM6WMQLRu1qaGl3GWsoOknDwro-69eGo4NLIJPIM,1064
|
|
95
|
+
waldiez-0.1.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|