waldiez 0.4.8__tar.gz → 0.4.9__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.4.8 → waldiez-0.4.9}/PKG-INFO +4 -4
- {waldiez-0.4.8 → waldiez-0.4.9}/pyproject.toml +3 -3
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/_version.py +1 -1
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/cli.py +10 -54
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/agent/extras/rag/chroma_extras.py +21 -9
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/io/structured.py +21 -1
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/runner.py +7 -18
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/running/__init__.py +12 -6
- waldiez-0.4.9/waldiez/running/post_run.py +119 -0
- waldiez-0.4.9/waldiez/running/pre_run.py +149 -0
- waldiez-0.4.9/waldiez/running/util.py +134 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/utils/__init__.py +2 -0
- waldiez-0.4.9/waldiez/utils/version.py +47 -0
- waldiez-0.4.8/waldiez/running/running.py +0 -388
- {waldiez-0.4.8 → waldiez-0.4.9}/.gitignore +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/LICENSE +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/NOTICE.md +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/README.md +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/__init__.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/__main__.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporter.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/__init__.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/agent/__init__.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/agent/code_execution.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/agent/exporter.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/agent/extras/__init__.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/agent/extras/captain_agent_extras.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/agent/extras/group/target.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/agent/extras/group_manager_agent_extas.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/agent/extras/group_member_extras.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/agent/extras/handoffs/__init__.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/agent/extras/handoffs/after_work.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/agent/extras/handoffs/available.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/agent/extras/handoffs/condition.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/agent/extras/handoffs/handoff.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/agent/extras/handoffs/target.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/agent/extras/rag/__init__.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/agent/extras/rag/mongo_extras.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/agent/extras/rag/pgvector_extras.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/agent/extras/rag/qdrant_extras.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/agent/extras/rag/vector_db_extras.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/agent/extras/rag_user_proxy_agent_extras.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/agent/extras/reasoning_agent_extras.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/agent/factory.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/agent/processor.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/agent/system_message.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/agent/termination.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/chats/__init__.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/chats/exporter.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/chats/factory.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/chats/processor.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/chats/utils/__init__.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/chats/utils/common.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/chats/utils/group.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/chats/utils/nested.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/chats/utils/sequential.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/chats/utils/single.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/core/__init__.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/core/constants.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/core/content.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/core/context.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/core/enums.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/core/errors.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/core/exporter.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/core/exporters.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/core/extras/__init__.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/core/extras/agent_extras/__init__.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/core/extras/agent_extras/captain_extras.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/core/extras/agent_extras/group_manager_extras.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/core/extras/agent_extras/rag_user_extras.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/core/extras/agent_extras/reasoning_extras.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/core/extras/agent_extras/standard_extras.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/core/extras/base.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/core/extras/chat_extras.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/core/extras/flow_extras.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/core/extras/model_extras.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/core/extras/path_resolver.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/core/extras/serializer.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/core/extras/tool_extras.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/core/protocols.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/core/result.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/core/types.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/core/utils/__init__.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/core/utils/comment.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/core/utils/llm_config.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/core/validation.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/flow/__init__.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/flow/execution_generator.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/flow/exporter.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/flow/factory.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/flow/file_generator.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/flow/merger.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/flow/orchestrator.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/flow/utils/__init__.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/flow/utils/common.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/flow/utils/importing.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/flow/utils/linting.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/flow/utils/logging.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/models/__init__.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/models/exporter.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/models/factory.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/models/processor.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/tools/__init__.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/tools/exporter.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/tools/factory.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/tools/processor.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/exporting/tools/registration.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/io/__init__.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/io/_ws.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/io/models/__init__.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/io/models/base.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/io/models/constants.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/io/models/content/__init__.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/io/models/content/audio.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/io/models/content/base.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/io/models/content/file.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/io/models/content/image.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/io/models/content/text.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/io/models/content/video.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/io/models/user_input.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/io/models/user_response.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/io/mqtt.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/io/redis.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/io/utils.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/io/ws.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/logger.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/__init__.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/agents/__init__.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/agents/agent/__init__.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/agents/agent/agent.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/agents/agent/agent_data.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/agents/agent/agent_type.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/agents/agent/code_execution.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/agents/agent/human_input_mode.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/agents/agent/linked_tool.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/agents/agent/nested_chat.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/agents/agent/termination_message.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/agents/agent/update_system_message.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/agents/agents.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/agents/assistant/__init__.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/agents/assistant/assistant.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/agents/assistant/assistant_data.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/agents/captain/__init__.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/agents/captain/captain_agent.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/agents/captain/captain_agent_data.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/agents/captain/captain_agent_lib_entry.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/agents/extra_requirements.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/agents/group_manager/__init__.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/agents/group_manager/group_manager.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/agents/group_manager/group_manager_data.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/agents/group_manager/speakers.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/agents/rag_user_proxy/__init__.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/agents/rag_user_proxy/rag_user_proxy.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/agents/rag_user_proxy/rag_user_proxy_data.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/agents/rag_user_proxy/retrieve_config.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/agents/rag_user_proxy/vector_db_config.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/agents/reasoning/__init__.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/agents/reasoning/reasoning_agent.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/agents/reasoning/reasoning_agent_data.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/agents/reasoning/reasoning_agent_reason_config.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/agents/user_proxy/__init__.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/agents/user_proxy/user_proxy.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/agents/user_proxy/user_proxy_data.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/chat/__init__.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/chat/chat.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/chat/chat_data.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/chat/chat_message.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/chat/chat_nested.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/chat/chat_summary.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/common/__init__.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/common/ag2_version.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/common/base.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/common/date_utils.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/common/dict_utils.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/common/handoff.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/common/id_generator.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/common/method_utils.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/common/naming.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/common/waldiez_version.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/flow/__init__.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/flow/connection.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/flow/flow.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/flow/flow_data.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/flow/info.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/flow/naming.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/model/__init__.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/model/extra_requirements.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/model/model.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/model/model_data.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/tool/__init__.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/tool/extra_requirements.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/tool/tool.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/tool/tool_data.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/tool/tool_type.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/models/waldiez.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/py.typed +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/running/environment.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/running/gen_seq_diagram.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/utils/cli_extras/__init__.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/utils/cli_extras/jupyter.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/utils/cli_extras/runner.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/utils/cli_extras/studio.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/utils/conflict_checker.py +0 -0
- {waldiez-0.4.8 → waldiez-0.4.9}/waldiez/utils/flaml_warnings.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: waldiez
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.9
|
|
4
4
|
Dynamic: Keywords
|
|
5
5
|
Summary: Make AG2 Agents Collaborate: Drag, Drop, and Orchestrate with Waldiez.
|
|
6
6
|
Project-URL: Homepage, https://waldiez.io
|
|
@@ -157,15 +157,15 @@ Requires-Dist: natsort==8.4.0; extra == 'docs'
|
|
|
157
157
|
Provides-Extra: jupyter
|
|
158
158
|
Requires-Dist: jupyter-server==2.16.0; extra == 'jupyter'
|
|
159
159
|
Requires-Dist: jupyterlab<5.0,>=4.3.0; extra == 'jupyter'
|
|
160
|
-
Requires-Dist: waldiez-jupyter==0.4.
|
|
160
|
+
Requires-Dist: waldiez-jupyter==0.4.9; extra == 'jupyter'
|
|
161
161
|
Provides-Extra: mqtt
|
|
162
162
|
Requires-Dist: paho-mqtt<3.0,>=2.1.0; extra == 'mqtt'
|
|
163
163
|
Provides-Extra: redis
|
|
164
164
|
Requires-Dist: ag2[redis]==0.9.2; extra == 'redis'
|
|
165
165
|
Provides-Extra: runner
|
|
166
|
-
Requires-Dist: waldiez-runner==0.4.
|
|
166
|
+
Requires-Dist: waldiez-runner==0.4.9; (python_version >= '3.11') and extra == 'runner'
|
|
167
167
|
Provides-Extra: studio
|
|
168
|
-
Requires-Dist: waldiez-studio==0.4.
|
|
168
|
+
Requires-Dist: waldiez-studio==0.4.9; extra == 'studio'
|
|
169
169
|
Provides-Extra: test
|
|
170
170
|
Requires-Dist: ag2[redis]==0.9.2; extra == 'test'
|
|
171
171
|
Requires-Dist: ag2[websockets]==0.9.2; extra == 'test'
|
|
@@ -81,15 +81,15 @@ mqtt = [
|
|
|
81
81
|
]
|
|
82
82
|
# jupyterlab extension
|
|
83
83
|
jupyter = [
|
|
84
|
-
"waldiez_jupyter==0.4.
|
|
84
|
+
"waldiez_jupyter==0.4.9",
|
|
85
85
|
"jupyterlab>=4.3.0,<5.0",
|
|
86
86
|
"jupyter_server==2.16.0",
|
|
87
87
|
]
|
|
88
88
|
runner = [
|
|
89
|
-
"waldiez_runner==0.4.
|
|
89
|
+
"waldiez_runner==0.4.9; python_version >= '3.11'",
|
|
90
90
|
]
|
|
91
91
|
studio = [
|
|
92
|
-
"waldiez_studio==0.4.
|
|
92
|
+
"waldiez_studio==0.4.9",
|
|
93
93
|
]
|
|
94
94
|
ag2_extras = [
|
|
95
95
|
# models
|
|
@@ -2,43 +2,25 @@
|
|
|
2
2
|
# Copyright (c) 2024 - 2025 Waldiez and contributors.
|
|
3
3
|
# flake8: noqa: E501
|
|
4
4
|
# pylint: disable=missing-function-docstring,missing-param-doc,missing-raises-doc
|
|
5
|
+
# pylint: disable=line-too-long
|
|
5
6
|
"""Command line interface to convert or run a waldiez file."""
|
|
6
7
|
|
|
7
8
|
import json
|
|
8
9
|
import os
|
|
9
10
|
from pathlib import Path
|
|
10
|
-
from typing import
|
|
11
|
+
from typing import Any, Optional
|
|
11
12
|
|
|
12
13
|
import anyio
|
|
13
14
|
import typer
|
|
14
15
|
from dotenv import load_dotenv
|
|
15
16
|
from typing_extensions import Annotated
|
|
16
17
|
|
|
17
|
-
# pylint: disable=import-error,line-too-long
|
|
18
|
-
# pyright: reportMissingImports=false
|
|
19
|
-
try: # pragma: no cover
|
|
20
|
-
# fmt: off
|
|
21
|
-
from ._version import __version__ # type: ignore[unused-ignore, unused-import, import-not-found, import-untyped] # noqa
|
|
22
|
-
# fmt: on
|
|
23
|
-
except ImportError: # pragma: no cover
|
|
24
|
-
import warnings
|
|
25
|
-
|
|
26
|
-
warnings.warn(
|
|
27
|
-
"Importing __version__ failed. Using 'dev' as version.", stacklevel=2
|
|
28
|
-
)
|
|
29
|
-
__version__ = "dev"
|
|
30
|
-
|
|
31
|
-
|
|
32
18
|
from .exporter import WaldiezExporter
|
|
33
19
|
from .io import StructuredIOStream
|
|
34
20
|
from .logger import get_logger
|
|
35
21
|
from .models import Waldiez
|
|
36
22
|
from .runner import WaldiezRunner
|
|
37
|
-
from .utils import add_cli_extras
|
|
38
|
-
|
|
39
|
-
if TYPE_CHECKING:
|
|
40
|
-
from autogen import ChatResult # type: ignore[import-untyped]
|
|
41
|
-
|
|
23
|
+
from .utils import add_cli_extras, get_waldiez_version
|
|
42
24
|
|
|
43
25
|
load_dotenv()
|
|
44
26
|
LOG = get_logger()
|
|
@@ -71,7 +53,7 @@ def show_version(
|
|
|
71
53
|
) -> None:
|
|
72
54
|
"""Show the version of the Waldiez package and exit."""
|
|
73
55
|
if version:
|
|
74
|
-
typer.echo(f"waldiez version: {
|
|
56
|
+
typer.echo(f"waldiez version: {get_waldiez_version()}")
|
|
75
57
|
raise typer.Exit()
|
|
76
58
|
|
|
77
59
|
|
|
@@ -130,27 +112,12 @@ def run(
|
|
|
130
112
|
except json.decoder.JSONDecodeError as error:
|
|
131
113
|
typer.echo("Invalid .waldiez file. Not a valid json?")
|
|
132
114
|
raise typer.Exit(code=1) from error
|
|
133
|
-
|
|
115
|
+
_do_run(
|
|
134
116
|
data,
|
|
135
117
|
structured=structured,
|
|
136
118
|
uploads_root=uploads_root,
|
|
137
119
|
output_path=output_path,
|
|
138
120
|
)
|
|
139
|
-
if isinstance(results, list):
|
|
140
|
-
LOG.info("Results:")
|
|
141
|
-
for result in results:
|
|
142
|
-
_log_result(result)
|
|
143
|
-
sep = "-" * 80
|
|
144
|
-
print("\n" + f"{sep}" + "\n")
|
|
145
|
-
elif isinstance(results, dict):
|
|
146
|
-
LOG.info("Results:")
|
|
147
|
-
for key, result in results.items():
|
|
148
|
-
LOG.info("Order: %s", key)
|
|
149
|
-
_log_result(result)
|
|
150
|
-
sep = "-" * 80
|
|
151
|
-
print("\n" + f"{sep}" + "\n")
|
|
152
|
-
else:
|
|
153
|
-
_log_result(results)
|
|
154
121
|
|
|
155
122
|
|
|
156
123
|
@app.command()
|
|
@@ -239,7 +206,7 @@ def _do_run(
|
|
|
239
206
|
structured: bool,
|
|
240
207
|
uploads_root: Optional[Path],
|
|
241
208
|
output_path: Optional[Path],
|
|
242
|
-
) ->
|
|
209
|
+
) -> None:
|
|
243
210
|
"""Run the Waldiez flow and get the results."""
|
|
244
211
|
waldiez = Waldiez.from_dict(data)
|
|
245
212
|
if structured:
|
|
@@ -247,30 +214,29 @@ def _do_run(
|
|
|
247
214
|
with StructuredIOStream.set_default(stream):
|
|
248
215
|
runner = WaldiezRunner(waldiez)
|
|
249
216
|
if waldiez.is_async:
|
|
250
|
-
|
|
217
|
+
anyio.run(
|
|
251
218
|
runner.a_run,
|
|
252
219
|
output_path,
|
|
253
220
|
uploads_root,
|
|
254
221
|
)
|
|
255
222
|
else:
|
|
256
|
-
|
|
223
|
+
runner.run(
|
|
257
224
|
output_path=output_path,
|
|
258
225
|
uploads_root=uploads_root,
|
|
259
226
|
)
|
|
260
227
|
else:
|
|
261
228
|
runner = WaldiezRunner(waldiez)
|
|
262
229
|
if waldiez.is_async:
|
|
263
|
-
|
|
230
|
+
anyio.run(
|
|
264
231
|
runner.a_run,
|
|
265
232
|
output_path,
|
|
266
233
|
uploads_root,
|
|
267
234
|
)
|
|
268
235
|
else:
|
|
269
|
-
|
|
236
|
+
runner.run(
|
|
270
237
|
output_path=output_path,
|
|
271
238
|
uploads_root=uploads_root,
|
|
272
239
|
)
|
|
273
|
-
return results
|
|
274
240
|
|
|
275
241
|
|
|
276
242
|
def _get_output_path(output: Optional[Path], force: bool) -> Optional[Path]:
|
|
@@ -286,16 +252,6 @@ def _get_output_path(output: Optional[Path], force: bool) -> Optional[Path]:
|
|
|
286
252
|
return output
|
|
287
253
|
|
|
288
254
|
|
|
289
|
-
def _log_result(result: "ChatResult") -> None:
|
|
290
|
-
"""Log the result of the Waldiez flow."""
|
|
291
|
-
LOG.info("Chat History:\n")
|
|
292
|
-
LOG.info(result.chat_history)
|
|
293
|
-
LOG.info("Summary:\n")
|
|
294
|
-
LOG.info(result.summary)
|
|
295
|
-
LOG.info("Cost:\n")
|
|
296
|
-
LOG.info(result.cost)
|
|
297
|
-
|
|
298
|
-
|
|
299
255
|
add_cli_extras(app)
|
|
300
256
|
|
|
301
257
|
if __name__ == "__main__":
|
|
@@ -65,15 +65,13 @@ def _get_chroma_embedding_function_string(
|
|
|
65
65
|
to_import = ""
|
|
66
66
|
embedding_function_arg = ""
|
|
67
67
|
embedding_function_content = ""
|
|
68
|
-
vector_db_model = agent.retrieve_config.db_config.model
|
|
69
68
|
if not agent.retrieve_config.use_custom_embedding:
|
|
70
69
|
to_import = (
|
|
71
70
|
"from chromadb.utils.embedding_functions."
|
|
72
71
|
"sentence_transformer_embedding_function import "
|
|
73
72
|
"SentenceTransformerEmbeddingFunction"
|
|
74
73
|
)
|
|
75
|
-
embedding_function_arg = "
|
|
76
|
-
embedding_function_arg += f'model_name="{vector_db_model}")'
|
|
74
|
+
embedding_function_arg = f"{agent_name}_embedding_function"
|
|
77
75
|
else:
|
|
78
76
|
embedding_function_content, embedding_function_arg = (
|
|
79
77
|
agent.retrieve_config.get_custom_embedding_function(
|
|
@@ -124,21 +122,35 @@ def get_chroma_db_args(
|
|
|
124
122
|
# manually initializing the collection before running the flow,
|
|
125
123
|
# might be a workaround.
|
|
126
124
|
content_before = f"{agent_name}_client = {client_str}" + "\n"
|
|
125
|
+
vector_db_model = agent.retrieve_config.db_config.model
|
|
126
|
+
if not embedding_function_body:
|
|
127
|
+
content_before += (
|
|
128
|
+
f"{agent_name}_embedding_function = "
|
|
129
|
+
"SentenceTransformerEmbeddingFunction(\n"
|
|
130
|
+
f' model_name="{vector_db_model}",' + "\n"
|
|
131
|
+
")\n"
|
|
132
|
+
)
|
|
127
133
|
collection_name = agent.retrieve_config.collection_name
|
|
128
134
|
get_or_create = agent.retrieve_config.get_or_create
|
|
129
135
|
if collection_name:
|
|
130
136
|
if get_or_create:
|
|
131
137
|
content_before += (
|
|
132
|
-
f"{agent_name}_client.get_or_create_collection("
|
|
133
|
-
f'"{collection_name}"
|
|
138
|
+
f"{agent_name}_client.get_or_create_collection" + "(\n"
|
|
139
|
+
f' "{collection_name}",' + "\n"
|
|
140
|
+
f" embedding_function={embedding_function_arg}," + "\n"
|
|
141
|
+
")" + "\n"
|
|
134
142
|
)
|
|
135
143
|
else:
|
|
136
144
|
content_before += (
|
|
137
145
|
"try:\n"
|
|
138
|
-
f
|
|
139
|
-
+ "\n"
|
|
146
|
+
f" {agent_name}_client.get_collection(" + "\n"
|
|
147
|
+
f' "{collection_name}",' + "\n"
|
|
148
|
+
f" embedding_function={embedding_function_arg}," + "\n"
|
|
149
|
+
" )\n"
|
|
140
150
|
"except ValueError:\n"
|
|
141
|
-
f" {agent_name}_client.create_collection("
|
|
142
|
-
f'"{collection_name}"
|
|
151
|
+
f" {agent_name}_client.create_collection(" + "\n"
|
|
152
|
+
f' "{collection_name}",' + "\n"
|
|
153
|
+
f" embedding_function={embedding_function_arg}," + "\n"
|
|
154
|
+
" )\n"
|
|
143
155
|
)
|
|
144
156
|
return kwarg_string, to_import, embedding_function_body, content_before
|
|
@@ -36,9 +36,13 @@ class StructuredIOStream(IOStream):
|
|
|
36
36
|
uploads_root: Path | None = None
|
|
37
37
|
|
|
38
38
|
def __init__(
|
|
39
|
-
self,
|
|
39
|
+
self,
|
|
40
|
+
timeout: float = 120,
|
|
41
|
+
uploads_root: Path | str | None = None,
|
|
42
|
+
is_async: bool = False,
|
|
40
43
|
) -> None:
|
|
41
44
|
self.timeout = timeout
|
|
45
|
+
self.is_async = is_async
|
|
42
46
|
if uploads_root is not None:
|
|
43
47
|
self.uploads_root = Path(uploads_root).resolve()
|
|
44
48
|
if not self.uploads_root.exists():
|
|
@@ -106,6 +110,22 @@ class StructuredIOStream(IOStream):
|
|
|
106
110
|
uploads_root=self.uploads_root,
|
|
107
111
|
base_name=request_id,
|
|
108
112
|
)
|
|
113
|
+
# let's keep an eye here:
|
|
114
|
+
# https://github.com/ag2ai/ag2/blob/main/autogen/agentchat/conversable_agent.py#L2973
|
|
115
|
+
# reply = await iostream.input(prompt) ???? (await???)
|
|
116
|
+
if self.is_async:
|
|
117
|
+
# let's make a coroutine to just return the user response
|
|
118
|
+
async def async_input() -> str:
|
|
119
|
+
"""Asynchronous input method.
|
|
120
|
+
|
|
121
|
+
Returns
|
|
122
|
+
-------
|
|
123
|
+
str
|
|
124
|
+
The line read from the input stream.
|
|
125
|
+
"""
|
|
126
|
+
return user_response
|
|
127
|
+
|
|
128
|
+
return async_input() # type: ignore
|
|
109
129
|
return user_response
|
|
110
130
|
|
|
111
131
|
# noinspection PyMethodMayBeStatic
|
|
@@ -18,7 +18,6 @@ from pathlib import Path
|
|
|
18
18
|
from types import ModuleType, TracebackType
|
|
19
19
|
from typing import (
|
|
20
20
|
TYPE_CHECKING,
|
|
21
|
-
Callable,
|
|
22
21
|
Optional,
|
|
23
22
|
Set,
|
|
24
23
|
Type,
|
|
@@ -34,7 +33,6 @@ from .running import (
|
|
|
34
33
|
after_run,
|
|
35
34
|
before_run,
|
|
36
35
|
chdir,
|
|
37
|
-
get_printer,
|
|
38
36
|
install_requirements,
|
|
39
37
|
refresh_environment,
|
|
40
38
|
reset_env_vars,
|
|
@@ -166,25 +164,22 @@ class WaldiezRunner:
|
|
|
166
164
|
def install_requirements(self) -> None:
|
|
167
165
|
"""Install the requirements for the flow."""
|
|
168
166
|
self._called_install_requirements = True
|
|
169
|
-
printer = get_printer()
|
|
170
167
|
extra_requirements = self.gather_requirements()
|
|
171
168
|
if extra_requirements:
|
|
172
|
-
install_requirements(extra_requirements
|
|
169
|
+
install_requirements(extra_requirements)
|
|
173
170
|
|
|
174
171
|
async def a_install_requirements(self) -> None:
|
|
175
172
|
"""Install the requirements for the flow asynchronously."""
|
|
176
173
|
self._called_install_requirements = True
|
|
177
|
-
printer = get_printer()
|
|
178
174
|
extra_requirements = self.gather_requirements()
|
|
179
175
|
if extra_requirements:
|
|
180
|
-
await a_install_requirements(extra_requirements
|
|
176
|
+
await a_install_requirements(extra_requirements)
|
|
181
177
|
|
|
182
178
|
def _before_run(
|
|
183
179
|
self,
|
|
184
180
|
temp_dir: Path,
|
|
185
181
|
file_name: str,
|
|
186
182
|
module_name: str,
|
|
187
|
-
printer: Callable[..., None],
|
|
188
183
|
) -> tuple[ModuleType, dict[str, str]]:
|
|
189
184
|
self._exporter.export(Path(file_name))
|
|
190
185
|
# unique_names = self._exporter.context.get_unique_names()
|
|
@@ -197,8 +192,8 @@ class WaldiezRunner:
|
|
|
197
192
|
old_vars = set_env_vars(self.waldiez.get_flow_env_vars())
|
|
198
193
|
module = importlib.util.module_from_spec(spec)
|
|
199
194
|
spec.loader.exec_module(module)
|
|
200
|
-
|
|
201
|
-
|
|
195
|
+
print("<Waldiez> - Starting workflow...")
|
|
196
|
+
print(self.waldiez.info.model_dump_json())
|
|
202
197
|
return module, old_vars
|
|
203
198
|
|
|
204
199
|
def _run(
|
|
@@ -232,8 +227,7 @@ class WaldiezRunner:
|
|
|
232
227
|
if not self._called_install_requirements:
|
|
233
228
|
self.install_requirements()
|
|
234
229
|
refresh_environment()
|
|
235
|
-
|
|
236
|
-
printer(
|
|
230
|
+
print(
|
|
237
231
|
"Requirements installed.\n"
|
|
238
232
|
"NOTE: If new packages were added and you are using Jupyter, "
|
|
239
233
|
"you might need to restart the kernel."
|
|
@@ -246,7 +240,6 @@ class WaldiezRunner:
|
|
|
246
240
|
temp_dir=temp_dir,
|
|
247
241
|
file_name=file_name,
|
|
248
242
|
module_name=module_name,
|
|
249
|
-
printer=printer,
|
|
250
243
|
)
|
|
251
244
|
if use_structured_io:
|
|
252
245
|
stream = StructuredIOStream(
|
|
@@ -257,13 +250,12 @@ class WaldiezRunner:
|
|
|
257
250
|
results = module.main()
|
|
258
251
|
else:
|
|
259
252
|
results = module.main()
|
|
260
|
-
|
|
253
|
+
print("<Waldiez> - Workflow finished")
|
|
261
254
|
sys.path.pop(0)
|
|
262
255
|
reset_env_vars(old_vars)
|
|
263
256
|
after_run(
|
|
264
257
|
temp_dir=temp_dir,
|
|
265
258
|
output_path=output_path,
|
|
266
|
-
printer=printer,
|
|
267
259
|
flow_name=self.waldiez.name,
|
|
268
260
|
skip_mmd=skip_mmd,
|
|
269
261
|
)
|
|
@@ -285,8 +277,7 @@ class WaldiezRunner:
|
|
|
285
277
|
if not self._called_install_requirements:
|
|
286
278
|
await self.a_install_requirements()
|
|
287
279
|
refresh_environment()
|
|
288
|
-
|
|
289
|
-
printer(
|
|
280
|
+
print(
|
|
290
281
|
"Requirements installed.\n"
|
|
291
282
|
"NOTE: If new packages were added and you are using Jupyter, "
|
|
292
283
|
"you might need to restart the kernel."
|
|
@@ -299,7 +290,6 @@ class WaldiezRunner:
|
|
|
299
290
|
temp_dir=temp_dir,
|
|
300
291
|
file_name=file_name,
|
|
301
292
|
module_name=module_name,
|
|
302
|
-
printer=printer,
|
|
303
293
|
)
|
|
304
294
|
if use_structured_io:
|
|
305
295
|
stream = StructuredIOStream(
|
|
@@ -315,7 +305,6 @@ class WaldiezRunner:
|
|
|
315
305
|
after_run(
|
|
316
306
|
temp_dir=temp_dir,
|
|
317
307
|
output_path=output_path,
|
|
318
|
-
printer=printer,
|
|
319
308
|
flow_name=self.waldiez.name,
|
|
320
309
|
skip_mmd=skip_mmd,
|
|
321
310
|
)
|
|
@@ -9,23 +9,29 @@ from .environment import (
|
|
|
9
9
|
reset_env_vars,
|
|
10
10
|
set_env_vars,
|
|
11
11
|
)
|
|
12
|
-
from .
|
|
13
|
-
|
|
12
|
+
from .post_run import after_run
|
|
13
|
+
from .pre_run import (
|
|
14
14
|
a_install_requirements,
|
|
15
|
-
after_run,
|
|
16
15
|
before_run,
|
|
17
|
-
chdir,
|
|
18
|
-
get_printer,
|
|
19
16
|
install_requirements,
|
|
20
17
|
)
|
|
18
|
+
from .util import (
|
|
19
|
+
a_chdir,
|
|
20
|
+
chdir,
|
|
21
|
+
create_async_subprocess,
|
|
22
|
+
create_sync_subprocess,
|
|
23
|
+
strip_ansi,
|
|
24
|
+
)
|
|
21
25
|
|
|
22
26
|
__all__ = [
|
|
23
27
|
"a_chdir",
|
|
24
28
|
"a_install_requirements",
|
|
25
29
|
"after_run",
|
|
26
30
|
"before_run",
|
|
31
|
+
"create_async_subprocess",
|
|
32
|
+
"create_sync_subprocess",
|
|
33
|
+
"strip_ansi",
|
|
27
34
|
"chdir",
|
|
28
|
-
"get_printer",
|
|
29
35
|
"in_virtualenv",
|
|
30
36
|
"is_root",
|
|
31
37
|
"install_requirements",
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0.
|
|
2
|
+
# Copyright (c) 2024 - 2025 Waldiez and contributors.
|
|
3
|
+
"""Utilities for running code."""
|
|
4
|
+
|
|
5
|
+
import datetime
|
|
6
|
+
import shutil
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
from typing import Optional, Union
|
|
9
|
+
|
|
10
|
+
from .gen_seq_diagram import generate_sequence_diagram
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def after_run(
|
|
14
|
+
temp_dir: Path,
|
|
15
|
+
output_path: Optional[Union[str, Path]],
|
|
16
|
+
flow_name: str,
|
|
17
|
+
skip_mmd: bool = False,
|
|
18
|
+
) -> None:
|
|
19
|
+
"""Actions to perform after running the flow.
|
|
20
|
+
|
|
21
|
+
Parameters
|
|
22
|
+
----------
|
|
23
|
+
temp_dir : Path
|
|
24
|
+
The temporary directory.
|
|
25
|
+
output_path : Optional[Union[str, Path]]
|
|
26
|
+
The output path.
|
|
27
|
+
flow_name : str
|
|
28
|
+
The flow name.
|
|
29
|
+
skip_mmd : bool, optional
|
|
30
|
+
Whether to skip the mermaid sequence diagram generation,
|
|
31
|
+
by default, False
|
|
32
|
+
"""
|
|
33
|
+
if isinstance(output_path, str):
|
|
34
|
+
output_path = Path(output_path)
|
|
35
|
+
mmd_dir = output_path.parent if output_path else Path.cwd()
|
|
36
|
+
if skip_mmd is False:
|
|
37
|
+
events_csv_path = temp_dir / "logs" / "events.csv"
|
|
38
|
+
if events_csv_path.exists():
|
|
39
|
+
print("Generating mermaid sequence diagram...")
|
|
40
|
+
mmd_path = temp_dir / f"{flow_name}.mmd"
|
|
41
|
+
generate_sequence_diagram(events_csv_path, mmd_path)
|
|
42
|
+
if (
|
|
43
|
+
not output_path
|
|
44
|
+
and mmd_path.exists()
|
|
45
|
+
and mmd_path != mmd_dir / f"{flow_name}.mmd"
|
|
46
|
+
):
|
|
47
|
+
try:
|
|
48
|
+
shutil.copyfile(mmd_path, mmd_dir / f"{flow_name}.mmd")
|
|
49
|
+
except BaseException: # pylint: disable=broad-exception-caught
|
|
50
|
+
pass
|
|
51
|
+
if output_path:
|
|
52
|
+
destination_dir = output_path.parent
|
|
53
|
+
destination_dir = (
|
|
54
|
+
destination_dir
|
|
55
|
+
/ "waldiez_out"
|
|
56
|
+
/ datetime.datetime.now().strftime("%Y%m%d%H%M%S")
|
|
57
|
+
)
|
|
58
|
+
destination_dir.mkdir(parents=True, exist_ok=True)
|
|
59
|
+
# copy the contents of the temp dir to the destination dir
|
|
60
|
+
print(f"Copying the results to {destination_dir}")
|
|
61
|
+
copy_results(
|
|
62
|
+
temp_dir=temp_dir,
|
|
63
|
+
output_path=output_path,
|
|
64
|
+
output_dir=output_path.parent,
|
|
65
|
+
destination_dir=destination_dir,
|
|
66
|
+
)
|
|
67
|
+
shutil.rmtree(temp_dir)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def copy_results(
|
|
71
|
+
temp_dir: Path,
|
|
72
|
+
output_path: Path,
|
|
73
|
+
output_dir: Path,
|
|
74
|
+
destination_dir: Path,
|
|
75
|
+
) -> None:
|
|
76
|
+
"""Copy the results to the output directory.
|
|
77
|
+
|
|
78
|
+
Parameters
|
|
79
|
+
----------
|
|
80
|
+
temp_dir : Path
|
|
81
|
+
The temporary directory.
|
|
82
|
+
output_path : Path
|
|
83
|
+
The output path.
|
|
84
|
+
output_dir : Path
|
|
85
|
+
The output directory.
|
|
86
|
+
destination_dir : Path
|
|
87
|
+
The destination directory.
|
|
88
|
+
"""
|
|
89
|
+
temp_dir.mkdir(parents=True, exist_ok=True)
|
|
90
|
+
for item in temp_dir.iterdir():
|
|
91
|
+
# skip cache files
|
|
92
|
+
if (
|
|
93
|
+
item.name.startswith("__pycache__")
|
|
94
|
+
or item.name.endswith(".pyc")
|
|
95
|
+
or item.name.endswith(".pyo")
|
|
96
|
+
or item.name.endswith(".pyd")
|
|
97
|
+
or item.name == ".cache"
|
|
98
|
+
):
|
|
99
|
+
continue
|
|
100
|
+
if item.is_file():
|
|
101
|
+
# let's also copy the "tree of thoughts" image
|
|
102
|
+
# to the output directory
|
|
103
|
+
if item.name.endswith("tree_of_thoughts.png") or item.name.endswith(
|
|
104
|
+
"reasoning_tree.json"
|
|
105
|
+
):
|
|
106
|
+
shutil.copy(item, output_dir / item.name)
|
|
107
|
+
shutil.copy(item, destination_dir)
|
|
108
|
+
else:
|
|
109
|
+
shutil.copytree(item, destination_dir / item.name)
|
|
110
|
+
if output_path.is_file():
|
|
111
|
+
if output_path.suffix == ".waldiez":
|
|
112
|
+
output_path = output_path.with_suffix(".py")
|
|
113
|
+
if output_path.suffix == ".py":
|
|
114
|
+
src = temp_dir / output_path.name
|
|
115
|
+
if src.exists():
|
|
116
|
+
dst = destination_dir / output_path.name
|
|
117
|
+
if dst.exists():
|
|
118
|
+
dst.unlink()
|
|
119
|
+
shutil.copyfile(src, output_dir / output_path.name)
|