waldiez 0.1.10__py3-none-any.whl → 0.1.11__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 +18 -0
- waldiez/_version.py +1 -1
- waldiez/conflict_checker.py +23 -0
- waldiez/exporting/skills/__init__.py +36 -1
- {waldiez-0.1.10.dist-info → waldiez-0.1.11.dist-info}/METADATA +35 -21
- {waldiez-0.1.10.dist-info → waldiez-0.1.11.dist-info}/RECORD +9 -8
- {waldiez-0.1.10.dist-info → waldiez-0.1.11.dist-info}/WHEEL +0 -0
- {waldiez-0.1.10.dist-info → waldiez-0.1.11.dist-info}/entry_points.txt +0 -0
- {waldiez-0.1.10.dist-info → waldiez-0.1.11.dist-info}/licenses/LICENSE +0 -0
waldiez/__init__.py
CHANGED
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
"""Waldiez package."""
|
|
2
2
|
|
|
3
3
|
from ._version import __version__
|
|
4
|
+
from .conflict_checker import check_conflicts
|
|
4
5
|
from .exporter import WaldiezExporter
|
|
5
6
|
from .models import Waldiez
|
|
6
7
|
from .runner import WaldiezRunner
|
|
7
8
|
|
|
9
|
+
# flag to check if ag2 and autogen-agentchat
|
|
10
|
+
# are installed at the same time
|
|
11
|
+
__WALDIEZ_CHECKED_FOR_CONFLICTS = False
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _check_conflicts_once() -> None:
|
|
15
|
+
"""Check for conflicts once."""
|
|
16
|
+
# pylint: disable=global-statement
|
|
17
|
+
global __WALDIEZ_CHECKED_FOR_CONFLICTS
|
|
18
|
+
if __WALDIEZ_CHECKED_FOR_CONFLICTS is False:
|
|
19
|
+
check_conflicts()
|
|
20
|
+
__WALDIEZ_CHECKED_FOR_CONFLICTS = True
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
_check_conflicts_once()
|
|
24
|
+
|
|
25
|
+
|
|
8
26
|
__all__ = [
|
|
9
27
|
"Waldiez",
|
|
10
28
|
"WaldiezExporter",
|
waldiez/_version.py
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"""Check for conflicts with 'autogen-agentchat' package."""
|
|
2
|
+
|
|
3
|
+
# pylint: disable=line-too-long
|
|
4
|
+
|
|
5
|
+
import sys
|
|
6
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
# fmt: off
|
|
10
|
+
def check_conflicts() -> None: # pragma: no cover
|
|
11
|
+
"""Check for conflicts with 'autogen-agentchat' package."""
|
|
12
|
+
try:
|
|
13
|
+
version("autogen-agentchat")
|
|
14
|
+
print(
|
|
15
|
+
"Conflict detected: 'autogen-agentchat' is installed, which conflicts with 'ag2'.\n"
|
|
16
|
+
"Please uninstall 'autogen-agentchat': pip uninstall -y autogen-agentchat \n"
|
|
17
|
+
"And install 'ag2' (or 'waldiez') again: pip install --force ag2"
|
|
18
|
+
)
|
|
19
|
+
sys.exit(1)
|
|
20
|
+
except PackageNotFoundError:
|
|
21
|
+
pass
|
|
22
|
+
|
|
23
|
+
# fmt: on
|
|
@@ -69,6 +69,32 @@ def get_agent_skill_registration(
|
|
|
69
69
|
return content
|
|
70
70
|
|
|
71
71
|
|
|
72
|
+
def _write_skill_secrets(
|
|
73
|
+
skill: WaldiezSkill,
|
|
74
|
+
skill_name: str,
|
|
75
|
+
output_dir: Path,
|
|
76
|
+
) -> None:
|
|
77
|
+
"""Write the skill secrets to a file.
|
|
78
|
+
|
|
79
|
+
Parameters
|
|
80
|
+
----------
|
|
81
|
+
skill : WaldiezSkill
|
|
82
|
+
The skill.
|
|
83
|
+
skill_name : str
|
|
84
|
+
The name of the skill.
|
|
85
|
+
output_dir : Path
|
|
86
|
+
The output directory to save the secrets to.
|
|
87
|
+
"""
|
|
88
|
+
if not skill.secrets:
|
|
89
|
+
return
|
|
90
|
+
secrets_file = output_dir / f"{skill_name}_secrets.py"
|
|
91
|
+
with secrets_file.open("w", encoding="utf-8") as f:
|
|
92
|
+
f.write('"""Secrets for the skill."""\n')
|
|
93
|
+
f.write("from os import environ\n\n")
|
|
94
|
+
for key, value in skill.secrets.items():
|
|
95
|
+
f.write(f'environ["{key}"] = "{value}"\n')
|
|
96
|
+
|
|
97
|
+
|
|
72
98
|
def export_skills(
|
|
73
99
|
skills: List[WaldiezSkill],
|
|
74
100
|
skill_names: Dict[str, str],
|
|
@@ -116,12 +142,21 @@ def export_skills(
|
|
|
116
142
|
skill_secrets: Set[Tuple[str, str]] = set()
|
|
117
143
|
for skill in skills:
|
|
118
144
|
skill_name = skill_names[skill.id]
|
|
119
|
-
skill_imports.add(f"from {skill_name} import {skill_name}")
|
|
120
145
|
skill_secrets.update(skill.secrets.items())
|
|
121
146
|
if not output_dir:
|
|
147
|
+
skill_imports.add(f"from {skill_name} import {skill_name}")
|
|
122
148
|
continue
|
|
123
149
|
if not isinstance(output_dir, Path):
|
|
124
150
|
output_dir = Path(output_dir)
|
|
151
|
+
if not skill.secrets:
|
|
152
|
+
skill_imports.add(f"from {skill_name} import {skill_name}")
|
|
153
|
+
else:
|
|
154
|
+
# have the secrets before the skill
|
|
155
|
+
skill_imports.add(
|
|
156
|
+
f"import {skill_name}_secrets # noqa\n"
|
|
157
|
+
f"from {skill_name} import {skill_name}"
|
|
158
|
+
)
|
|
159
|
+
_write_skill_secrets(skill, skill_name, output_dir)
|
|
125
160
|
skill_file = output_dir / f"{skill_name}.py"
|
|
126
161
|
with skill_file.open("w", encoding="utf-8") as f:
|
|
127
162
|
f.write(skill.content)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: waldiez
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.11
|
|
4
4
|
Summary: waldiez
|
|
5
5
|
Project-URL: homepage, https://waldiez.github.io/waldiez/
|
|
6
6
|
Project-URL: repository, https://github.com/waldiez/waldiez.git
|
|
@@ -16,30 +16,30 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.11
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
18
18
|
Requires-Python: <3.13,>=3.10
|
|
19
|
-
Requires-Dist: ag2==0.
|
|
19
|
+
Requires-Dist: ag2==0.4.1
|
|
20
20
|
Requires-Dist: jupytext
|
|
21
21
|
Provides-Extra: ag2-extras
|
|
22
|
-
Requires-Dist: ag2[anthropic]==0.
|
|
23
|
-
Requires-Dist: ag2[bedrock]==0.
|
|
24
|
-
Requires-Dist: ag2[
|
|
25
|
-
Requires-Dist: ag2[
|
|
26
|
-
Requires-Dist: ag2[
|
|
27
|
-
Requires-Dist: ag2[
|
|
28
|
-
Requires-Dist: ag2[
|
|
29
|
-
Requires-Dist: ag2[retrievechat-
|
|
30
|
-
Requires-Dist: ag2[retrievechat-
|
|
31
|
-
Requires-Dist: ag2[retrievechat]==0.
|
|
32
|
-
Requires-Dist: ag2[
|
|
33
|
-
Requires-Dist: ag2[
|
|
34
|
-
Requires-Dist:
|
|
22
|
+
Requires-Dist: ag2[anthropic]==0.4.1; extra == 'ag2-extras'
|
|
23
|
+
Requires-Dist: ag2[bedrock]==0.4.1; extra == 'ag2-extras'
|
|
24
|
+
Requires-Dist: ag2[captainagent]==0.4.1; extra == 'ag2-extras'
|
|
25
|
+
Requires-Dist: ag2[gemini]==0.4.1; extra == 'ag2-extras'
|
|
26
|
+
Requires-Dist: ag2[groq]==0.4.1; extra == 'ag2-extras'
|
|
27
|
+
Requires-Dist: ag2[lmm]==0.4.1; extra == 'ag2-extras'
|
|
28
|
+
Requires-Dist: ag2[mistral]==0.4.1; extra == 'ag2-extras'
|
|
29
|
+
Requires-Dist: ag2[retrievechat-mongodb]==0.4.1; extra == 'ag2-extras'
|
|
30
|
+
Requires-Dist: ag2[retrievechat-pgvector]==0.4.1; extra == 'ag2-extras'
|
|
31
|
+
Requires-Dist: ag2[retrievechat-qdrant]==0.4.1; extra == 'ag2-extras'
|
|
32
|
+
Requires-Dist: ag2[retrievechat]==0.4.1; extra == 'ag2-extras'
|
|
33
|
+
Requires-Dist: ag2[together]==0.4.1; extra == 'ag2-extras'
|
|
34
|
+
Requires-Dist: ag2[websurfer]==0.4.1; extra == 'ag2-extras'
|
|
35
35
|
Requires-Dist: fastembed==0.4.2; extra == 'ag2-extras'
|
|
36
|
-
Requires-Dist: pgvector>=0.
|
|
37
|
-
Requires-Dist: psycopg[binary]>=3.
|
|
36
|
+
Requires-Dist: pgvector>=0.3.6; extra == 'ag2-extras'
|
|
37
|
+
Requires-Dist: psycopg[binary]>=3.2.3; extra == 'ag2-extras'
|
|
38
38
|
Requires-Dist: pymongo==4.10.1; extra == 'ag2-extras'
|
|
39
39
|
Requires-Dist: qdrant-client==1.12.1; extra == 'ag2-extras'
|
|
40
40
|
Provides-Extra: dev
|
|
41
41
|
Requires-Dist: autoflake==2.3.1; extra == 'dev'
|
|
42
|
-
Requires-Dist: bandit==1.
|
|
42
|
+
Requires-Dist: bandit==1.8.0; extra == 'dev'
|
|
43
43
|
Requires-Dist: black[jupyter]==24.10.0; extra == 'dev'
|
|
44
44
|
Requires-Dist: flake8==7.1.1; extra == 'dev'
|
|
45
45
|
Requires-Dist: isort==5.13.2; extra == 'dev'
|
|
@@ -48,15 +48,15 @@ Requires-Dist: pre-commit==4.0.1; extra == 'dev'
|
|
|
48
48
|
Requires-Dist: pydocstyle==6.3.0; extra == 'dev'
|
|
49
49
|
Requires-Dist: pylint==3.3.1; extra == 'dev'
|
|
50
50
|
Requires-Dist: python-dotenv==1.0.1; extra == 'dev'
|
|
51
|
-
Requires-Dist: ruff==0.
|
|
52
|
-
Requires-Dist: types-pyyaml==6.0.12; extra == 'dev'
|
|
51
|
+
Requires-Dist: ruff==0.8.1; extra == 'dev'
|
|
52
|
+
Requires-Dist: types-pyyaml==6.0.12.20240917; extra == 'dev'
|
|
53
53
|
Requires-Dist: yamllint==1.35.1; extra == 'dev'
|
|
54
54
|
Provides-Extra: docs
|
|
55
55
|
Requires-Dist: mdx-include==1.4.2; extra == 'docs'
|
|
56
56
|
Requires-Dist: mdx-truly-sane-lists==1.3; extra == 'docs'
|
|
57
57
|
Requires-Dist: mkdocs-jupyter==0.25.1; extra == 'docs'
|
|
58
58
|
Requires-Dist: mkdocs-macros-plugin==1.3.7; extra == 'docs'
|
|
59
|
-
Requires-Dist: mkdocs-material==9.5.
|
|
59
|
+
Requires-Dist: mkdocs-material==9.5.46; extra == 'docs'
|
|
60
60
|
Requires-Dist: mkdocs-minify-html-plugin==0.2.3; extra == 'docs'
|
|
61
61
|
Requires-Dist: mkdocs==1.6.1; extra == 'docs'
|
|
62
62
|
Requires-Dist: mkdocstrings-python==1.12.2; extra == 'docs'
|
|
@@ -237,6 +237,20 @@ with WaldiezIOStream.set_default(io_stream):
|
|
|
237
237
|
- [juptytext](https://github.com/mwouts/jupytext)
|
|
238
238
|
- [pydantic](https://github.com/pydantic/pydantic)
|
|
239
239
|
|
|
240
|
+
## Known Conflicts
|
|
241
|
+
|
|
242
|
+
- **autogen-agentchat**: This package conflicts with `ag2`. Ensure that `autogen-agentchat` is uninstalled before installing `waldiez`. If you have already installed `autogen-agentchat`, you can uninstall it with the following command:
|
|
243
|
+
|
|
244
|
+
```shell
|
|
245
|
+
pip uninstall autogen-agentchat -y
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
If already installed waldiez you might need to reinstall it after uninstalling `autogen-agentchat`:
|
|
249
|
+
|
|
250
|
+
```shell
|
|
251
|
+
pip install --force --no-cache waldiez
|
|
252
|
+
```
|
|
253
|
+
|
|
240
254
|
## License
|
|
241
255
|
|
|
242
256
|
This project is licensed under the MIT License - see the [LICENSE](https://github.com/waldiez/waldiez/blob/main/LICENSE) file for details.
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
waldiez/__init__.py,sha256=
|
|
1
|
+
waldiez/__init__.py,sha256=ASGmxP3JcASIv89_tMYhYxvW0FlHK1jM0Nfb1hMN-z0,722
|
|
2
2
|
waldiez/__main__.py,sha256=9xR-F2ohZcRPDG6KrM7cJpXciKX-u6WdL221ckyJ04k,112
|
|
3
|
-
waldiez/_version.py,sha256=
|
|
3
|
+
waldiez/_version.py,sha256=sJthgAdM_fnhfUw7CJUqaPJliLLYbXnDEyzn7i1rA9U,63
|
|
4
4
|
waldiez/cli.py,sha256=wStRkt056Y-F2CcuD6Zlov-ooUpWndyNesV9s_MjyHU,4798
|
|
5
|
+
waldiez/conflict_checker.py,sha256=T5FA7hsxpuW0Byb4YyZQ3-uVxzNnoTQV199YRBKjvmE,707
|
|
5
6
|
waldiez/exporter.py,sha256=iKe-l_Me8NRWsXHIdBcrOrnLT9XIyp4iYi4HLuuj2jA,9342
|
|
6
7
|
waldiez/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
8
|
waldiez/runner.py,sha256=hBHgtfxcV7LlGMAwGEf7xbNp3_qEvFsnbTTnKfe-Y1g,11097
|
|
@@ -29,7 +30,7 @@ waldiez/exporting/flow/__init__.py,sha256=WhdPrjXQAcihrS1KUtPNgbx0y1tqD5HtGykzpE
|
|
|
29
30
|
waldiez/exporting/flow/def_main.py,sha256=YpdhqO4iFng3r7if69ZPMJAibPVNDqnrOrWvGw7CJq8,1052
|
|
30
31
|
waldiez/exporting/flow/flow.py,sha256=x2AlXr7aJJfrPMeuXQYfT9sG5GycMwf0kRkovZWKGag,6206
|
|
31
32
|
waldiez/exporting/models/__init__.py,sha256=_Yt6sBAyRrN3LSAg4Nrh4dP7pmtIzGzWu4G1AutxK-Q,7078
|
|
32
|
-
waldiez/exporting/skills/__init__.py,sha256=
|
|
33
|
+
waldiez/exporting/skills/__init__.py,sha256=RQUDX77TQR8zI0mSXpCiK6wjx6Db3MapI_BEGQWV61A,4638
|
|
33
34
|
waldiez/exporting/utils/__init__.py,sha256=tP1V4g9-MyARlfOEL_1YWMJNW7UivUrrukq7DIwdq6k,1018
|
|
34
35
|
waldiez/exporting/utils/comments.py,sha256=X9j8w48rh3DfFDjiMverU9DBSuE9yuMMbbStxBbN1sE,3190
|
|
35
36
|
waldiez/exporting/utils/importing.py,sha256=dA4HCQ-OxmodUjovgXyLI9IwNvLwbY67P41969XoZ7g,8649
|
|
@@ -84,8 +85,8 @@ waldiez/models/model/model_data.py,sha256=pDPKUbltaXWjCuDArgwTOEHw_igfk_DkxzFzdn
|
|
|
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.1.
|
|
88
|
-
waldiez-0.1.
|
|
89
|
-
waldiez-0.1.
|
|
90
|
-
waldiez-0.1.
|
|
91
|
-
waldiez-0.1.
|
|
88
|
+
waldiez-0.1.11.dist-info/METADATA,sha256=hzcUFwIJ4SXtYWeEbhfTNy8A7fkVupJFm5GJhfCbuOg,9288
|
|
89
|
+
waldiez-0.1.11.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
90
|
+
waldiez-0.1.11.dist-info/entry_points.txt,sha256=5Po4yQXPa_QEdtTevpEBgr3rGoIvDMeQuJR2zqwBLBo,45
|
|
91
|
+
waldiez-0.1.11.dist-info/licenses/LICENSE,sha256=VQEHM6WMQLRu1qaGl3GWsoOknDwro-69eGo4NLIJPIM,1064
|
|
92
|
+
waldiez-0.1.11.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|