waldiez 0.1.20__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of waldiez might be problematic. Click here for more details.
- {waldiez-0.1.20 → waldiez-0.2.1}/.gitignore +2 -1
- {waldiez-0.1.20 → waldiez-0.2.1}/LICENSE +1 -1
- {waldiez-0.1.20 → waldiez-0.2.1}/PKG-INFO +55 -38
- {waldiez-0.1.20 → waldiez-0.2.1}/README.md +28 -16
- {waldiez-0.1.20 → waldiez-0.2.1}/pyproject.toml +45 -35
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/__init__.py +3 -1
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/_version.py +1 -1
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/cli.py +9 -1
- waldiez-0.2.1/waldiez/cli_extras.py +123 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/exporter.py +11 -4
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/exporting/agents/rag_user/vector_db.py +1 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/exporting/chats/helpers.py +1 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/exporting/models/__init__.py +3 -1
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/exporting/skills/__init__.py +2 -2
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/agents/rag_user/vector_db_config.py +2 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/common/method_utils.py +1 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/model/model_data.py +1 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/waldiez.py +8 -5
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/runner.py +5 -2
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/__main__.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/conflict_checker.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/exporting/__init__.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/exporting/agents/__init__.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/exporting/agents/agent.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/exporting/agents/agent_skills.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/exporting/agents/code_execution.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/exporting/agents/group_manager.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/exporting/agents/llm_config.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/exporting/agents/rag_user/__init__.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/exporting/agents/rag_user/chroma_utils.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/exporting/agents/rag_user/mongo_utils.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/exporting/agents/rag_user/pgvector_utils.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/exporting/agents/rag_user/qdrant_utils.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/exporting/agents/rag_user/rag_user.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/exporting/agents/teachability.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/exporting/agents/termination_message.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/exporting/chats/__init__.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/exporting/chats/chats.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/exporting/chats/nested.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/exporting/flow/__init__.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/exporting/flow/def_main.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/exporting/flow/flow.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/exporting/utils/__init__.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/exporting/utils/comments.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/exporting/utils/importing.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/exporting/utils/logging_utils.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/exporting/utils/method_utils.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/exporting/utils/naming.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/exporting/utils/object_string.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/exporting/utils/path_check.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/__init__.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/agents/__init__.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/agents/agent/__init__.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/agents/agent/agent.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/agents/agent/agent_data.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/agents/agent/code_execution.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/agents/agent/linked_skill.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/agents/agent/nested_chat.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/agents/agent/teachability.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/agents/agent/termination_message.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/agents/agents.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/agents/assistant/__init__.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/agents/assistant/assistant.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/agents/assistant/assistant_data.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/agents/group_manager/__init__.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/agents/group_manager/group_manager.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/agents/group_manager/group_manager_data.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/agents/group_manager/speakers.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/agents/rag_user/__init__.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/agents/rag_user/rag_user.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/agents/rag_user/rag_user_data.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/agents/rag_user/retrieve_config.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/agents/user_proxy/__init__.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/agents/user_proxy/user_proxy.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/agents/user_proxy/user_proxy_data.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/chat/__init__.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/chat/chat.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/chat/chat_data.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/chat/chat_message.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/chat/chat_nested.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/chat/chat_summary.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/common/__init__.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/common/base.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/flow/__init__.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/flow/flow.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/flow/flow_data.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/model/__init__.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/model/model.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/skill/__init__.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/skill/skill.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/models/skill/skill_data.py +0 -0
- {waldiez-0.1.20 → waldiez-0.2.1}/waldiez/py.typed +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: waldiez
|
|
3
|
-
Version: 0.1
|
|
3
|
+
Version: 0.2.1
|
|
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.1; extra == 'jupyter'
|
|
72
|
+
Provides-Extra: studio
|
|
73
|
+
Requires-Dist: waldiez-studio==0.2.1; 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,10 +1,10 @@
|
|
|
1
1
|
# Waldiez
|
|
2
2
|
|
|
3
|
-
 [](https://coveralls.io/github/waldiez/python) [](https://badge.fury.io/py/waldiez)
|
|
4
4
|
|
|
5
5
|
Translate a Waldiez flow:
|
|
6
6
|
|
|
7
|
-

|
|
8
8
|
|
|
9
9
|
To a python script or a jupyter notebook with the corresponding [ag2](https://github.com/ag2ai/ag2/) agents and chats.
|
|
10
10
|
|
|
@@ -25,11 +25,30 @@ python -m pip install waldiez
|
|
|
25
25
|
From the repository:
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
|
-
python -m pip install git+https://github.com/waldiez/
|
|
28
|
+
python -m pip install git+https://github.com/waldiez/python.git
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
## Usage
|
|
32
32
|
|
|
33
|
+
### UI Options
|
|
34
|
+
|
|
35
|
+
- For creating-only (no exporting or running) waldiez flows, you can use the playground at <https://waldiez.github.io>.
|
|
36
|
+
The repo for the js library is [here](https://github.com/waldiez/react).
|
|
37
|
+
- There is also a jupyterlab extension [here](https://github.com/waldiez/jupyter)
|
|
38
|
+
- You also can use the vscode extension:
|
|
39
|
+
- [repo](https://github.com/waldiez/vscode)
|
|
40
|
+
- [marketplace](https://marketplace.visualstudio.com/items?itemName=Waldiez.waldiez-vscode)
|
|
41
|
+
- Finally, you can use [waldiez-studio](https://github.com/waldiez/studio)
|
|
42
|
+
|
|
43
|
+
<!--
|
|
44
|
+
The jupyterlab extension and studio also provided as extras in the main package.
|
|
45
|
+
|
|
46
|
+
```shell
|
|
47
|
+
pip install waldiez[studio] # or pip install waldiez_studio
|
|
48
|
+
pip install waldiez[jupyter] # or pip install waldiez_jupyter
|
|
49
|
+
# or both
|
|
50
|
+
pip install waldiez[studio,jupyter]
|
|
51
|
+
``` -->
|
|
33
52
|
### CLI
|
|
34
53
|
|
|
35
54
|
```bash
|
|
@@ -71,13 +90,6 @@ $CONTAINER_COMMAND run \
|
|
|
71
90
|
waldiez/waldiez run --file /flow.waldiez --output /output/output[.py]
|
|
72
91
|
```
|
|
73
92
|
|
|
74
|
-
### UI
|
|
75
|
-
|
|
76
|
-
For creating-only (no exporting or running) waldiez flows, you can use the playground at <https://waldiez.github.io>.
|
|
77
|
-
The repo for the js library is [here](https://github.com/waldiez/react).
|
|
78
|
-
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)).
|
|
79
|
-
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.
|
|
80
|
-
|
|
81
93
|
### As a library
|
|
82
94
|
|
|
83
95
|
#### Export a flow
|
|
@@ -90,7 +102,7 @@ output_path = "/path/to/an/output.py" # or .ipynb
|
|
|
90
102
|
exporter = WaldiezExporter.load(flow_path)
|
|
91
103
|
exporter.export(output_path)
|
|
92
104
|
```
|
|
93
|
-
|
|
105
|
+
|
|
94
106
|
#### Run a flow
|
|
95
107
|
|
|
96
108
|
```python
|
|
@@ -118,11 +130,11 @@ runner.run(output_path=output_path)
|
|
|
118
130
|
```
|
|
119
131
|
|
|
120
132
|
If already installed waldiez you might need to reinstall it after uninstalling `autogen-agentchat`:
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
133
|
+
|
|
134
|
+
```shell
|
|
135
|
+
pip install --force --no-cache waldiez pyautogen
|
|
136
|
+
```
|
|
125
137
|
|
|
126
138
|
## License
|
|
127
139
|
|
|
128
|
-
This project is licensed under the MIT License - see the [LICENSE](https://github.com/waldiez/
|
|
140
|
+
This project is licensed under the MIT License - see the [LICENSE](https://github.com/waldiez/python/blob/main/LICENSE) file for details.
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
name = "waldiez"
|
|
3
3
|
description = 'waldiez'
|
|
4
4
|
authors = [
|
|
5
|
-
{ name = 'Panagiotis Kasnesis', email = 'pkasnesis@
|
|
6
|
-
{ name= 'Lazaros Toumanidis', email= 'laztoum@
|
|
5
|
+
{ name = 'Panagiotis Kasnesis', email = 'pkasnesis@waldiez.io' },
|
|
6
|
+
{ name= 'Lazaros Toumanidis', email= 'laztoum@waldiez.io' },
|
|
7
7
|
{ name = 'Stella Ioannidou', email = 'stella@humancentered.gr'}
|
|
8
8
|
]
|
|
9
9
|
readme = "README.md"
|
|
@@ -22,7 +22,7 @@ classifiers = [
|
|
|
22
22
|
"Intended Audience :: Developers",
|
|
23
23
|
]
|
|
24
24
|
dependencies =[
|
|
25
|
-
"pyautogen==0.
|
|
25
|
+
"pyautogen==0.6.0",
|
|
26
26
|
"jupytext",
|
|
27
27
|
"pydantic>=2.0",
|
|
28
28
|
# together(ag2 extra) 1.2.0 depends on typer<0.13 and >=0.9
|
|
@@ -30,8 +30,8 @@ dependencies =[
|
|
|
30
30
|
]
|
|
31
31
|
|
|
32
32
|
[project.urls]
|
|
33
|
-
homepage = 'https://waldiez.github.io/waldiez/'
|
|
34
|
-
repository = 'https://github.com/waldiez/
|
|
33
|
+
homepage = 'https://waldiez.github.io/waldiez/python'
|
|
34
|
+
repository = 'https://github.com/waldiez/python.git'
|
|
35
35
|
|
|
36
36
|
[tool.hatch.build.targets.sdist]
|
|
37
37
|
packages = ["waldiez", "waldiez.*"]
|
|
@@ -42,18 +42,25 @@ packages = ["waldiez", "waldiez.*"]
|
|
|
42
42
|
exclude = [ "**/example.py" ]
|
|
43
43
|
|
|
44
44
|
[project.optional-dependencies]
|
|
45
|
+
studio = [
|
|
46
|
+
"waldiez_studio==0.2.1",
|
|
47
|
+
]
|
|
48
|
+
jupyter = [
|
|
49
|
+
"waldiez_jupyter==0.2.1",
|
|
50
|
+
"jupyterlab>=4.3.0",
|
|
51
|
+
]
|
|
45
52
|
dev = [
|
|
46
53
|
'autoflake==2.3.1',
|
|
47
54
|
'bandit==1.8.0',
|
|
48
55
|
'black[jupyter]==24.10.0',
|
|
49
56
|
'flake8==7.1.1',
|
|
50
57
|
'isort==5.13.2',
|
|
51
|
-
'mypy==1.
|
|
58
|
+
'mypy==1.14.0',
|
|
52
59
|
'pre-commit==4.0.1',
|
|
53
60
|
'pydocstyle==6.3.0',
|
|
54
|
-
'pylint==3.3.
|
|
61
|
+
'pylint==3.3.3',
|
|
55
62
|
'python-dotenv==1.0.1',
|
|
56
|
-
'ruff==0.8.
|
|
63
|
+
'ruff==0.8.4',
|
|
57
64
|
'types-PyYAML==6.0.12.20240917',
|
|
58
65
|
'yamllint==1.35.1',
|
|
59
66
|
'toml; python_version <= "3.10"',
|
|
@@ -79,25 +86,28 @@ dev = [
|
|
|
79
86
|
#
|
|
80
87
|
# https://github.com/ag2ai/ag2/blob/main/setup.py#L33
|
|
81
88
|
#
|
|
89
|
+
# captainagent(ag2 extra) depends on pysqlite3-binary,
|
|
90
|
+
# but the wheels are only for linux (not checked every py version)
|
|
91
|
+
# on windows with py 3.12, it seems to not work.
|
|
82
92
|
ag2_extras =[
|
|
83
93
|
'pgvector>=0.3.6',
|
|
84
94
|
'psycopg[binary]>=3.2.3',
|
|
85
|
-
'pyautogen[anthropic]==0.
|
|
86
|
-
'pyautogen[bedrock]==0.
|
|
87
|
-
'
|
|
88
|
-
'pyautogen[gemini]==0.
|
|
89
|
-
'pyautogen[groq]==0.
|
|
90
|
-
'pyautogen[lmm]==0.
|
|
91
|
-
'pyautogen[mistral]==0.
|
|
92
|
-
'pyautogen[neo4j]==0.
|
|
93
|
-
'pyautogen[retrievechat-mongodb]==0.
|
|
94
|
-
'pyautogen[retrievechat-pgvector]==0.
|
|
95
|
-
'pyautogen[retrievechat-qdrant]==0.
|
|
95
|
+
'pyautogen[anthropic]==0.6.0',
|
|
96
|
+
'pyautogen[bedrock]==0.6.0',
|
|
97
|
+
'autogen[captainagent]==0.6.0; platform_system == "Linux"',
|
|
98
|
+
'pyautogen[gemini]==0.6.0',
|
|
99
|
+
'pyautogen[groq]==0.6.0',
|
|
100
|
+
'pyautogen[lmm]==0.6.0',
|
|
101
|
+
'pyautogen[mistral]==0.6.0',
|
|
102
|
+
'pyautogen[neo4j]==0.6.0',
|
|
103
|
+
'pyautogen[retrievechat-mongodb]==0.6.0',
|
|
104
|
+
'pyautogen[retrievechat-pgvector]==0.6.0',
|
|
105
|
+
'pyautogen[retrievechat-qdrant]==0.6.0; python_version < "3.13"',
|
|
96
106
|
'qdrant-client[fastembed]; python_version >= "3.13"',
|
|
97
|
-
'pyautogen[retrievechat]==0.
|
|
98
|
-
'pyautogen[together]==0.
|
|
99
|
-
'pyautogen[together]==0.
|
|
100
|
-
'pyautogen[websurfer]==0.
|
|
107
|
+
'pyautogen[retrievechat]==0.6.0',
|
|
108
|
+
'pyautogen[together]==0.6.0',
|
|
109
|
+
'pyautogen[together]==0.6.0',
|
|
110
|
+
'pyautogen[websurfer]==0.6.0',
|
|
101
111
|
'pymongo==4.10.1',
|
|
102
112
|
]
|
|
103
113
|
test = [
|
|
@@ -147,6 +157,7 @@ exclude = '''
|
|
|
147
157
|
| __init__.py
|
|
148
158
|
| .local
|
|
149
159
|
| examples
|
|
160
|
+
| waldiez_out
|
|
150
161
|
)/
|
|
151
162
|
'''
|
|
152
163
|
|
|
@@ -177,6 +188,7 @@ exclude = [
|
|
|
177
188
|
'.venv',
|
|
178
189
|
'.local',
|
|
179
190
|
'examples',
|
|
191
|
+
'waldiez_out',
|
|
180
192
|
]
|
|
181
193
|
|
|
182
194
|
[tool.pydantic-mypy]
|
|
@@ -191,6 +203,7 @@ skip=[
|
|
|
191
203
|
'.venv',
|
|
192
204
|
'.local',
|
|
193
205
|
'examples',
|
|
206
|
+
'waldiez_out',
|
|
194
207
|
]
|
|
195
208
|
include_trailing_comma=true
|
|
196
209
|
force_grid_wrap=0
|
|
@@ -199,7 +212,7 @@ line_length=80
|
|
|
199
212
|
|
|
200
213
|
# pydocstyle
|
|
201
214
|
[tool.pydocstyle]
|
|
202
|
-
match-dir='([^!(.venv)].*)([^!(.local)].*)([^!(examples)].*)'
|
|
215
|
+
match-dir='([^!(.venv)].*)([^!(.local)].*)([^!(examples)].*)([^!(waldiez_out)].*)'
|
|
203
216
|
|
|
204
217
|
# pylint
|
|
205
218
|
[tool.pylint.master]
|
|
@@ -219,6 +232,7 @@ ignore-paths = [
|
|
|
219
232
|
".venv",
|
|
220
233
|
".local*",
|
|
221
234
|
"examples",
|
|
235
|
+
"waldiez_out",
|
|
222
236
|
]
|
|
223
237
|
|
|
224
238
|
unsafe-load-any-extension="no"
|
|
@@ -234,9 +248,10 @@ min-similarity-lines=10
|
|
|
234
248
|
[tool.pylint.broad_try_clause]
|
|
235
249
|
max-try-statements=3
|
|
236
250
|
[tool.pylint.design]
|
|
237
|
-
max-args=
|
|
238
|
-
max-attributes=
|
|
239
|
-
max-positional-arguments=
|
|
251
|
+
max-args=11
|
|
252
|
+
max-attributes=11
|
|
253
|
+
max-positional-arguments=11
|
|
254
|
+
max-statements=50
|
|
240
255
|
[tool.pylint.string]
|
|
241
256
|
check-quote-consistency = true
|
|
242
257
|
check-str-concat-over-line-jumps = true
|
|
@@ -253,7 +268,8 @@ default-docstring-type = "numpy"
|
|
|
253
268
|
exclude_dirs = [
|
|
254
269
|
".venv",
|
|
255
270
|
".local",
|
|
256
|
-
"examples"
|
|
271
|
+
"examples",
|
|
272
|
+
"waldiez_out",
|
|
257
273
|
]
|
|
258
274
|
# B104: bind to all interfaces (0.0.0.0)
|
|
259
275
|
# B110: allow pass on try/except
|
|
@@ -263,7 +279,6 @@ skips = ['B104', 'B110', 'B404', 'B602', 'B603' ]
|
|
|
263
279
|
[tool.bandit.assert_used]
|
|
264
280
|
skips = ['*_test.py', '*/test_*.py']
|
|
265
281
|
|
|
266
|
-
|
|
267
282
|
# ruff
|
|
268
283
|
[tool.ruff]
|
|
269
284
|
line-length = 80
|
|
@@ -271,6 +286,7 @@ extend-exclude = [
|
|
|
271
286
|
".venv",
|
|
272
287
|
".local",
|
|
273
288
|
"examples",
|
|
289
|
+
"waldiez_out",
|
|
274
290
|
]
|
|
275
291
|
|
|
276
292
|
[tool.ruff.lint]
|
|
@@ -299,12 +315,6 @@ filterwarnings = [
|
|
|
299
315
|
# DeprecationWarning:
|
|
300
316
|
# Type google._upb._message.MessageMapContainer uses PyType_Spec with a metaclass that has custom tp_new.
|
|
301
317
|
# This is deprecated and will no longer be allowed in Python 3.14.
|
|
302
|
-
#
|
|
303
|
-
# autogen/logger/logger_utils.py:9: DeprecationWarning:
|
|
304
|
-
# datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version
|
|
305
|
-
#
|
|
306
|
-
# DeprecationWarning:
|
|
307
|
-
# reactor.stop cannot be used inside unit tests
|
|
308
318
|
"ignore::DeprecationWarning",
|
|
309
319
|
]
|
|
310
320
|
python_files = [
|
|
@@ -9,7 +9,9 @@ from .exporter import WaldiezExporter
|
|
|
9
9
|
from .models import Waldiez
|
|
10
10
|
from .runner import WaldiezRunner
|
|
11
11
|
|
|
12
|
-
warnings.filterwarnings(
|
|
12
|
+
warnings.filterwarnings(
|
|
13
|
+
"ignore", module="flaml", message="^.*flaml.automl is not available.*$"
|
|
14
|
+
)
|
|
13
15
|
|
|
14
16
|
|
|
15
17
|
# pylint: disable=too-few-public-methods
|
|
@@ -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()
|
|
@@ -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
|
|
@@ -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
|
|
@@ -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
|
|
@@ -155,7 +155,8 @@ class WaldiezRunner:
|
|
|
155
155
|
req for req in self.waldiez.requirements if req not in sys.modules
|
|
156
156
|
)
|
|
157
157
|
if extra_requirements:
|
|
158
|
-
|
|
158
|
+
requirements_string = ", ".join(extra_requirements)
|
|
159
|
+
printer(f"Installing requirements: {requirements_string}")
|
|
159
160
|
pip_install = [sys.executable, "-m", "pip", "install"]
|
|
160
161
|
if not in_virtualenv():
|
|
161
162
|
pip_install.append("--user")
|
|
@@ -345,13 +346,15 @@ def refresh_environment() -> None:
|
|
|
345
346
|
]
|
|
346
347
|
for mod in modules_to_reload:
|
|
347
348
|
del sys.modules[mod]
|
|
349
|
+
warnings.filterwarnings(
|
|
350
|
+
"ignore", module="flaml", message="^.*flaml.automl is not available.*$"
|
|
351
|
+
)
|
|
348
352
|
import autogen
|
|
349
353
|
from autogen.io import IOStream
|
|
350
354
|
|
|
351
355
|
importlib.reload(autogen)
|
|
352
356
|
# restore the default IOStream
|
|
353
357
|
IOStream.set_global_default(default_io_stream)
|
|
354
|
-
warnings.filterwarnings("ignore", "flaml.automl is not available")
|
|
355
358
|
|
|
356
359
|
|
|
357
360
|
def get_printer() -> Callable[..., None]:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|