waldiez 0.1.19__py3-none-any.whl → 0.2.0__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 +5 -0
- waldiez/_version.py +1 -1
- waldiez/cli.py +9 -1
- waldiez/cli_extras.py +123 -0
- waldiez/exporter.py +11 -4
- waldiez/exporting/agents/rag_user/vector_db.py +1 -0
- waldiez/exporting/chats/helpers.py +1 -0
- waldiez/exporting/models/__init__.py +3 -1
- waldiez/exporting/skills/__init__.py +2 -2
- waldiez/models/agents/rag_user/vector_db_config.py +2 -0
- waldiez/models/common/method_utils.py +1 -0
- waldiez/models/model/__init__.py +2 -1
- waldiez/models/model/model.py +37 -2
- waldiez/models/model/model_data.py +1 -0
- waldiez/models/waldiez.py +8 -5
- waldiez/runner.py +61 -2
- {waldiez-0.1.19.dist-info → waldiez-0.2.0.dist-info}/METADATA +55 -38
- {waldiez-0.1.19.dist-info → waldiez-0.2.0.dist-info}/RECORD +21 -20
- {waldiez-0.1.19.dist-info → waldiez-0.2.0.dist-info}/licenses/LICENSE +1 -1
- {waldiez-0.1.19.dist-info → waldiez-0.2.0.dist-info}/WHEEL +0 -0
- {waldiez-0.1.19.dist-info → waldiez-0.2.0.dist-info}/entry_points.txt +0 -0
waldiez/__init__.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""Waldiez package."""
|
|
2
2
|
|
|
3
3
|
import logging
|
|
4
|
+
import warnings
|
|
4
5
|
|
|
5
6
|
from ._version import __version__
|
|
6
7
|
from .conflict_checker import check_conflicts
|
|
@@ -8,6 +9,10 @@ from .exporter import WaldiezExporter
|
|
|
8
9
|
from .models import Waldiez
|
|
9
10
|
from .runner import WaldiezRunner
|
|
10
11
|
|
|
12
|
+
warnings.filterwarnings(
|
|
13
|
+
"ignore", module="flaml", message="^.*flaml.automl is not available.*$"
|
|
14
|
+
)
|
|
15
|
+
|
|
11
16
|
|
|
12
17
|
# pylint: disable=too-few-public-methods
|
|
13
18
|
class FlamlFilter(logging.Filter):
|
waldiez/_version.py
CHANGED
waldiez/cli.py
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"""Command line interface to convert or run a waldiez file."""
|
|
2
2
|
|
|
3
|
-
# pylint: disable=missing-function-docstring,missing-param-doc,missing-raises-doc
|
|
3
|
+
# pylint: disable=missing-function-docstring,missing-param-doc,missing-raises-doc # noqa: E501
|
|
4
4
|
import json
|
|
5
5
|
import logging
|
|
6
6
|
import os
|
|
7
7
|
import sys
|
|
8
|
+
import warnings
|
|
8
9
|
from pathlib import Path
|
|
9
10
|
from typing import TYPE_CHECKING, Optional
|
|
10
11
|
|
|
@@ -12,9 +13,14 @@ import typer
|
|
|
12
13
|
from typing_extensions import Annotated
|
|
13
14
|
|
|
14
15
|
from . import Waldiez, __version__
|
|
16
|
+
from .cli_extras import add_cli_extras # type: ignore
|
|
15
17
|
from .exporter import WaldiezExporter
|
|
16
18
|
from .runner import WaldiezRunner
|
|
17
19
|
|
|
20
|
+
warnings.filterwarnings(
|
|
21
|
+
"ignore", module="flaml", message="^.*flaml.automl is not available.*$"
|
|
22
|
+
)
|
|
23
|
+
|
|
18
24
|
if TYPE_CHECKING:
|
|
19
25
|
from autogen import ChatResult # type: ignore[import-untyped]
|
|
20
26
|
|
|
@@ -224,6 +230,8 @@ def _log_result(result: "ChatResult", logger: logging.Logger) -> None:
|
|
|
224
230
|
logger.info(result.cost)
|
|
225
231
|
|
|
226
232
|
|
|
233
|
+
add_cli_extras(app)
|
|
234
|
+
|
|
227
235
|
if __name__ == "__main__":
|
|
228
236
|
_get_logger()
|
|
229
237
|
app()
|
waldiez/cli_extras.py
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# type: ignore
|
|
2
|
+
# flake8: noqa
|
|
3
|
+
# pylint: skip-file
|
|
4
|
+
# isort: skip_file
|
|
5
|
+
"""Extra typer commands for CLI."""
|
|
6
|
+
|
|
7
|
+
import typer
|
|
8
|
+
import subprocess # nosemgrep # nosec
|
|
9
|
+
|
|
10
|
+
HAVE_STUDIO = False
|
|
11
|
+
HAVE_JUPYTER = False
|
|
12
|
+
try:
|
|
13
|
+
from waldiez_studio.cli import app as studio_app
|
|
14
|
+
|
|
15
|
+
HAVE_STUDIO = True
|
|
16
|
+
except BaseException:
|
|
17
|
+
pass
|
|
18
|
+
|
|
19
|
+
try:
|
|
20
|
+
import waldiez_jupyter
|
|
21
|
+
|
|
22
|
+
HAVE_JUPYTER = True
|
|
23
|
+
except BaseException:
|
|
24
|
+
pass
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def add_cli_extras(app: typer.Typer) -> None:
|
|
28
|
+
"""Add extra CLI commands to the app.
|
|
29
|
+
|
|
30
|
+
Parameters
|
|
31
|
+
----------
|
|
32
|
+
app : typer.Typer
|
|
33
|
+
The Typer app to add the extra commands to.
|
|
34
|
+
|
|
35
|
+
Returns
|
|
36
|
+
-------
|
|
37
|
+
typer.Typer
|
|
38
|
+
The app with the extra commands added
|
|
39
|
+
"""
|
|
40
|
+
if HAVE_STUDIO:
|
|
41
|
+
app.add_typer(
|
|
42
|
+
studio_app,
|
|
43
|
+
name="studio",
|
|
44
|
+
help="Start Waldiez Studio.",
|
|
45
|
+
no_args_is_help=False,
|
|
46
|
+
)
|
|
47
|
+
if HAVE_JUPYTER:
|
|
48
|
+
jupyter_app = get_jupyter_app()
|
|
49
|
+
app.add_typer(jupyter_app, name="lab")
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def get_jupyter_app() -> typer.Typer:
|
|
53
|
+
"""Get the Jupyter Typer app.
|
|
54
|
+
|
|
55
|
+
Returns
|
|
56
|
+
-------
|
|
57
|
+
typer.Typer
|
|
58
|
+
The Jupyter Typer app
|
|
59
|
+
"""
|
|
60
|
+
jupyter_app = typer.Typer(
|
|
61
|
+
name="lab",
|
|
62
|
+
help="Start jupyter lab with the waldiez extension.",
|
|
63
|
+
context_settings={
|
|
64
|
+
"help_option_names": ["-h", "--help"],
|
|
65
|
+
"allow_extra_args": True,
|
|
66
|
+
"ignore_unknown_options": True,
|
|
67
|
+
},
|
|
68
|
+
add_completion=False,
|
|
69
|
+
no_args_is_help=False,
|
|
70
|
+
invoke_without_command=True,
|
|
71
|
+
add_help_option=True,
|
|
72
|
+
pretty_exceptions_enable=False,
|
|
73
|
+
epilog=(
|
|
74
|
+
"Use `waldiez lab [COMMAND] --help` for command-specific help. "
|
|
75
|
+
),
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
@jupyter_app.command(
|
|
79
|
+
name="start",
|
|
80
|
+
help="Start JupyterLab.",
|
|
81
|
+
)
|
|
82
|
+
def start(
|
|
83
|
+
port: int = typer.Option(
|
|
84
|
+
8888,
|
|
85
|
+
"--port",
|
|
86
|
+
help="Port to run JupyterLab on.",
|
|
87
|
+
),
|
|
88
|
+
host: str = typer.Option(
|
|
89
|
+
"*",
|
|
90
|
+
"--host",
|
|
91
|
+
help="Host to run JupyterLab on.",
|
|
92
|
+
),
|
|
93
|
+
browser: bool = typer.Option(
|
|
94
|
+
False,
|
|
95
|
+
"--no-browser",
|
|
96
|
+
help="Don't open the browser.",
|
|
97
|
+
),
|
|
98
|
+
password: str = typer.Option(
|
|
99
|
+
None,
|
|
100
|
+
"--password",
|
|
101
|
+
help="Password to access JupyterLab.",
|
|
102
|
+
),
|
|
103
|
+
) -> None:
|
|
104
|
+
"""Start JupyterLab."""
|
|
105
|
+
command = [
|
|
106
|
+
"jupyter",
|
|
107
|
+
"lab",
|
|
108
|
+
f"--port={port}",
|
|
109
|
+
f"--ip={host}",
|
|
110
|
+
"--ServerApp.terminado_settings=\"shell_command=['/bin/bash']\"",
|
|
111
|
+
"--ServerApp.allow_origin='*'",
|
|
112
|
+
"--ServerApp.disable_check_xsrf=True",
|
|
113
|
+
]
|
|
114
|
+
if browser:
|
|
115
|
+
command.append("--no-browser")
|
|
116
|
+
if password:
|
|
117
|
+
from jupyter_server.auth import passwd
|
|
118
|
+
|
|
119
|
+
hashed_password = passwd(password)
|
|
120
|
+
command.append(f"--ServerApp.password={hashed_password}")
|
|
121
|
+
subprocess.run(command)
|
|
122
|
+
|
|
123
|
+
return jupyter_app
|
waldiez/exporter.py
CHANGED
|
@@ -195,7 +195,7 @@ class WaldiezExporter:
|
|
|
195
195
|
# we first create a .py file with the content
|
|
196
196
|
# and then convert it to a notebook using jupytext
|
|
197
197
|
py_path = path.with_suffix(".tmp.py")
|
|
198
|
-
with open(py_path, "w", encoding="utf-8") as f:
|
|
198
|
+
with open(py_path, "w", encoding="utf-8", newline="\n") as f:
|
|
199
199
|
f.write(content)
|
|
200
200
|
if not shutil.which("jupytext"): # pragma: no cover
|
|
201
201
|
run_command(
|
|
@@ -203,7 +203,14 @@ class WaldiezExporter:
|
|
|
203
203
|
allow_error=False,
|
|
204
204
|
)
|
|
205
205
|
run_command(
|
|
206
|
-
[
|
|
206
|
+
[
|
|
207
|
+
sys.executable,
|
|
208
|
+
"-m",
|
|
209
|
+
"jupytext",
|
|
210
|
+
"--to",
|
|
211
|
+
"notebook",
|
|
212
|
+
str(py_path),
|
|
213
|
+
],
|
|
207
214
|
allow_error=False,
|
|
208
215
|
)
|
|
209
216
|
ipynb_path = str(py_path).replace(".tmp.py", ".tmp.ipynb")
|
|
@@ -239,7 +246,7 @@ class WaldiezExporter:
|
|
|
239
246
|
)
|
|
240
247
|
content += '\n\nif __name__ == "__main__":\n'
|
|
241
248
|
content += " print(main())\n"
|
|
242
|
-
with open(path, "w", encoding="utf-8") as file:
|
|
249
|
+
with open(path, "w", encoding="utf-8", newline="\n") as file:
|
|
243
250
|
file.write(content)
|
|
244
251
|
|
|
245
252
|
def to_waldiez(self, file_path: Path) -> None:
|
|
@@ -250,7 +257,7 @@ class WaldiezExporter:
|
|
|
250
257
|
file_path : Path
|
|
251
258
|
The file path.
|
|
252
259
|
"""
|
|
253
|
-
with open(file_path, "w", encoding="utf-8") as file:
|
|
260
|
+
with open(file_path, "w", encoding="utf-8", newline="\n") as file:
|
|
254
261
|
file.write(self.waldiez.model_dump_json())
|
|
255
262
|
|
|
256
263
|
|
|
@@ -238,5 +238,7 @@ def get_model_api_key(model_name: str) -> str:
|
|
|
238
238
|
return __ALL_MODEL_API_KEYS__.get(model_name, "")
|
|
239
239
|
'''
|
|
240
240
|
|
|
241
|
-
with open(
|
|
241
|
+
with open(
|
|
242
|
+
output_dir / "waldiez_api_keys.py", "w", encoding="utf-8", newline="\n"
|
|
243
|
+
) as f:
|
|
242
244
|
f.write(api_keys_content)
|
|
@@ -88,7 +88,7 @@ def _write_skill_secrets(
|
|
|
88
88
|
if not skill.secrets:
|
|
89
89
|
return
|
|
90
90
|
secrets_file = output_dir / f"{skill_name}_secrets.py"
|
|
91
|
-
with secrets_file.open("w", encoding="utf-8") as f:
|
|
91
|
+
with secrets_file.open("w", encoding="utf-8", newline="\n") as f:
|
|
92
92
|
f.write('"""Secrets for the skill."""\n')
|
|
93
93
|
f.write("from os import environ\n\n")
|
|
94
94
|
for key, value in skill.secrets.items():
|
|
@@ -158,6 +158,6 @@ def export_skills(
|
|
|
158
158
|
)
|
|
159
159
|
_write_skill_secrets(skill, skill_name, output_dir)
|
|
160
160
|
skill_file = output_dir / f"{skill_name}.py"
|
|
161
|
-
with skill_file.open("w", encoding="utf-8") as f:
|
|
161
|
+
with skill_file.open("w", encoding="utf-8", newline="\n") as f:
|
|
162
162
|
f.write(skill.content)
|
|
163
163
|
return skill_imports, skill_secrets
|
waldiez/models/model/__init__.py
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"""Waldiez model."""
|
|
2
2
|
|
|
3
|
-
from .model import WaldiezModel
|
|
3
|
+
from .model import DEFAULT_BASE_URLS, WaldiezModel
|
|
4
4
|
from .model_data import WaldiezModelAPIType, WaldiezModelData, WaldiezModelPrice
|
|
5
5
|
|
|
6
6
|
__all__ = [
|
|
7
|
+
"DEFAULT_BASE_URLS",
|
|
7
8
|
"WaldiezModel",
|
|
8
9
|
"WaldiezModelData",
|
|
9
10
|
"WaldiezModelPrice",
|
waldiez/models/model/model.py
CHANGED
|
@@ -7,7 +7,16 @@ from pydantic import Field
|
|
|
7
7
|
from typing_extensions import Annotated, Literal
|
|
8
8
|
|
|
9
9
|
from ..common import WaldiezBase, now
|
|
10
|
-
from .model_data import WaldiezModelData
|
|
10
|
+
from .model_data import WaldiezModelAPIType, WaldiezModelData
|
|
11
|
+
|
|
12
|
+
DEFAULT_BASE_URLS: Dict[WaldiezModelAPIType, str] = {
|
|
13
|
+
"google": "https://generativelanguage.googleapis.com/v1beta",
|
|
14
|
+
"anthropic": "https://api.anthropic.com/v1",
|
|
15
|
+
"mistral": "https://api.mistral.ai/v1",
|
|
16
|
+
"groq": "https://api.groq.com/openai/v1",
|
|
17
|
+
"together": "https://api.together.xyz/v1",
|
|
18
|
+
"nim": "https://integrate.api.nvidia.com/v1",
|
|
19
|
+
}
|
|
11
20
|
|
|
12
21
|
|
|
13
22
|
class WaldiezModel(WaldiezBase):
|
|
@@ -166,4 +175,30 @@ class WaldiezModel(WaldiezBase):
|
|
|
166
175
|
value = getattr(self, attr)
|
|
167
176
|
if value:
|
|
168
177
|
_llm_config[attr] = value
|
|
169
|
-
return _llm_config
|
|
178
|
+
return set_default_base_url(_llm_config, self.data.api_type)
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
def set_default_base_url(
|
|
182
|
+
llm_config: Dict[str, Any], api_type: WaldiezModelAPIType
|
|
183
|
+
) -> Dict[str, Any]:
|
|
184
|
+
"""Set the default base url if not provided.
|
|
185
|
+
|
|
186
|
+
Parameters
|
|
187
|
+
----------
|
|
188
|
+
llm_config : Dict[str, Any]
|
|
189
|
+
The llm config dictionary.
|
|
190
|
+
api_type : str
|
|
191
|
+
The api type.
|
|
192
|
+
|
|
193
|
+
Returns
|
|
194
|
+
-------
|
|
195
|
+
Dict[str, Any]
|
|
196
|
+
The llm config dictionary with the default base url set.
|
|
197
|
+
"""
|
|
198
|
+
if api_type in ("openai", "other", "azure"):
|
|
199
|
+
return llm_config
|
|
200
|
+
if "base_url" not in llm_config or not llm_config["base_url"]:
|
|
201
|
+
dict_copy = llm_config.copy()
|
|
202
|
+
dict_copy["base_url"] = DEFAULT_BASE_URLS.get(api_type, "")
|
|
203
|
+
return dict_copy
|
|
204
|
+
return llm_config
|
waldiez/models/waldiez.py
CHANGED
|
@@ -6,6 +6,7 @@ definitions and their optional additional skills to be used.
|
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
8
|
import json
|
|
9
|
+
import warnings
|
|
9
10
|
from dataclasses import dataclass
|
|
10
11
|
from functools import cache
|
|
11
12
|
from pathlib import Path
|
|
@@ -309,8 +310,10 @@ def _get_flow(
|
|
|
309
310
|
def _get_autogen_version() -> str:
|
|
310
311
|
"""Get the autogen version."""
|
|
311
312
|
# pylint: disable=import-outside-toplevel
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
313
|
+
with warnings.catch_warnings():
|
|
314
|
+
warnings.simplefilter("ignore")
|
|
315
|
+
try:
|
|
316
|
+
from autogen.version import __version__ as ag2 # type: ignore
|
|
317
|
+
except ImportError as error: # pragma: no cover
|
|
318
|
+
raise ValueError("pyautogen is not installed.") from error
|
|
319
|
+
return ag2
|
waldiez/runner.py
CHANGED
|
@@ -18,6 +18,7 @@ import site
|
|
|
18
18
|
import subprocess # nosemgrep # nosec
|
|
19
19
|
import sys
|
|
20
20
|
import tempfile
|
|
21
|
+
import warnings
|
|
21
22
|
from contextlib import contextmanager
|
|
22
23
|
from pathlib import Path
|
|
23
24
|
from types import TracebackType
|
|
@@ -28,6 +29,7 @@ from typing import (
|
|
|
28
29
|
Iterator,
|
|
29
30
|
List,
|
|
30
31
|
Optional,
|
|
32
|
+
Tuple,
|
|
31
33
|
Type,
|
|
32
34
|
Union,
|
|
33
35
|
)
|
|
@@ -153,7 +155,8 @@ class WaldiezRunner:
|
|
|
153
155
|
req for req in self.waldiez.requirements if req not in sys.modules
|
|
154
156
|
)
|
|
155
157
|
if extra_requirements:
|
|
156
|
-
|
|
158
|
+
requirements_string = ", ".join(extra_requirements)
|
|
159
|
+
printer(f"Installing requirements: {requirements_string}")
|
|
157
160
|
pip_install = [sys.executable, "-m", "pip", "install"]
|
|
158
161
|
if not in_virtualenv():
|
|
159
162
|
pip_install.append("--user")
|
|
@@ -343,6 +346,9 @@ def refresh_environment() -> None:
|
|
|
343
346
|
]
|
|
344
347
|
for mod in modules_to_reload:
|
|
345
348
|
del sys.modules[mod]
|
|
349
|
+
warnings.filterwarnings(
|
|
350
|
+
"ignore", module="flaml", message="^.*flaml.automl is not available.*$"
|
|
351
|
+
)
|
|
346
352
|
import autogen
|
|
347
353
|
from autogen.io import IOStream
|
|
348
354
|
|
|
@@ -361,4 +367,57 @@ def get_printer() -> Callable[..., None]:
|
|
|
361
367
|
"""
|
|
362
368
|
from autogen.io import IOStream
|
|
363
369
|
|
|
364
|
-
|
|
370
|
+
printer = IOStream.get_default().print
|
|
371
|
+
|
|
372
|
+
def safe_printer(*args: object, **kwargs: object) -> None:
|
|
373
|
+
try:
|
|
374
|
+
printer(*args, **kwargs)
|
|
375
|
+
except UnicodeEncodeError:
|
|
376
|
+
# pylint: disable=too-many-try-statements
|
|
377
|
+
try:
|
|
378
|
+
msg, flush = get_what_to_print(*args, **kwargs)
|
|
379
|
+
printer(msg, end="", flush=flush)
|
|
380
|
+
except UnicodeEncodeError:
|
|
381
|
+
sys.stdout = io.TextIOWrapper(
|
|
382
|
+
sys.stdout.buffer, encoding="utf-8"
|
|
383
|
+
)
|
|
384
|
+
sys.stderr = io.TextIOWrapper(
|
|
385
|
+
sys.stderr.buffer, encoding="utf-8"
|
|
386
|
+
)
|
|
387
|
+
try:
|
|
388
|
+
printer(*args, **kwargs)
|
|
389
|
+
except UnicodeEncodeError:
|
|
390
|
+
sys.stderr.write(
|
|
391
|
+
"Could not print the message due to encoding issues.\n"
|
|
392
|
+
)
|
|
393
|
+
|
|
394
|
+
return safe_printer
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
def get_what_to_print(*args: object, **kwargs: object) -> Tuple[str, bool]:
|
|
398
|
+
"""Get what to print.
|
|
399
|
+
|
|
400
|
+
Parameters
|
|
401
|
+
----------
|
|
402
|
+
args : object
|
|
403
|
+
The arguments.
|
|
404
|
+
kwargs : object
|
|
405
|
+
The keyword arguments.
|
|
406
|
+
|
|
407
|
+
Returns
|
|
408
|
+
-------
|
|
409
|
+
Tuple[str, bool]
|
|
410
|
+
The message and whether to flush.
|
|
411
|
+
"""
|
|
412
|
+
sep = kwargs.get("sep", " ")
|
|
413
|
+
if not isinstance(sep, str):
|
|
414
|
+
sep = " "
|
|
415
|
+
end = kwargs.get("end", "\n")
|
|
416
|
+
if not isinstance(end, str):
|
|
417
|
+
end = "\n"
|
|
418
|
+
flush = kwargs.get("flush", False)
|
|
419
|
+
if not isinstance(flush, bool):
|
|
420
|
+
flush = False
|
|
421
|
+
msg = sep.join(str(arg) for arg in args) + end
|
|
422
|
+
utf8_msg = msg.encode("utf-8", errors="replace").decode("utf-8")
|
|
423
|
+
return utf8_msg, flush
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: waldiez
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: waldiez
|
|
5
|
-
Project-URL: homepage, https://waldiez.github.io/waldiez/
|
|
6
|
-
Project-URL: repository, https://github.com/waldiez/
|
|
7
|
-
Author-email: Panagiotis Kasnesis <pkasnesis@
|
|
5
|
+
Project-URL: homepage, https://waldiez.github.io/waldiez/python
|
|
6
|
+
Project-URL: repository, https://github.com/waldiez/python.git
|
|
7
|
+
Author-email: Panagiotis Kasnesis <pkasnesis@waldiez.io>, Lazaros Toumanidis <laztoum@waldiez.io>, Stella Ioannidou <stella@humancentered.gr>
|
|
8
8
|
License-File: LICENSE
|
|
9
9
|
Classifier: Development Status :: 3 - Alpha
|
|
10
10
|
Classifier: Intended Audience :: Developers
|
|
@@ -18,26 +18,26 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.12
|
|
19
19
|
Requires-Python: <3.13,>=3.10
|
|
20
20
|
Requires-Dist: jupytext
|
|
21
|
-
Requires-Dist: pyautogen==0.
|
|
21
|
+
Requires-Dist: pyautogen==0.6.0
|
|
22
22
|
Requires-Dist: pydantic>=2.0
|
|
23
23
|
Requires-Dist: typer<0.13,>=0.9
|
|
24
24
|
Provides-Extra: ag2-extras
|
|
25
|
+
Requires-Dist: autogen[captainagent]==0.6.0; (platform_system == 'Linux') and extra == 'ag2-extras'
|
|
25
26
|
Requires-Dist: pgvector>=0.3.6; extra == 'ag2-extras'
|
|
26
27
|
Requires-Dist: psycopg[binary]>=3.2.3; extra == 'ag2-extras'
|
|
27
|
-
Requires-Dist: pyautogen[anthropic]==0.
|
|
28
|
-
Requires-Dist: pyautogen[bedrock]==0.
|
|
29
|
-
Requires-Dist: pyautogen[
|
|
30
|
-
Requires-Dist: pyautogen[
|
|
31
|
-
Requires-Dist: pyautogen[
|
|
32
|
-
Requires-Dist: pyautogen[
|
|
33
|
-
Requires-Dist: pyautogen[
|
|
34
|
-
Requires-Dist: pyautogen[
|
|
35
|
-
Requires-Dist: pyautogen[retrievechat-
|
|
36
|
-
Requires-Dist: pyautogen[retrievechat-
|
|
37
|
-
Requires-Dist: pyautogen[retrievechat
|
|
38
|
-
Requires-Dist: pyautogen[
|
|
39
|
-
Requires-Dist: pyautogen[
|
|
40
|
-
Requires-Dist: pyautogen[websurfer]==0.5.3; extra == 'ag2-extras'
|
|
28
|
+
Requires-Dist: pyautogen[anthropic]==0.6.0; extra == 'ag2-extras'
|
|
29
|
+
Requires-Dist: pyautogen[bedrock]==0.6.0; extra == 'ag2-extras'
|
|
30
|
+
Requires-Dist: pyautogen[gemini]==0.6.0; extra == 'ag2-extras'
|
|
31
|
+
Requires-Dist: pyautogen[groq]==0.6.0; extra == 'ag2-extras'
|
|
32
|
+
Requires-Dist: pyautogen[lmm]==0.6.0; extra == 'ag2-extras'
|
|
33
|
+
Requires-Dist: pyautogen[mistral]==0.6.0; extra == 'ag2-extras'
|
|
34
|
+
Requires-Dist: pyautogen[neo4j]==0.6.0; extra == 'ag2-extras'
|
|
35
|
+
Requires-Dist: pyautogen[retrievechat-mongodb]==0.6.0; extra == 'ag2-extras'
|
|
36
|
+
Requires-Dist: pyautogen[retrievechat-pgvector]==0.6.0; extra == 'ag2-extras'
|
|
37
|
+
Requires-Dist: pyautogen[retrievechat-qdrant]==0.6.0; (python_version < '3.13') and extra == 'ag2-extras'
|
|
38
|
+
Requires-Dist: pyautogen[retrievechat]==0.6.0; extra == 'ag2-extras'
|
|
39
|
+
Requires-Dist: pyautogen[together]==0.6.0; extra == 'ag2-extras'
|
|
40
|
+
Requires-Dist: pyautogen[websurfer]==0.6.0; extra == 'ag2-extras'
|
|
41
41
|
Requires-Dist: pymongo==4.10.1; extra == 'ag2-extras'
|
|
42
42
|
Requires-Dist: qdrant-client[fastembed]; (python_version >= '3.13') and extra == 'ag2-extras'
|
|
43
43
|
Provides-Extra: dev
|
|
@@ -46,12 +46,12 @@ Requires-Dist: bandit==1.8.0; extra == 'dev'
|
|
|
46
46
|
Requires-Dist: black[jupyter]==24.10.0; extra == 'dev'
|
|
47
47
|
Requires-Dist: flake8==7.1.1; extra == 'dev'
|
|
48
48
|
Requires-Dist: isort==5.13.2; extra == 'dev'
|
|
49
|
-
Requires-Dist: mypy==1.
|
|
49
|
+
Requires-Dist: mypy==1.14.0; extra == 'dev'
|
|
50
50
|
Requires-Dist: pre-commit==4.0.1; extra == 'dev'
|
|
51
51
|
Requires-Dist: pydocstyle==6.3.0; extra == 'dev'
|
|
52
|
-
Requires-Dist: pylint==3.3.
|
|
52
|
+
Requires-Dist: pylint==3.3.3; extra == 'dev'
|
|
53
53
|
Requires-Dist: python-dotenv==1.0.1; extra == 'dev'
|
|
54
|
-
Requires-Dist: ruff==0.8.
|
|
54
|
+
Requires-Dist: ruff==0.8.4; extra == 'dev'
|
|
55
55
|
Requires-Dist: toml; (python_version <= '3.10') and extra == 'dev'
|
|
56
56
|
Requires-Dist: types-pyyaml==6.0.12.20240917; extra == 'dev'
|
|
57
57
|
Requires-Dist: types-toml==0.10.8.20240310; extra == 'dev'
|
|
@@ -66,6 +66,11 @@ Requires-Dist: mkdocs-minify-html-plugin==0.2.3; extra == 'docs'
|
|
|
66
66
|
Requires-Dist: mkdocs==1.6.1; extra == 'docs'
|
|
67
67
|
Requires-Dist: mkdocstrings-python==1.12.2; extra == 'docs'
|
|
68
68
|
Requires-Dist: mkdocstrings[crystal,python]==0.27.0; extra == 'docs'
|
|
69
|
+
Provides-Extra: jupyter
|
|
70
|
+
Requires-Dist: jupyterlab>=4.3.0; extra == 'jupyter'
|
|
71
|
+
Requires-Dist: waldiez-jupyter==0.2.0; extra == 'jupyter'
|
|
72
|
+
Provides-Extra: studio
|
|
73
|
+
Requires-Dist: waldiez-studio==0.2.0; extra == 'studio'
|
|
69
74
|
Provides-Extra: test
|
|
70
75
|
Requires-Dist: pytest-cov==6.0.0; extra == 'test'
|
|
71
76
|
Requires-Dist: pytest-html==4.1.1; extra == 'test'
|
|
@@ -77,11 +82,11 @@ Description-Content-Type: text/markdown
|
|
|
77
82
|
|
|
78
83
|
# Waldiez
|
|
79
84
|
|
|
80
|
-
 [](https://coveralls.io/github/waldiez/python) [](https://badge.fury.io/py/waldiez)
|
|
81
86
|
|
|
82
87
|
Translate a Waldiez flow:
|
|
83
88
|
|
|
84
|
-

|
|
85
90
|
|
|
86
91
|
To a python script or a jupyter notebook with the corresponding [ag2](https://github.com/ag2ai/ag2/) agents and chats.
|
|
87
92
|
|
|
@@ -102,11 +107,30 @@ python -m pip install waldiez
|
|
|
102
107
|
From the repository:
|
|
103
108
|
|
|
104
109
|
```bash
|
|
105
|
-
python -m pip install git+https://github.com/waldiez/
|
|
110
|
+
python -m pip install git+https://github.com/waldiez/python.git
|
|
106
111
|
```
|
|
107
112
|
|
|
108
113
|
## Usage
|
|
109
114
|
|
|
115
|
+
### UI Options
|
|
116
|
+
|
|
117
|
+
- For creating-only (no exporting or running) waldiez flows, you can use the playground at <https://waldiez.github.io>.
|
|
118
|
+
The repo for the js library is [here](https://github.com/waldiez/react).
|
|
119
|
+
- There is also a jupyterlab extension [here](https://github.com/waldiez/jupyter)
|
|
120
|
+
- You also can use the vscode extension:
|
|
121
|
+
- [repo](https://github.com/waldiez/vscode)
|
|
122
|
+
- [marketplace](https://marketplace.visualstudio.com/items?itemName=Waldiez.waldiez-vscode)
|
|
123
|
+
- Finally, you can use [waldiez-studio](https://github.com/waldiez/studio)
|
|
124
|
+
|
|
125
|
+
<!--
|
|
126
|
+
The jupyterlab extension and studio also provided as extras in the main package.
|
|
127
|
+
|
|
128
|
+
```shell
|
|
129
|
+
pip install waldiez[studio] # or pip install waldiez_studio
|
|
130
|
+
pip install waldiez[jupyter] # or pip install waldiez_jupyter
|
|
131
|
+
# or both
|
|
132
|
+
pip install waldiez[studio,jupyter]
|
|
133
|
+
``` -->
|
|
110
134
|
### CLI
|
|
111
135
|
|
|
112
136
|
```bash
|
|
@@ -148,13 +172,6 @@ $CONTAINER_COMMAND run \
|
|
|
148
172
|
waldiez/waldiez run --file /flow.waldiez --output /output/output[.py]
|
|
149
173
|
```
|
|
150
174
|
|
|
151
|
-
### UI
|
|
152
|
-
|
|
153
|
-
For creating-only (no exporting or running) waldiez flows, you can use the playground at <https://waldiez.github.io>.
|
|
154
|
-
The repo for the js library is [here](https://github.com/waldiez/react).
|
|
155
|
-
We are currently working on waldiez-studio to provide a visual interface for creating and running Waldiez flows (you can find more [here](https://github.com/waldiez/studio)).
|
|
156
|
-
Until then, you can use our [Jupyter](https://github.com/waldiez/jupyter) or the [VSCode](https://github.com/waldiez/vscode) extension to create and run Waldiez flows.
|
|
157
|
-
|
|
158
175
|
### As a library
|
|
159
176
|
|
|
160
177
|
#### Export a flow
|
|
@@ -167,7 +184,7 @@ output_path = "/path/to/an/output.py" # or .ipynb
|
|
|
167
184
|
exporter = WaldiezExporter.load(flow_path)
|
|
168
185
|
exporter.export(output_path)
|
|
169
186
|
```
|
|
170
|
-
|
|
187
|
+
|
|
171
188
|
#### Run a flow
|
|
172
189
|
|
|
173
190
|
```python
|
|
@@ -195,11 +212,11 @@ runner.run(output_path=output_path)
|
|
|
195
212
|
```
|
|
196
213
|
|
|
197
214
|
If already installed waldiez you might need to reinstall it after uninstalling `autogen-agentchat`:
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
215
|
+
|
|
216
|
+
```shell
|
|
217
|
+
pip install --force --no-cache waldiez pyautogen
|
|
218
|
+
```
|
|
202
219
|
|
|
203
220
|
## License
|
|
204
221
|
|
|
205
|
-
This project is licensed under the MIT License - see the [LICENSE](https://github.com/waldiez/
|
|
222
|
+
This project is licensed under the MIT License - see the [LICENSE](https://github.com/waldiez/python/blob/main/LICENSE) file for details.
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
waldiez/__init__.py,sha256=
|
|
1
|
+
waldiez/__init__.py,sha256=06YinMpFcPN2mGHwloBAaCUXvWJYN9HW6sxLwRz_0G4,2056
|
|
2
2
|
waldiez/__main__.py,sha256=mUQWu4CF03Jbbscvcfb_9EFTnIMliJJJmAuWf0sRRZU,110
|
|
3
|
-
waldiez/_version.py,sha256=
|
|
4
|
-
waldiez/cli.py,sha256=
|
|
3
|
+
waldiez/_version.py,sha256=PIBgTgbbj2qAk3hBgyVeGwyQnBcPkQ0T8gUfCv_5jIY,62
|
|
4
|
+
waldiez/cli.py,sha256=yaPq02XRN1z0xS0lNn63rIO7SI7eHv7xksTwyrNm0RI,6544
|
|
5
|
+
waldiez/cli_extras.py,sha256=ZB-1cGBo19epjWJ3hBM6H-TLRNnYZNbqlDmjRmGJTJk,3007
|
|
5
6
|
waldiez/conflict_checker.py,sha256=E-w0TfTivDAVpNvjd_NSBeaaFsWtWAyxKoSz0-g6x2U,880
|
|
6
|
-
waldiez/exporter.py,sha256=
|
|
7
|
+
waldiez/exporter.py,sha256=yDtJL-p-wm4DeJnNE5xlyQUAeMTBkeFz5e9DikjDX5k,9517
|
|
7
8
|
waldiez/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
-
waldiez/runner.py,sha256=
|
|
9
|
+
waldiez/runner.py,sha256=5QjsJOYZlStTBQKyGjViLPhC94JuEaYIgrKP6XMvCHA,13045
|
|
9
10
|
waldiez/exporting/__init__.py,sha256=GMY7qTRpNmc7tpaCFNGLT5wX9eu26NvoNPuYX8MzP50,344
|
|
10
11
|
waldiez/exporting/agents/__init__.py,sha256=v5KA112W_EFYwXE2TSBKYyO8rRKUOUAOpFS5CMSnfRs,110
|
|
11
12
|
waldiez/exporting/agents/agent.py,sha256=d2ut2B90-aG4uBRhPWS7B4MKIvSJqQva6DjlXiqleVQ,7513
|
|
@@ -21,16 +22,16 @@ waldiez/exporting/agents/rag_user/mongo_utils.py,sha256=y5IL-Anfktg9cYo2o-ED1A7l
|
|
|
21
22
|
waldiez/exporting/agents/rag_user/pgvector_utils.py,sha256=EyGDwvo1Pe8bqoJl3NFpqK6zizN81lPPaSMBMQF79Dc,2722
|
|
22
23
|
waldiez/exporting/agents/rag_user/qdrant_utils.py,sha256=tn1A7pjQjJfGS33ALgnPYTz7xu8rVBidcc5-WHLq8e8,3487
|
|
23
24
|
waldiez/exporting/agents/rag_user/rag_user.py,sha256=uT0wlYCYbBjsw6uZm9bXAk6IaMtk0fev7sM6Xf1MuTo,6268
|
|
24
|
-
waldiez/exporting/agents/rag_user/vector_db.py,sha256=
|
|
25
|
+
waldiez/exporting/agents/rag_user/vector_db.py,sha256=bqcPPG-eDABWOsZDDX0kDWhZSwaPO-QbqaFmPqdoYys,3679
|
|
25
26
|
waldiez/exporting/chats/__init__.py,sha256=v5aR1gWqSN5xeDDMIFo-ceC_Z9UgL8qJZofC2sU8HqQ,296
|
|
26
27
|
waldiez/exporting/chats/chats.py,sha256=xI5ZzWpcqYz8Kuu7B9pU6iHN16wUwHxOvYFhH5vxWuA,1259
|
|
27
|
-
waldiez/exporting/chats/helpers.py,sha256=
|
|
28
|
+
waldiez/exporting/chats/helpers.py,sha256=M9-FLK_YACrCQaqpKV4Cep-u0LSSoZK7T5H4U-RW8Uw,13372
|
|
28
29
|
waldiez/exporting/chats/nested.py,sha256=nYzxOTHSBpyFdqvX_NtZUvUgTdmoTZcCRaGTFzdnmII,7916
|
|
29
30
|
waldiez/exporting/flow/__init__.py,sha256=WhdPrjXQAcihrS1KUtPNgbx0y1tqD5HtGykzpEAcsBM,98
|
|
30
31
|
waldiez/exporting/flow/def_main.py,sha256=UWNw3xrXLelx39FF5CNIBGMqUiFRfV-T_VdIHs6FQ4o,966
|
|
31
32
|
waldiez/exporting/flow/flow.py,sha256=ewSyWMoAuHekGkh5KnMAN10_cYv9mmlxzQGzRVQdYpE,6150
|
|
32
|
-
waldiez/exporting/models/__init__.py,sha256=
|
|
33
|
-
waldiez/exporting/skills/__init__.py,sha256=
|
|
33
|
+
waldiez/exporting/models/__init__.py,sha256=wVjBMexIWihD5i1TkOyivDsouJ94FRzyiAjYchDYBfk,7106
|
|
34
|
+
waldiez/exporting/skills/__init__.py,sha256=hjW16Uu3MkZfoEKyGnIrTBTVLvW0GdGzJmWXBcSDvsQ,4666
|
|
34
35
|
waldiez/exporting/utils/__init__.py,sha256=tP1V4g9-MyARlfOEL_1YWMJNW7UivUrrukq7DIwdq6k,1018
|
|
35
36
|
waldiez/exporting/utils/comments.py,sha256=X9j8w48rh3DfFDjiMverU9DBSuE9yuMMbbStxBbN1sE,3190
|
|
36
37
|
waldiez/exporting/utils/importing.py,sha256=dA4HCQ-OxmodUjovgXyLI9IwNvLwbY67P41969XoZ7g,8649
|
|
@@ -40,7 +41,7 @@ waldiez/exporting/utils/naming.py,sha256=VdoVODQduhXIs9hQFWUVEVqTaSyNDt7rkECsuIg
|
|
|
40
41
|
waldiez/exporting/utils/object_string.py,sha256=2kdIu4in3iUV92a2KbLWwp9POhvY-fzF_r2AGVnCKls,2166
|
|
41
42
|
waldiez/exporting/utils/path_check.py,sha256=aO49sbk6hUHEr65UjNNUSKO5WCGnQitiT733W-kGVtI,1062
|
|
42
43
|
waldiez/models/__init__.py,sha256=IMq8vzuAgmv92kHSSuZQLF38vVd31ojgOHonuHqWYj0,2888
|
|
43
|
-
waldiez/models/waldiez.py,sha256=
|
|
44
|
+
waldiez/models/waldiez.py,sha256=IedhA4gPOWBca057xFstVoR5fsHtpFfItrydMKfGngw,9566
|
|
44
45
|
waldiez/models/agents/__init__.py,sha256=3ZyVYBHMFzZjRMIdPrBF6HLg82LPAlEubL6utL6KhfU,1856
|
|
45
46
|
waldiez/models/agents/agents.py,sha256=zIqihnoBjzaQLL_P6FcVoHddcusRNYsWPIFLZD091bE,3641
|
|
46
47
|
waldiez/models/agents/agent/__init__.py,sha256=inA0zV3dnwmcQlcObH_FLaZSURjFG31E_XUampJAnJU,746
|
|
@@ -62,7 +63,7 @@ waldiez/models/agents/rag_user/__init__.py,sha256=_Ge6ekCPHGuDuebbP3unUKbWrjeN8H
|
|
|
62
63
|
waldiez/models/agents/rag_user/rag_user.py,sha256=l4a_IzlNPtNb-GTx22r15XIVmHxvhuM5KbXjkUwS8JU,1558
|
|
63
64
|
waldiez/models/agents/rag_user/rag_user_data.py,sha256=4WjG8UcQ8ltLAxvZgsZUUlaEqHrX3KewrVIH7UJeUYo,870
|
|
64
65
|
waldiez/models/agents/rag_user/retrieve_config.py,sha256=ZG0kqdza35aoMm9ZJdU-jLPDo-PJFkeUZycnaE3secI,21817
|
|
65
|
-
waldiez/models/agents/rag_user/vector_db_config.py,sha256=
|
|
66
|
+
waldiez/models/agents/rag_user/vector_db_config.py,sha256=JdPoQ8wVnZGyIkNrb85xZzSuia8PF4ejQkGDbbXsDC4,4922
|
|
66
67
|
waldiez/models/agents/user_proxy/__init__.py,sha256=RNLQ5ws58mJE-8ckjAvC8UvXPUu5CyTe8-iDLxSFogQ,178
|
|
67
68
|
waldiez/models/agents/user_proxy/user_proxy.py,sha256=Um9Oxprpct1Dlg7dwi0S4v6z8IGjlcrirM-BpgV5XaU,1071
|
|
68
69
|
waldiez/models/agents/user_proxy/user_proxy_data.py,sha256=3aQ4N-C1mEt4FDkOzaknLGbwfoFuDD47OkLJSNgSvcQ,833
|
|
@@ -74,18 +75,18 @@ waldiez/models/chat/chat_nested.py,sha256=OFeytlQ1Rgt6hx9_-xe47PdNnmgztokxldEDPJ
|
|
|
74
75
|
waldiez/models/chat/chat_summary.py,sha256=fiF0X6nk5dLoZFfwKBHoytk2ArhvIpVHETyCIH7uKd4,2823
|
|
75
76
|
waldiez/models/common/__init__.py,sha256=1WhzhGYYUWMuHgxjiT1UralMClutO3_5BhFtnkhp8Yk,686
|
|
76
77
|
waldiez/models/common/base.py,sha256=Aef91uGtbDfpUBGpY0m49L0tBHSaX23xvHDekIq-3H0,1687
|
|
77
|
-
waldiez/models/common/method_utils.py,sha256=
|
|
78
|
+
waldiez/models/common/method_utils.py,sha256=5DnZ6svR04FmQrSdP7elyEr2O2DfjOVJfOe1-Nda278,5522
|
|
78
79
|
waldiez/models/flow/__init__.py,sha256=oy_G58xDkZk_LZEvqmr-0MJrpYy1JRf-U-F5-bI1944,162
|
|
79
80
|
waldiez/models/flow/flow.py,sha256=1r0g_vBMd2PKcRC8P1ylWOUW3zwb529oOglf91SkILI,9663
|
|
80
81
|
waldiez/models/flow/flow_data.py,sha256=m-RYaqlWjVpjyUzX9iAtXn1GOH0pFGKd2QD3e_e7yrk,2694
|
|
81
|
-
waldiez/models/model/__init__.py,sha256=
|
|
82
|
-
waldiez/models/model/model.py,sha256=
|
|
83
|
-
waldiez/models/model/model_data.py,sha256=
|
|
82
|
+
waldiez/models/model/__init__.py,sha256=nT9jdKqeV4LPkqWi84Z7hCYZ1257Tj8YhUWbxhFlQl0,290
|
|
83
|
+
waldiez/models/model/model.py,sha256=9A-pIufm9Sn4X9syphxtCOFfZ3BNo8ft07uxNXSRRiI,6130
|
|
84
|
+
waldiez/models/model/model_data.py,sha256=IBXZLaTs4RzEb0xaHuouqesTLgKp3jEBlKlIKNGI2as,3699
|
|
84
85
|
waldiez/models/skill/__init__.py,sha256=rU88bajKOGMYoHFcE8MP0jW9H0MswbQmvz5wxS35BYE,169
|
|
85
86
|
waldiez/models/skill/skill.py,sha256=fhsAI413an2_d4DBIkf7dzEuWk6rGs2t4sl97a4dj20,3473
|
|
86
87
|
waldiez/models/skill/skill_data.py,sha256=RTWn8Od6w7g-nRIpsS29sqZ8sPm5dCPiK7-qXmU-KD4,815
|
|
87
|
-
waldiez-0.
|
|
88
|
-
waldiez-0.
|
|
89
|
-
waldiez-0.
|
|
90
|
-
waldiez-0.
|
|
91
|
-
waldiez-0.
|
|
88
|
+
waldiez-0.2.0.dist-info/METADATA,sha256=4UkJ_6EcVTb0xxwkf1xgsPsX7pPu8vYH5KJEVTxdZnM,8659
|
|
89
|
+
waldiez-0.2.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
90
|
+
waldiez-0.2.0.dist-info/entry_points.txt,sha256=9MQ8Y1rD19CU7UwjNPwoyTRpQsPs2QimjrtwTD0bD6k,44
|
|
91
|
+
waldiez-0.2.0.dist-info/licenses/LICENSE,sha256=5ds5KvqN0audHYSaoarNtEITRRx9cZhq4wWPmFvmU48,1065
|
|
92
|
+
waldiez-0.2.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|