waldiez 0.3.9__tar.gz → 0.3.11__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.3.9 → waldiez-0.3.11}/PKG-INFO +29 -29
- {waldiez-0.3.9 → waldiez-0.3.11}/pyproject.toml +29 -31
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/_version.py +1 -1
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporter.py +6 -69
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/base/utils/naming.py +7 -3
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/chats/chats_exporter.py +3 -3
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/chats/utils/sequential.py +1 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/chats/utils/single_chat.py +3 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/flow/flow_exporter.py +12 -1
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/flow/utils/def_main.py +13 -5
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/flow/utils/flow_content.py +11 -10
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/flow/utils/flow_names.py +1 -1
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/flow/utils/importing_utils.py +4 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/models/models_exporter.py +7 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/models/utils.py +4 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/agents.py +2 -2
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/common/base.py +4 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/common/method_utils.py +4 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/flow/flow.py +88 -10
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/flow/flow_data.py +18 -2
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/model/model.py +3 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/waldiez.py +10 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/runner.py +10 -5
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/utils/cli_extras/jupyter.py +0 -1
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/utils/cli_extras/studio.py +1 -1
- {waldiez-0.3.9 → waldiez-0.3.11}/.gitignore +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/LICENSE +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/NOTICE.md +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/README.md +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/__init__.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/__main__.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/cli.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/__init__.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/agent/__init__.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/agent/agent_exporter.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/agent/utils/__init__.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/agent/utils/agent_class_name.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/agent/utils/agent_imports.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/agent/utils/code_execution.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/agent/utils/group_manager.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/agent/utils/rag_user/__init__.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/agent/utils/rag_user/chroma_utils.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/agent/utils/rag_user/mongo_utils.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/agent/utils/rag_user/pgvector_utils.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/agent/utils/rag_user/qdrant_utils.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/agent/utils/rag_user/rag_user.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/agent/utils/rag_user/vector_db.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/agent/utils/reasoning.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/agent/utils/swarm_agent.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/agent/utils/teachability.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/agent/utils/termination_message.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/base/__init__.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/base/agent_position.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/base/base_exporter.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/base/export_position.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/base/import_position.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/base/mixin.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/base/utils/__init__.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/base/utils/comments.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/base/utils/path_check.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/base/utils/to_string.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/chats/__init__.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/chats/utils/__init__.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/chats/utils/common.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/chats/utils/nested.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/chats/utils/swarm.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/flow/__init__.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/flow/utils/__init__.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/flow/utils/agent_utils.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/flow/utils/chat_utils.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/flow/utils/logging_utils.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/models/__init__.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/skills/__init__.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/skills/skills_exporter.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/exporting/skills/utils.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/__init__.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/__init__.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/agent/__init__.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/agent/agent.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/agent/agent_data.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/agent/code_execution.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/agent/linked_skill.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/agent/nested_chat.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/agent/teachability.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/agent/termination_message.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/assistant/__init__.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/assistant/assistant.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/assistant/assistant_data.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/group_manager/__init__.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/group_manager/group_manager.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/group_manager/group_manager_data.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/group_manager/speakers.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/rag_user/__init__.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/rag_user/rag_user.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/rag_user/rag_user_data.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/rag_user/retrieve_config.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/rag_user/vector_db_config.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/reasoning/__init__.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/reasoning/reasoning_agent.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/reasoning/reasoning_agent_data.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/reasoning/reasoning_agent_reason_config.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/swarm_agent/__init__.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/swarm_agent/after_work.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/swarm_agent/on_condition.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/swarm_agent/on_condition_available.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/swarm_agent/on_condition_target.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/swarm_agent/swarm_agent.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/swarm_agent/swarm_agent_data.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/swarm_agent/update_system_message.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/user_proxy/__init__.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/user_proxy/user_proxy.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/agents/user_proxy/user_proxy_data.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/chat/__init__.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/chat/chat.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/chat/chat_data.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/chat/chat_message.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/chat/chat_nested.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/chat/chat_summary.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/common/__init__.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/common/date_utils.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/common/dict_utils.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/flow/__init__.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/flow/utils.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/model/__init__.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/model/model_data.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/skill/__init__.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/skill/skill.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/models/skill/skill_data.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/py.typed +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/running/__init__.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/running/environment.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/running/gen_seq_diagram.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/running/running.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/utils/__init__.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/utils/cli_extras/__init__.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/utils/conflict_checker.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/utils/flaml_warnings.py +0 -0
- {waldiez-0.3.9 → waldiez-0.3.11}/waldiez/utils/pysqlite3_checker.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: waldiez
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.11
|
|
4
4
|
Summary: waldiez
|
|
5
5
|
Project-URL: homepage, https://waldiez.github.io/waldiez/python
|
|
6
6
|
Project-URL: repository, https://github.com/waldiez/python.git
|
|
@@ -23,48 +23,48 @@ Requires-Dist: aiofiles==24.1.0
|
|
|
23
23
|
Requires-Dist: aiosqlite==0.20.0
|
|
24
24
|
Requires-Dist: asyncer==0.0.8
|
|
25
25
|
Requires-Dist: graphviz==0.20.3
|
|
26
|
-
Requires-Dist: httpx<
|
|
26
|
+
Requires-Dist: httpx<1
|
|
27
27
|
Requires-Dist: jupytext
|
|
28
28
|
Requires-Dist: pandas>=2
|
|
29
29
|
Requires-Dist: parso==0.8.4
|
|
30
|
-
Requires-Dist: pyautogen==0.7.
|
|
30
|
+
Requires-Dist: pyautogen==0.7.3
|
|
31
31
|
Requires-Dist: pydantic<3,>=2.6.1
|
|
32
|
-
Requires-Dist: typer<0.
|
|
32
|
+
Requires-Dist: typer<0.16,>=0.9
|
|
33
33
|
Provides-Extra: ag2-extras
|
|
34
|
-
Requires-Dist: autogen[captainagent]==0.7.
|
|
34
|
+
Requires-Dist: autogen[captainagent]==0.7.3; (platform_system == 'Linux') and extra == 'ag2-extras'
|
|
35
35
|
Requires-Dist: chromadb; (platform_system != 'Linux') and extra == 'ag2-extras'
|
|
36
|
-
Requires-Dist: huggingface-hub
|
|
36
|
+
Requires-Dist: huggingface-hub; (platform_system != 'Linux') and extra == 'ag2-extras'
|
|
37
37
|
Requires-Dist: pgvector>=0.3.6; extra == 'ag2-extras'
|
|
38
38
|
Requires-Dist: psycopg[binary]>=3.2.3; extra == 'ag2-extras'
|
|
39
|
-
Requires-Dist: pyautogen[anthropic]==0.7.
|
|
40
|
-
Requires-Dist: pyautogen[bedrock]==0.7.
|
|
41
|
-
Requires-Dist: pyautogen[gemini]==0.7.
|
|
42
|
-
Requires-Dist: pyautogen[groq]==0.7.
|
|
43
|
-
Requires-Dist: pyautogen[lmm]==0.7.
|
|
44
|
-
Requires-Dist: pyautogen[mistral]==0.7.
|
|
45
|
-
Requires-Dist: pyautogen[neo4j]==0.7.
|
|
46
|
-
Requires-Dist: pyautogen[retrievechat-mongodb]==0.7.
|
|
47
|
-
Requires-Dist: pyautogen[retrievechat-pgvector]==0.7.
|
|
48
|
-
Requires-Dist: pyautogen[retrievechat-qdrant]==0.7.
|
|
49
|
-
Requires-Dist: pyautogen[retrievechat]==0.7.
|
|
50
|
-
Requires-Dist: pyautogen[together]==0.7.
|
|
51
|
-
Requires-Dist: pyautogen[websurfer]==0.7.
|
|
52
|
-
Requires-Dist: pymongo
|
|
39
|
+
Requires-Dist: pyautogen[anthropic]==0.7.3; extra == 'ag2-extras'
|
|
40
|
+
Requires-Dist: pyautogen[bedrock]==0.7.3; extra == 'ag2-extras'
|
|
41
|
+
Requires-Dist: pyautogen[gemini]==0.7.3; extra == 'ag2-extras'
|
|
42
|
+
Requires-Dist: pyautogen[groq]==0.7.3; extra == 'ag2-extras'
|
|
43
|
+
Requires-Dist: pyautogen[lmm]==0.7.3; extra == 'ag2-extras'
|
|
44
|
+
Requires-Dist: pyautogen[mistral]==0.7.3; extra == 'ag2-extras'
|
|
45
|
+
Requires-Dist: pyautogen[neo4j]==0.7.3; extra == 'ag2-extras'
|
|
46
|
+
Requires-Dist: pyautogen[retrievechat-mongodb]==0.7.3; extra == 'ag2-extras'
|
|
47
|
+
Requires-Dist: pyautogen[retrievechat-pgvector]==0.7.3; extra == 'ag2-extras'
|
|
48
|
+
Requires-Dist: pyautogen[retrievechat-qdrant]==0.7.3; (python_version < '3.13') and extra == 'ag2-extras'
|
|
49
|
+
Requires-Dist: pyautogen[retrievechat]==0.7.3; extra == 'ag2-extras'
|
|
50
|
+
Requires-Dist: pyautogen[together]==0.7.3; extra == 'ag2-extras'
|
|
51
|
+
Requires-Dist: pyautogen[websurfer]==0.7.3; extra == 'ag2-extras'
|
|
52
|
+
Requires-Dist: pymongo>=4.10.1; extra == 'ag2-extras'
|
|
53
53
|
Requires-Dist: qdrant-client[fastembed]; (python_version >= '3.13') and extra == 'ag2-extras'
|
|
54
|
-
Requires-Dist: sentence-transformers
|
|
54
|
+
Requires-Dist: sentence-transformers; (platform_system != 'Linux') and extra == 'ag2-extras'
|
|
55
55
|
Provides-Extra: dev
|
|
56
56
|
Requires-Dist: autoflake==2.3.1; extra == 'dev'
|
|
57
57
|
Requires-Dist: bandit==1.8.2; extra == 'dev'
|
|
58
|
-
Requires-Dist: black[jupyter]==
|
|
58
|
+
Requires-Dist: black[jupyter]==25.1.0; extra == 'dev'
|
|
59
59
|
Requires-Dist: flake8==7.1.1; extra == 'dev'
|
|
60
|
-
Requires-Dist: isort==
|
|
60
|
+
Requires-Dist: isort==6.0.0; extra == 'dev'
|
|
61
61
|
Requires-Dist: mypy==1.14.1; extra == 'dev'
|
|
62
62
|
Requires-Dist: pandas-stubs; extra == 'dev'
|
|
63
63
|
Requires-Dist: pre-commit==4.1.0; extra == 'dev'
|
|
64
64
|
Requires-Dist: pydocstyle==6.3.0; extra == 'dev'
|
|
65
|
-
Requires-Dist: pylint==3.3.
|
|
65
|
+
Requires-Dist: pylint==3.3.4; extra == 'dev'
|
|
66
66
|
Requires-Dist: python-dotenv==1.0.1; extra == 'dev'
|
|
67
|
-
Requires-Dist: ruff==0.9.
|
|
67
|
+
Requires-Dist: ruff==0.9.4; extra == 'dev'
|
|
68
68
|
Requires-Dist: toml; (python_version <= '3.10') and extra == 'dev'
|
|
69
69
|
Requires-Dist: types-pyyaml==6.0.12.20241230; extra == 'dev'
|
|
70
70
|
Requires-Dist: types-toml==0.10.8.20240310; extra == 'dev'
|
|
@@ -74,18 +74,18 @@ Requires-Dist: mdx-include==1.4.2; extra == 'docs'
|
|
|
74
74
|
Requires-Dist: mdx-truly-sane-lists==1.3; extra == 'docs'
|
|
75
75
|
Requires-Dist: mkdocs-jupyter==0.25.1; extra == 'docs'
|
|
76
76
|
Requires-Dist: mkdocs-macros-plugin==1.3.7; extra == 'docs'
|
|
77
|
-
Requires-Dist: mkdocs-material==9.
|
|
77
|
+
Requires-Dist: mkdocs-material==9.6.1; extra == 'docs'
|
|
78
78
|
Requires-Dist: mkdocs-minify-html-plugin==0.2.3; extra == 'docs'
|
|
79
79
|
Requires-Dist: mkdocs==1.6.1; extra == 'docs'
|
|
80
80
|
Requires-Dist: mkdocstrings-python==1.13.0; extra == 'docs'
|
|
81
81
|
Requires-Dist: mkdocstrings[crystal,python]==0.27.0; extra == 'docs'
|
|
82
82
|
Provides-Extra: jupyter
|
|
83
83
|
Requires-Dist: jupyterlab>=4.3.0; extra == 'jupyter'
|
|
84
|
-
Requires-Dist: waldiez-jupyter==0.3.
|
|
84
|
+
Requires-Dist: waldiez-jupyter==0.3.11; extra == 'jupyter'
|
|
85
85
|
Provides-Extra: studio
|
|
86
|
-
Requires-Dist: waldiez-studio==0.3.
|
|
86
|
+
Requires-Dist: waldiez-studio==0.3.11; extra == 'studio'
|
|
87
87
|
Provides-Extra: test
|
|
88
|
-
Requires-Dist: pytest-asyncio==0.25.
|
|
88
|
+
Requires-Dist: pytest-asyncio==0.25.3; extra == 'test'
|
|
89
89
|
Requires-Dist: pytest-cov==6.0.0; extra == 'test'
|
|
90
90
|
Requires-Dist: pytest-html==4.1.1; extra == 'test'
|
|
91
91
|
Requires-Dist: pytest-sugar==1.0.0; extra == 'test'
|
|
@@ -28,15 +28,13 @@ dependencies =[
|
|
|
28
28
|
"asyncer==0.0.8",
|
|
29
29
|
"graphviz==0.20.3",
|
|
30
30
|
"pandas>=2",
|
|
31
|
-
"pyautogen==0.7.
|
|
31
|
+
"pyautogen==0.7.3",
|
|
32
32
|
"jupytext",
|
|
33
33
|
"parso==0.8.4",
|
|
34
34
|
"pydantic>=2.6.1,<3",
|
|
35
35
|
# together(ag2 extra) 1.2.0 depends on typer<0.13 and >=0.9
|
|
36
|
-
"typer>=0.9,<0.
|
|
37
|
-
|
|
38
|
-
# TypeError: Client.__init__() got an unexpected keyword argument 'proxies'
|
|
39
|
-
"httpx<0.28.0,>=0.27.0",
|
|
36
|
+
"typer>=0.9,<0.16",
|
|
37
|
+
"httpx<1",
|
|
40
38
|
]
|
|
41
39
|
|
|
42
40
|
[project.urls]
|
|
@@ -53,25 +51,25 @@ exclude = [ "**/example.py" ]
|
|
|
53
51
|
|
|
54
52
|
[project.optional-dependencies]
|
|
55
53
|
studio = [
|
|
56
|
-
"waldiez_studio==0.3.
|
|
54
|
+
"waldiez_studio==0.3.11",
|
|
57
55
|
]
|
|
58
56
|
jupyter = [
|
|
59
|
-
"waldiez_jupyter==0.3.
|
|
57
|
+
"waldiez_jupyter==0.3.11",
|
|
60
58
|
"jupyterlab>=4.3.0",
|
|
61
59
|
]
|
|
62
60
|
dev = [
|
|
63
61
|
'autoflake==2.3.1',
|
|
64
62
|
'bandit==1.8.2',
|
|
65
|
-
'black[jupyter]==
|
|
63
|
+
'black[jupyter]==25.1.0',
|
|
66
64
|
'flake8==7.1.1',
|
|
67
|
-
'isort==
|
|
65
|
+
'isort==6.0.0',
|
|
68
66
|
'mypy==1.14.1',
|
|
69
67
|
"pandas-stubs",
|
|
70
68
|
'pre-commit==4.1.0',
|
|
71
69
|
'pydocstyle==6.3.0',
|
|
72
|
-
'pylint==3.3.
|
|
70
|
+
'pylint==3.3.4',
|
|
73
71
|
'python-dotenv==1.0.1',
|
|
74
|
-
'ruff==0.9.
|
|
72
|
+
'ruff==0.9.4',
|
|
75
73
|
'types-PyYAML==6.0.12.20241230',
|
|
76
74
|
'yamllint==1.35.1',
|
|
77
75
|
'toml; python_version <= "3.10"',
|
|
@@ -103,30 +101,30 @@ dev = [
|
|
|
103
101
|
ag2_extras =[
|
|
104
102
|
'pgvector>=0.3.6',
|
|
105
103
|
'psycopg[binary]>=3.2.3',
|
|
106
|
-
'pyautogen[anthropic]==0.7.
|
|
107
|
-
'pyautogen[bedrock]==0.7.
|
|
108
|
-
'autogen[captainagent]==0.7.
|
|
104
|
+
'pyautogen[anthropic]==0.7.3',
|
|
105
|
+
'pyautogen[bedrock]==0.7.3',
|
|
106
|
+
'autogen[captainagent]==0.7.3; platform_system == "Linux"',
|
|
109
107
|
'chromadb; platform_system != "Linux"',
|
|
110
|
-
'sentence-transformers
|
|
111
|
-
'huggingface-hub
|
|
112
|
-
'pyautogen[gemini]==0.7.
|
|
113
|
-
'pyautogen[groq]==0.7.
|
|
114
|
-
'pyautogen[lmm]==0.7.
|
|
115
|
-
'pyautogen[mistral]==0.7.
|
|
116
|
-
'pyautogen[neo4j]==0.7.
|
|
117
|
-
'pyautogen[retrievechat-mongodb]==0.7.
|
|
118
|
-
'pyautogen[retrievechat-pgvector]==0.7.
|
|
119
|
-
'pyautogen[retrievechat-qdrant]==0.7.
|
|
108
|
+
'sentence-transformers; platform_system != "Linux"',
|
|
109
|
+
'huggingface-hub; platform_system != "Linux"',
|
|
110
|
+
'pyautogen[gemini]==0.7.3',
|
|
111
|
+
'pyautogen[groq]==0.7.3',
|
|
112
|
+
'pyautogen[lmm]==0.7.3',
|
|
113
|
+
'pyautogen[mistral]==0.7.3',
|
|
114
|
+
'pyautogen[neo4j]==0.7.3',
|
|
115
|
+
'pyautogen[retrievechat-mongodb]==0.7.3',
|
|
116
|
+
'pyautogen[retrievechat-pgvector]==0.7.3',
|
|
117
|
+
'pyautogen[retrievechat-qdrant]==0.7.3; python_version < "3.13"',
|
|
120
118
|
'qdrant-client[fastembed]; python_version >= "3.13"',
|
|
121
|
-
'pyautogen[retrievechat]==0.7.
|
|
122
|
-
'pyautogen[together]==0.7.
|
|
123
|
-
'pyautogen[together]==0.7.
|
|
124
|
-
'pyautogen[websurfer]==0.7.
|
|
125
|
-
'pymongo
|
|
119
|
+
'pyautogen[retrievechat]==0.7.3',
|
|
120
|
+
'pyautogen[together]==0.7.3',
|
|
121
|
+
'pyautogen[together]==0.7.3',
|
|
122
|
+
'pyautogen[websurfer]==0.7.3',
|
|
123
|
+
'pymongo>=4.10.1',
|
|
126
124
|
]
|
|
127
125
|
test = [
|
|
128
126
|
'pytest==8.3.4',
|
|
129
|
-
'pytest-asyncio==0.25.
|
|
127
|
+
'pytest-asyncio==0.25.3',
|
|
130
128
|
'pytest-cov==6.0.0',
|
|
131
129
|
'pytest-html==4.1.1',
|
|
132
130
|
'pytest-sugar==1.0.0',
|
|
@@ -139,7 +137,7 @@ docs = [
|
|
|
139
137
|
'mkdocs==1.6.1',
|
|
140
138
|
'mkdocs-jupyter==0.25.1',
|
|
141
139
|
'mkdocs-macros-plugin==1.3.7',
|
|
142
|
-
'mkdocs-material==9.
|
|
140
|
+
'mkdocs-material==9.6.1',
|
|
143
141
|
'mkdocs-minify-html-plugin==0.2.3',
|
|
144
142
|
'mkdocstrings[crystal,python]==0.27.0',
|
|
145
143
|
'mkdocstrings-python==1.13.0'
|
|
@@ -6,21 +6,12 @@ to an autogen's flow with one or more chats.
|
|
|
6
6
|
|
|
7
7
|
The resulting file(s): a `flow.py` file with one `main()` function
|
|
8
8
|
to trigger the chat(s).
|
|
9
|
-
If additional tools/skills are used,
|
|
10
|
-
they are exported as their `skill_name` in the same directory with
|
|
11
|
-
the `flow.py` file. So the `flow.py` could have entries like:
|
|
12
|
-
`form {flow_name}_{skill1_name} import {skill1_name}`
|
|
13
|
-
`form {flow_name}_{skill2_name} import {skill2_name}`
|
|
14
9
|
"""
|
|
15
10
|
|
|
16
|
-
# pylint: disable=inconsistent-quotes
|
|
17
|
-
|
|
18
|
-
import os
|
|
19
|
-
import shutil
|
|
20
|
-
import subprocess
|
|
21
|
-
import sys
|
|
22
11
|
from pathlib import Path
|
|
23
|
-
from typing import
|
|
12
|
+
from typing import Union
|
|
13
|
+
|
|
14
|
+
import jupytext # type: ignore[import-untyped]
|
|
24
15
|
|
|
25
16
|
from .exporting import FlowExporter
|
|
26
17
|
from .models import Waldiez
|
|
@@ -125,25 +116,10 @@ class WaldiezExporter:
|
|
|
125
116
|
py_path = path.with_suffix(".tmp.py")
|
|
126
117
|
with open(py_path, "w", encoding="utf-8", newline="\n") as f:
|
|
127
118
|
f.write(content)
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
[sys.executable, "-m", "pip", "install", "jupytext"],
|
|
131
|
-
allow_error=False,
|
|
132
|
-
)
|
|
133
|
-
run_command(
|
|
134
|
-
[
|
|
135
|
-
sys.executable,
|
|
136
|
-
"-m",
|
|
137
|
-
"jupytext",
|
|
138
|
-
"--to",
|
|
139
|
-
"notebook",
|
|
140
|
-
str(py_path),
|
|
141
|
-
],
|
|
142
|
-
allow_error=False,
|
|
143
|
-
)
|
|
119
|
+
with open(py_path, "r", encoding="utf-8") as py_out:
|
|
120
|
+
content = jupytext.read(py_out, fmt="py:light")
|
|
144
121
|
ipynb_path = str(py_path).replace(".tmp.py", ".tmp.ipynb")
|
|
145
|
-
|
|
146
|
-
raise RuntimeError("Could not generate notebook")
|
|
122
|
+
jupytext.write(content, ipynb_path, fmt="ipynb")
|
|
147
123
|
Path(ipynb_path).rename(ipynb_path.replace(".tmp.ipynb", ".ipynb"))
|
|
148
124
|
py_path.unlink(missing_ok=True)
|
|
149
125
|
|
|
@@ -182,42 +158,3 @@ class WaldiezExporter:
|
|
|
182
158
|
"""
|
|
183
159
|
with open(file_path, "w", encoding="utf-8", newline="\n") as file:
|
|
184
160
|
file.write(self.waldiez.model_dump_json())
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
def run_command(
|
|
188
|
-
cmd: List[str],
|
|
189
|
-
cwd: Optional[Path] = None,
|
|
190
|
-
allow_error: bool = True,
|
|
191
|
-
) -> None:
|
|
192
|
-
"""Run a command.
|
|
193
|
-
|
|
194
|
-
Parameters
|
|
195
|
-
----------
|
|
196
|
-
cmd : List[str]
|
|
197
|
-
The command to run.
|
|
198
|
-
cwd : Path, optional
|
|
199
|
-
The working directory, by default None (current working directory).
|
|
200
|
-
allow_error : bool, optional
|
|
201
|
-
Whether to allow errors, by default True.
|
|
202
|
-
|
|
203
|
-
Raises
|
|
204
|
-
------
|
|
205
|
-
RuntimeError
|
|
206
|
-
If the command fails and allow_error is False.
|
|
207
|
-
"""
|
|
208
|
-
if not cwd:
|
|
209
|
-
cwd = Path.cwd()
|
|
210
|
-
# pylint: disable=broad-except
|
|
211
|
-
try:
|
|
212
|
-
subprocess.run(
|
|
213
|
-
cmd,
|
|
214
|
-
check=True,
|
|
215
|
-
cwd=cwd,
|
|
216
|
-
env=os.environ,
|
|
217
|
-
stdout=subprocess.PIPE,
|
|
218
|
-
stderr=subprocess.PIPE,
|
|
219
|
-
) # nosemgrep # nosec
|
|
220
|
-
except BaseException as error: # pragma: no cover
|
|
221
|
-
if allow_error:
|
|
222
|
-
return
|
|
223
|
-
raise RuntimeError(f"Error running command: {error}") from error
|
|
@@ -15,11 +15,13 @@ get_escaped_string
|
|
|
15
15
|
import re
|
|
16
16
|
from typing import Dict, Tuple
|
|
17
17
|
|
|
18
|
+
MAX_VARIABLE_LENGTH = 46
|
|
19
|
+
|
|
18
20
|
|
|
19
21
|
def get_valid_python_variable_name(
|
|
20
22
|
possible: str,
|
|
21
23
|
prefix: str = "w",
|
|
22
|
-
max_length: int =
|
|
24
|
+
max_length: int = MAX_VARIABLE_LENGTH,
|
|
23
25
|
) -> str:
|
|
24
26
|
"""Get a valid Python variable name from a possible name.
|
|
25
27
|
|
|
@@ -78,7 +80,7 @@ def get_valid_instance_name(
|
|
|
78
80
|
instance: Tuple[str, str],
|
|
79
81
|
current_names: Dict[str, str],
|
|
80
82
|
prefix: str = "w",
|
|
81
|
-
max_length: int =
|
|
83
|
+
max_length: int = MAX_VARIABLE_LENGTH,
|
|
82
84
|
) -> Dict[str, str]:
|
|
83
85
|
"""Get a valid instance name.
|
|
84
86
|
|
|
@@ -109,7 +111,9 @@ def get_valid_instance_name(
|
|
|
109
111
|
# already in the current names (it's id)
|
|
110
112
|
return current_names
|
|
111
113
|
new_names = current_names.copy()
|
|
112
|
-
name = get_valid_python_variable_name(
|
|
114
|
+
name = get_valid_python_variable_name(
|
|
115
|
+
possible_name, prefix=prefix, max_length=max_length
|
|
116
|
+
)
|
|
113
117
|
if name in current_names.values():
|
|
114
118
|
name = f"{prefix}_{name}"
|
|
115
119
|
if name in current_names.values():
|
|
@@ -97,7 +97,7 @@ class ChatsExporter(BaseExporter, ExporterMixin):
|
|
|
97
97
|
recipient=recipient,
|
|
98
98
|
serializer=self.serializer,
|
|
99
99
|
string_escape=self.string_escape,
|
|
100
|
-
tabs=
|
|
100
|
+
tabs=1 if self.for_notebook else 2,
|
|
101
101
|
is_async=self.is_async,
|
|
102
102
|
)
|
|
103
103
|
return
|
|
@@ -109,7 +109,7 @@ class ChatsExporter(BaseExporter, ExporterMixin):
|
|
|
109
109
|
chat_names=self.chat_names,
|
|
110
110
|
serializer=self.serializer,
|
|
111
111
|
string_escape=self.string_escape,
|
|
112
|
-
tabs=
|
|
112
|
+
tabs=1 if self.for_notebook else 2,
|
|
113
113
|
is_async=self.is_async,
|
|
114
114
|
)
|
|
115
115
|
return
|
|
@@ -119,7 +119,7 @@ class ChatsExporter(BaseExporter, ExporterMixin):
|
|
|
119
119
|
chat_names=self.chat_names,
|
|
120
120
|
serializer=self.serializer,
|
|
121
121
|
string_escape=self.string_escape,
|
|
122
|
-
tabs=
|
|
122
|
+
tabs=1 if self.for_notebook else 2,
|
|
123
123
|
is_async=self.is_async,
|
|
124
124
|
)
|
|
125
125
|
|
|
@@ -181,6 +181,7 @@ def _get_chat_dict_string(
|
|
|
181
181
|
chat_string = "{"
|
|
182
182
|
chat_string += "\n" + f'{tab} "sender": {agent_names[sender.id]},'
|
|
183
183
|
chat_string += "\n" + f'{tab} "recipient": {agent_names[recipient.id]},'
|
|
184
|
+
chat_string += "\n" + f'{tab} "cache": cache,'
|
|
184
185
|
additional_methods_string = ""
|
|
185
186
|
for key, value in chat_args.items():
|
|
186
187
|
if isinstance(value, str):
|
|
@@ -86,6 +86,7 @@ def export_single_chat(
|
|
|
86
86
|
agent1.initiate_chat(
|
|
87
87
|
agent2,
|
|
88
88
|
message="Hello, how are you?",
|
|
89
|
+
cache=cache,
|
|
89
90
|
)
|
|
90
91
|
```
|
|
91
92
|
"""
|
|
@@ -167,6 +168,7 @@ def get_simple_chat_string(
|
|
|
167
168
|
recipient_name = agent_names[recipient.id]
|
|
168
169
|
chat_string = "\n" + f"{tab}results = {sender_name}.{initiate}(" + "\n"
|
|
169
170
|
chat_string += f"{tab} {recipient_name},"
|
|
171
|
+
chat_string += "\n" + f"{tab} cache=cache,"
|
|
170
172
|
for key, value in chat_args.items():
|
|
171
173
|
if isinstance(value, str):
|
|
172
174
|
chat_string += "\n" + f'{tab} {key}="{value}",'
|
|
@@ -228,6 +230,7 @@ def get_empty_simple_chat_string(
|
|
|
228
230
|
initiate = "a_initiate_chat" if is_async else "initiate_chat"
|
|
229
231
|
content = "\n" + f"{tab}results = {sender_name}.{initiate}(" + "\n"
|
|
230
232
|
content += f"{tab} {recipient_name}," + "\n"
|
|
233
|
+
content += f"{tab} cache=cache," + "\n"
|
|
231
234
|
message_arg, _ = get_chat_message(
|
|
232
235
|
tab=tab,
|
|
233
236
|
chat=chat,
|
|
@@ -202,6 +202,7 @@ class FlowExporter(BaseExporter, ExporterMixin):
|
|
|
202
202
|
The merged export contents.
|
|
203
203
|
"""
|
|
204
204
|
is_async = self.waldiez.is_async
|
|
205
|
+
cache_seed = self.waldiez.cache_seed
|
|
205
206
|
content = (
|
|
206
207
|
get_py_content_start(self.waldiez)
|
|
207
208
|
if not self.for_notebook
|
|
@@ -236,9 +237,18 @@ class FlowExporter(BaseExporter, ExporterMixin):
|
|
|
236
237
|
chats_content,
|
|
237
238
|
after_run=after_run,
|
|
238
239
|
is_async=self.waldiez.is_async,
|
|
240
|
+
cache_seed=cache_seed,
|
|
239
241
|
)
|
|
240
242
|
else:
|
|
241
|
-
content += "
|
|
243
|
+
# content += f" with Cache.disk(cache_seed={cache_seed}" + "):\n"
|
|
244
|
+
# content += f"{flow_chats}" + "\n"
|
|
245
|
+
# content += "\n" + chats_content + "\n"
|
|
246
|
+
if chats_content.startswith("\n"):
|
|
247
|
+
chats_content = chats_content[1:]
|
|
248
|
+
content += (
|
|
249
|
+
"\n" + f"with Cache.disk(cache_seed={cache_seed}):"
|
|
250
|
+
"\n" + chats_content + "\n"
|
|
251
|
+
)
|
|
242
252
|
if is_async:
|
|
243
253
|
content += "await stop_logging()"
|
|
244
254
|
else:
|
|
@@ -332,6 +342,7 @@ class FlowExporter(BaseExporter, ExporterMixin):
|
|
|
332
342
|
model_names=self.model_names,
|
|
333
343
|
for_notebook=self.for_notebook,
|
|
334
344
|
output_dir=self.output_dir,
|
|
345
|
+
cache_seed=self.waldiez.cache_seed,
|
|
335
346
|
)
|
|
336
347
|
return exporter.export()
|
|
337
348
|
|
|
@@ -4,8 +4,12 @@
|
|
|
4
4
|
# pylint: disable=inconsistent-quotes, line-too-long
|
|
5
5
|
"""Get the main function."""
|
|
6
6
|
|
|
7
|
+
from typing import Optional
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
|
|
10
|
+
def get_def_main(
|
|
11
|
+
flow_chats: str, after_run: str, is_async: bool, cache_seed: Optional[int]
|
|
12
|
+
) -> str:
|
|
9
13
|
"""Get the main function.
|
|
10
14
|
|
|
11
15
|
When exporting to python, waldiez_chats string will be the
|
|
@@ -22,17 +26,21 @@ def get_def_main(flow_chats: str, after_run: str, is_async: bool) -> str:
|
|
|
22
26
|
The content after the run of the flow.
|
|
23
27
|
is_async : bool
|
|
24
28
|
Whether the main function is asynchronous.
|
|
29
|
+
cache_seed : Optional[int]
|
|
30
|
+
The seed for the cache. If None, cache should be disabled.
|
|
25
31
|
Returns
|
|
26
32
|
-------
|
|
27
33
|
str
|
|
28
34
|
The main function.
|
|
29
35
|
"""
|
|
36
|
+
if flow_chats.startswith("\n"):
|
|
37
|
+
flow_chats = flow_chats[1:]
|
|
30
38
|
content = ""
|
|
31
39
|
if is_async:
|
|
32
40
|
content += "async "
|
|
33
|
-
content += "def main():\n"
|
|
34
|
-
content += " # type: () -> Union[ChatResult, List[ChatResult], Dict[int, ChatResult]]\n"
|
|
41
|
+
content += "def main() -> Union[ChatResult, List[ChatResult], Dict[int, ChatResult]]:\n"
|
|
35
42
|
content += ' """Start chatting."""\n'
|
|
43
|
+
content += f" with Cache.disk(cache_seed={cache_seed}" + ") as cache:\n"
|
|
36
44
|
content += f"{flow_chats}" + "\n"
|
|
37
45
|
if is_async:
|
|
38
46
|
content += " await stop_logging()"
|
|
@@ -45,7 +53,7 @@ def get_def_main(flow_chats: str, after_run: str, is_async: bool) -> str:
|
|
|
45
53
|
else:
|
|
46
54
|
content += "def call_main() -> None:\n"
|
|
47
55
|
content += ' """Run the main function and print the results."""\n'
|
|
48
|
-
content += " results
|
|
56
|
+
content += " results = "
|
|
49
57
|
if is_async:
|
|
50
58
|
content += "await "
|
|
51
59
|
content += "main()\n"
|
|
@@ -58,7 +66,7 @@ def get_def_main(flow_chats: str, after_run: str, is_async: bool) -> str:
|
|
|
58
66
|
content += " for result in results:\n"
|
|
59
67
|
content += " pprint(asdict(result))\n"
|
|
60
68
|
content += " else:\n"
|
|
61
|
-
content += " pprint(asdict(results))\n"
|
|
69
|
+
content += " pprint(asdict(results))\n\n\n"
|
|
62
70
|
content += 'if __name__ == "__main__":\n'
|
|
63
71
|
if is_async:
|
|
64
72
|
content += " anyio.run(call_main)\n"
|
|
@@ -136,25 +136,26 @@ def get_after_run_content(
|
|
|
136
136
|
# if th eflow has reasoning agents, we add
|
|
137
137
|
# visualize_tree(agent._root) for each agent
|
|
138
138
|
content = ""
|
|
139
|
-
|
|
139
|
+
tab = " "
|
|
140
|
+
space = tab * tabs
|
|
140
141
|
for agent in waldiez.agents:
|
|
141
142
|
if agent.agent_type == "reasoning":
|
|
142
143
|
agent_name = agent_names[agent.id]
|
|
143
144
|
content += f"""
|
|
144
145
|
{space}# pylint: disable=broad-except,too-many-try-statements
|
|
145
146
|
{space}try:
|
|
146
|
-
{space}{
|
|
147
|
-
{space}{
|
|
148
|
-
{space}{
|
|
149
|
-
{space}{
|
|
147
|
+
{space}{tab}visualize_tree({agent_name}._root) # pylint: disable=protected-access
|
|
148
|
+
{space}{tab}if os.path.exists("tree_of_thoughts.png"):
|
|
149
|
+
{space}{tab}{tab}new_name = "{agent_name}_tree_of_thoughts.png"
|
|
150
|
+
{space}{tab}{tab}os.rename("tree_of_thoughts.png", new_name)
|
|
150
151
|
{space}except BaseException:
|
|
151
|
-
{space}{
|
|
152
|
+
{space}{tab}pass
|
|
152
153
|
{space}# save the tree to json
|
|
153
154
|
{space}try:
|
|
154
|
-
{space}{
|
|
155
|
-
{space}{
|
|
156
|
-
{space}{
|
|
155
|
+
{space}{tab}data = {agent_name}._root.to_dict() # pylint: disable=protected-access
|
|
156
|
+
{space}{tab}with open("{agent_name}_reasoning_tree.json", "w", encoding="utf-8") as f:
|
|
157
|
+
{space}{tab}{tab}json.dump(data, f)
|
|
157
158
|
{space}except BaseException:
|
|
158
|
-
{space}{
|
|
159
|
+
{space}{tab}pass
|
|
159
160
|
"""
|
|
160
161
|
return content
|
|
@@ -31,7 +31,7 @@ class ResultType(TypedDict):
|
|
|
31
31
|
def ensure_unique_names(
|
|
32
32
|
waldiez: Waldiez,
|
|
33
33
|
get_valid_instance_name: Callable[..., Dict[str, str]],
|
|
34
|
-
max_length: int =
|
|
34
|
+
max_length: int = 46,
|
|
35
35
|
flow_name_max_length: int = 20,
|
|
36
36
|
) -> ResultType:
|
|
37
37
|
"""Ensure unique names for agents, models, skills, and chats and flow.
|
|
@@ -28,6 +28,7 @@ TYPING_IMPORTS = [
|
|
|
28
28
|
]
|
|
29
29
|
COMMON_AUTOGEN_IMPORTS = [
|
|
30
30
|
"from autogen import Agent",
|
|
31
|
+
"from autogen import Cache",
|
|
31
32
|
"from autogen import ConversableAgent",
|
|
32
33
|
"from autogen import ChatResult",
|
|
33
34
|
"from autogen import GroupChat",
|
|
@@ -128,6 +129,7 @@ def get_the_imports_string(
|
|
|
128
129
|
"\nimport aiofiles"
|
|
129
130
|
"\nimport aiosqlite"
|
|
130
131
|
"\nimport anyio"
|
|
132
|
+
"\nimport nest_asyncio"
|
|
131
133
|
"\nfrom aiocsv import AsyncDictWriter"
|
|
132
134
|
"\nfrom asyncer import asyncify"
|
|
133
135
|
)
|
|
@@ -143,6 +145,8 @@ def get_the_imports_string(
|
|
|
143
145
|
final_string += "\n".join(local_imports) + "\n"
|
|
144
146
|
while not final_string.endswith("\n\n"):
|
|
145
147
|
final_string += "\n"
|
|
148
|
+
if is_async:
|
|
149
|
+
final_string += "\nnest_asyncio.apply()\n"
|
|
146
150
|
return final_string.replace("\n\n\n", "\n\n") # avoid too many newlines
|
|
147
151
|
|
|
148
152
|
|
|
@@ -32,6 +32,7 @@ class ModelsExporter(BaseExporter, ExporterMixin):
|
|
|
32
32
|
models: List[WaldiezModel],
|
|
33
33
|
model_names: Dict[str, str],
|
|
34
34
|
for_notebook: bool,
|
|
35
|
+
cache_seed: Optional[int],
|
|
35
36
|
output_dir: Optional[Union[str, Path]] = None,
|
|
36
37
|
) -> None:
|
|
37
38
|
"""Initialize the models exporter.
|
|
@@ -46,6 +47,10 @@ class ModelsExporter(BaseExporter, ExporterMixin):
|
|
|
46
47
|
The models.
|
|
47
48
|
model_names : Dict[str, str]
|
|
48
49
|
The model names.
|
|
50
|
+
for_notebook : bool
|
|
51
|
+
Whether the export is for a notebook or not.
|
|
52
|
+
cache_seed : Optional[int]
|
|
53
|
+
The cache seed if any, by default None
|
|
49
54
|
output_dir : Optional[Union[str, Path]], optional
|
|
50
55
|
The output directory if any, by default None
|
|
51
56
|
"""
|
|
@@ -57,6 +62,7 @@ class ModelsExporter(BaseExporter, ExporterMixin):
|
|
|
57
62
|
self.model_names = model_names
|
|
58
63
|
if output_dir is not None and not isinstance(output_dir, Path):
|
|
59
64
|
output_dir = Path(output_dir)
|
|
65
|
+
self.cache_seed = cache_seed
|
|
60
66
|
self.output_dir = output_dir
|
|
61
67
|
self._exported_string = None
|
|
62
68
|
|
|
@@ -127,6 +133,7 @@ class ModelsExporter(BaseExporter, ExporterMixin):
|
|
|
127
133
|
agent,
|
|
128
134
|
all_models=self.models,
|
|
129
135
|
model_names=self.model_names,
|
|
136
|
+
cache_seed=self.cache_seed,
|
|
130
137
|
),
|
|
131
138
|
AgentPosition(
|
|
132
139
|
agent=agent, position=AgentPositions.AS_ARGUMENT
|
|
@@ -63,6 +63,7 @@ def get_agent_llm_config_arg(
|
|
|
63
63
|
agent: WaldiezAgent,
|
|
64
64
|
all_models: List[WaldiezModel],
|
|
65
65
|
model_names: Dict[str, str],
|
|
66
|
+
cache_seed: Optional[int],
|
|
66
67
|
tabs: int = 1,
|
|
67
68
|
) -> str:
|
|
68
69
|
"""Get the string representation of the agent's llm config argument.
|
|
@@ -75,6 +76,8 @@ def get_agent_llm_config_arg(
|
|
|
75
76
|
All the models in the flow.
|
|
76
77
|
model_names : Dict[str, str]
|
|
77
78
|
A mapping of model ids to model names.
|
|
79
|
+
cache_seed : Optional[int]
|
|
80
|
+
The cache seed.
|
|
78
81
|
tabs : int, optional
|
|
79
82
|
The number of tabs for indentation, by default 1.
|
|
80
83
|
|
|
@@ -98,6 +101,7 @@ def get_agent_llm_config_arg(
|
|
|
98
101
|
if not got_at_least_one_model: # pragma: no cover
|
|
99
102
|
return f"{tab}llm_config=False," + "\n"
|
|
100
103
|
content += "\n" + f"{tab} ]," + "\n"
|
|
104
|
+
content += f'{tab} "cache_seed": {cache_seed},' + "\n"
|
|
101
105
|
content += tab + "},\n"
|
|
102
106
|
return content
|
|
103
107
|
|
|
@@ -115,8 +115,8 @@ class WaldiezAgents(WaldiezBase):
|
|
|
115
115
|
If the agents are invalid.
|
|
116
116
|
"""
|
|
117
117
|
all_agent_ids = [agent.id for agent in self.members]
|
|
118
|
-
if len(all_agent_ids) <
|
|
119
|
-
raise ValueError("At least
|
|
118
|
+
if len(all_agent_ids) < 1:
|
|
119
|
+
raise ValueError("At least one agent is required.")
|
|
120
120
|
if len(all_agent_ids) != len(set(all_agent_ids)):
|
|
121
121
|
raise ValueError("Agent IDs must be unique.")
|
|
122
122
|
return self
|