waldiez 0.4.9__tar.gz → 0.4.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.4.9 → waldiez-0.4.11}/.gitignore +1 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/PKG-INFO +11 -11
- {waldiez-0.4.9 → waldiez-0.4.11}/pyproject.toml +14 -11
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/__init__.py +1 -2
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/_version.py +1 -1
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/cli.py +88 -50
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporter.py +64 -9
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/core/context.py +12 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/core/extras/flow_extras.py +2 -14
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/core/types.py +21 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/flow/exporter.py +4 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/flow/factory.py +16 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/flow/orchestrator.py +12 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/flow/utils/__init__.py +2 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/flow/utils/common.py +96 -2
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/flow/utils/logging.py +5 -6
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/io/mqtt.py +7 -3
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/io/structured.py +5 -1
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/common/method_utils.py +1 -1
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/tool/tool.py +2 -1
- waldiez-0.4.11/waldiez/runner.py +496 -0
- waldiez-0.4.11/waldiez/running/__init__.py +13 -0
- waldiez-0.4.11/waldiez/running/base_runner.py +907 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/running/environment.py +74 -0
- waldiez-0.4.11/waldiez/running/import_runner.py +424 -0
- waldiez-0.4.11/waldiez/running/patch_io_stream.py +208 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/running/post_run.py +26 -24
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/running/pre_run.py +2 -46
- waldiez-0.4.11/waldiez/running/protocol.py +281 -0
- waldiez-0.4.11/waldiez/running/run_results.py +22 -0
- waldiez-0.4.11/waldiez/running/subprocess_runner.py +100 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/utils/__init__.py +0 -2
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/utils/version.py +4 -2
- waldiez-0.4.9/waldiez/runner.py +0 -415
- waldiez-0.4.9/waldiez/running/__init__.py +0 -41
- waldiez-0.4.9/waldiez/utils/flaml_warnings.py +0 -17
- {waldiez-0.4.9 → waldiez-0.4.11}/LICENSE +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/NOTICE.md +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/README.md +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/__main__.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/__init__.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/agent/__init__.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/agent/code_execution.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/agent/exporter.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/agent/extras/__init__.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/agent/extras/captain_agent_extras.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/agent/extras/group/target.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/agent/extras/group_manager_agent_extas.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/agent/extras/group_member_extras.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/agent/extras/handoffs/__init__.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/agent/extras/handoffs/after_work.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/agent/extras/handoffs/available.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/agent/extras/handoffs/condition.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/agent/extras/handoffs/handoff.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/agent/extras/handoffs/target.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/agent/extras/rag/__init__.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/agent/extras/rag/chroma_extras.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/agent/extras/rag/mongo_extras.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/agent/extras/rag/pgvector_extras.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/agent/extras/rag/qdrant_extras.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/agent/extras/rag/vector_db_extras.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/agent/extras/rag_user_proxy_agent_extras.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/agent/extras/reasoning_agent_extras.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/agent/factory.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/agent/processor.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/agent/system_message.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/agent/termination.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/chats/__init__.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/chats/exporter.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/chats/factory.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/chats/processor.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/chats/utils/__init__.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/chats/utils/common.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/chats/utils/group.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/chats/utils/nested.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/chats/utils/sequential.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/chats/utils/single.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/core/__init__.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/core/constants.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/core/content.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/core/enums.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/core/errors.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/core/exporter.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/core/exporters.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/core/extras/__init__.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/core/extras/agent_extras/__init__.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/core/extras/agent_extras/captain_extras.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/core/extras/agent_extras/group_manager_extras.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/core/extras/agent_extras/rag_user_extras.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/core/extras/agent_extras/reasoning_extras.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/core/extras/agent_extras/standard_extras.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/core/extras/base.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/core/extras/chat_extras.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/core/extras/model_extras.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/core/extras/path_resolver.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/core/extras/serializer.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/core/extras/tool_extras.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/core/protocols.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/core/result.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/core/utils/__init__.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/core/utils/comment.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/core/utils/llm_config.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/core/validation.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/flow/__init__.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/flow/execution_generator.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/flow/file_generator.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/flow/merger.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/flow/utils/importing.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/flow/utils/linting.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/models/__init__.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/models/exporter.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/models/factory.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/models/processor.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/tools/__init__.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/tools/exporter.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/tools/factory.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/tools/processor.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/exporting/tools/registration.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/io/__init__.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/io/_ws.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/io/models/__init__.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/io/models/base.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/io/models/constants.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/io/models/content/__init__.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/io/models/content/audio.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/io/models/content/base.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/io/models/content/file.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/io/models/content/image.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/io/models/content/text.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/io/models/content/video.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/io/models/user_input.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/io/models/user_response.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/io/redis.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/io/utils.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/io/ws.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/logger.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/__init__.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/agents/__init__.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/agents/agent/__init__.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/agents/agent/agent.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/agents/agent/agent_data.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/agents/agent/agent_type.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/agents/agent/code_execution.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/agents/agent/human_input_mode.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/agents/agent/linked_tool.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/agents/agent/nested_chat.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/agents/agent/termination_message.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/agents/agent/update_system_message.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/agents/agents.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/agents/assistant/__init__.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/agents/assistant/assistant.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/agents/assistant/assistant_data.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/agents/captain/__init__.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/agents/captain/captain_agent.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/agents/captain/captain_agent_data.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/agents/captain/captain_agent_lib_entry.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/agents/extra_requirements.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/agents/group_manager/__init__.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/agents/group_manager/group_manager.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/agents/group_manager/group_manager_data.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/agents/group_manager/speakers.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/agents/rag_user_proxy/__init__.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/agents/rag_user_proxy/rag_user_proxy.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/agents/rag_user_proxy/rag_user_proxy_data.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/agents/rag_user_proxy/retrieve_config.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/agents/rag_user_proxy/vector_db_config.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/agents/reasoning/__init__.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/agents/reasoning/reasoning_agent.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/agents/reasoning/reasoning_agent_data.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/agents/reasoning/reasoning_agent_reason_config.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/agents/user_proxy/__init__.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/agents/user_proxy/user_proxy.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/agents/user_proxy/user_proxy_data.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/chat/__init__.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/chat/chat.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/chat/chat_data.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/chat/chat_message.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/chat/chat_nested.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/chat/chat_summary.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/common/__init__.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/common/ag2_version.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/common/base.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/common/date_utils.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/common/dict_utils.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/common/handoff.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/common/id_generator.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/common/naming.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/common/waldiez_version.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/flow/__init__.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/flow/connection.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/flow/flow.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/flow/flow_data.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/flow/info.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/flow/naming.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/model/__init__.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/model/extra_requirements.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/model/model.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/model/model_data.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/tool/__init__.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/tool/extra_requirements.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/tool/tool_data.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/tool/tool_type.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/models/waldiez.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/py.typed +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/running/gen_seq_diagram.py +0 -0
- /waldiez-0.4.9/waldiez/running/util.py → /waldiez-0.4.11/waldiez/running/utils.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/utils/cli_extras/__init__.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/utils/cli_extras/jupyter.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/utils/cli_extras/runner.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/utils/cli_extras/studio.py +0 -0
- {waldiez-0.4.9 → waldiez-0.4.11}/waldiez/utils/conflict_checker.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.11
|
|
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
|
|
@@ -33,7 +33,7 @@ Requires-Dist: aiofiles==24.1.0
|
|
|
33
33
|
Requires-Dist: aiosqlite==0.21.0
|
|
34
34
|
Requires-Dist: asyncer==0.0.8
|
|
35
35
|
Requires-Dist: click<8.2
|
|
36
|
-
Requires-Dist: graphviz<=0.
|
|
36
|
+
Requires-Dist: graphviz<=0.21
|
|
37
37
|
Requires-Dist: httpx<1
|
|
38
38
|
Requires-Dist: jupytext
|
|
39
39
|
Requires-Dist: nest-asyncio==1.6.0
|
|
@@ -80,7 +80,7 @@ Requires-Dist: ipython; extra == 'ag2-extras'
|
|
|
80
80
|
Requires-Dist: langchain-community<1,>=0.3.12; extra == 'ag2-extras'
|
|
81
81
|
Requires-Dist: litellm; extra == 'ag2-extras'
|
|
82
82
|
Requires-Dist: markdownify; extra == 'ag2-extras'
|
|
83
|
-
Requires-Dist: mcp<
|
|
83
|
+
Requires-Dist: mcp<2,>=1.4.0; extra == 'ag2-extras'
|
|
84
84
|
Requires-Dist: mistralai>=1.8.1; extra == 'ag2-extras'
|
|
85
85
|
Requires-Dist: networkx; (python_version < '3.11') and extra == 'ag2-extras'
|
|
86
86
|
Requires-Dist: networkx>=3.5; (python_version >= '3.11') and extra == 'ag2-extras'
|
|
@@ -106,10 +106,10 @@ Provides-Extra: dev
|
|
|
106
106
|
Requires-Dist: ag2[redis]==0.9.2; extra == 'dev'
|
|
107
107
|
Requires-Dist: ag2[websockets]==0.9.2; extra == 'dev'
|
|
108
108
|
Requires-Dist: autoflake==2.3.1; extra == 'dev'
|
|
109
|
-
Requires-Dist: bandit==1.8.
|
|
109
|
+
Requires-Dist: bandit==1.8.5; extra == 'dev'
|
|
110
110
|
Requires-Dist: black[jupyter]==25.1.0; extra == 'dev'
|
|
111
111
|
Requires-Dist: build==1.2.2.post1; extra == 'dev'
|
|
112
|
-
Requires-Dist: fakeredis
|
|
112
|
+
Requires-Dist: fakeredis<=3.30.0,>=2.28.1; extra == 'dev'
|
|
113
113
|
Requires-Dist: fastjsonschema>=2.21; extra == 'dev'
|
|
114
114
|
Requires-Dist: flake8==7.2.0; extra == 'dev'
|
|
115
115
|
Requires-Dist: hatchling==1.27.0; extra == 'dev'
|
|
@@ -117,7 +117,7 @@ Requires-Dist: jsonschema==4.24.0; extra == 'dev'
|
|
|
117
117
|
Requires-Dist: jupyter-server==2.16.0; extra == 'dev'
|
|
118
118
|
Requires-Dist: jupyterlab<5.0,>=4.4.0; extra == 'dev'
|
|
119
119
|
Requires-Dist: mypy-extensions>=1.1.0; extra == 'dev'
|
|
120
|
-
Requires-Dist: mypy==1.16.
|
|
120
|
+
Requires-Dist: mypy==1.16.1; extra == 'dev'
|
|
121
121
|
Requires-Dist: nbclient>=0.10.2; extra == 'dev'
|
|
122
122
|
Requires-Dist: nbconvert>=7.16.6; extra == 'dev'
|
|
123
123
|
Requires-Dist: nbformat>=5.10.4; extra == 'dev'
|
|
@@ -134,7 +134,7 @@ Requires-Dist: toml==0.10.2; (python_version <= '3.10') and extra == 'dev'
|
|
|
134
134
|
Requires-Dist: types-jsonschema==4.24.0.20250528; extra == 'dev'
|
|
135
135
|
Requires-Dist: types-pyyaml==6.0.12.20250516; extra == 'dev'
|
|
136
136
|
Requires-Dist: types-redis==4.6.0.20241004; extra == 'dev'
|
|
137
|
-
Requires-Dist: types-requests==2.32.
|
|
137
|
+
Requires-Dist: types-requests==2.32.4.20250611; extra == 'dev'
|
|
138
138
|
Requires-Dist: types-toml==0.10.8.20240310; extra == 'dev'
|
|
139
139
|
Requires-Dist: watchdog==6.0.0; extra == 'dev'
|
|
140
140
|
Requires-Dist: yamllint==1.37.1; extra == 'dev'
|
|
@@ -157,19 +157,19 @@ 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.11; 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.11; (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.11; 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'
|
|
172
|
-
Requires-Dist: fakeredis
|
|
172
|
+
Requires-Dist: fakeredis<=3.30.0,>=2.28.1; extra == 'test'
|
|
173
173
|
Requires-Dist: paho-mqtt<3.0,>=2.1.0; extra == 'test'
|
|
174
174
|
Requires-Dist: pytest-asyncio==1.0.0; extra == 'test'
|
|
175
175
|
Requires-Dist: pytest-cov==6.1.1; extra == 'test'
|
|
@@ -34,7 +34,7 @@ dependencies = [
|
|
|
34
34
|
"asyncer==0.0.8",
|
|
35
35
|
"numpy<=2.3.0",
|
|
36
36
|
"nest_asyncio==1.6.0",
|
|
37
|
-
"graphviz<=0.
|
|
37
|
+
"graphviz<=0.21",
|
|
38
38
|
"pandas>=2",
|
|
39
39
|
"pillow",
|
|
40
40
|
"pip>=25",
|
|
@@ -81,15 +81,15 @@ mqtt = [
|
|
|
81
81
|
]
|
|
82
82
|
# jupyterlab extension
|
|
83
83
|
jupyter = [
|
|
84
|
-
"waldiez_jupyter==0.4.
|
|
84
|
+
"waldiez_jupyter==0.4.11",
|
|
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.11; python_version >= '3.11'",
|
|
90
90
|
]
|
|
91
91
|
studio = [
|
|
92
|
-
"waldiez_studio==0.4.
|
|
92
|
+
"waldiez_studio==0.4.11",
|
|
93
93
|
]
|
|
94
94
|
ag2_extras = [
|
|
95
95
|
# models
|
|
@@ -154,16 +154,16 @@ ag2_extras = [
|
|
|
154
154
|
"google-api-python-client>=2.163.0,<3.0",
|
|
155
155
|
"google-auth-httplib2>=0.2.0,<0.3",
|
|
156
156
|
"google-auth-oauthlib>=1.2.1,<2.0",
|
|
157
|
-
"mcp>=1.4.0,<
|
|
157
|
+
"mcp>=1.4.0,<2",
|
|
158
158
|
]
|
|
159
159
|
dev = [
|
|
160
160
|
"ag2[redis]==0.9.2",
|
|
161
161
|
"ag2[websockets]==0.9.2",
|
|
162
162
|
"autoflake==2.3.1",
|
|
163
|
-
"bandit==1.8.
|
|
163
|
+
"bandit==1.8.5",
|
|
164
164
|
"black[jupyter]==25.1.0",
|
|
165
165
|
"build==1.2.2.post1",
|
|
166
|
-
"fakeredis>=2.28.1",
|
|
166
|
+
"fakeredis>=2.28.1,<=3.30.0",
|
|
167
167
|
"flake8==7.2.0",
|
|
168
168
|
"jsonschema==4.24.0",
|
|
169
169
|
"jupyterlab>=4.4.0,<5.0",
|
|
@@ -174,7 +174,7 @@ dev = [
|
|
|
174
174
|
"nbformat>=5.10.4",
|
|
175
175
|
"nbconvert>=7.16.6",
|
|
176
176
|
"hatchling==1.27.0",
|
|
177
|
-
"mypy==1.16.
|
|
177
|
+
"mypy==1.16.1",
|
|
178
178
|
"mypy-extensions>=1.1.0",
|
|
179
179
|
"paho-mqtt>=2.1.0,<3.0",
|
|
180
180
|
"pandas-stubs==2.2.3.250527",
|
|
@@ -188,7 +188,7 @@ dev = [
|
|
|
188
188
|
"types-jsonschema==4.24.0.20250528",
|
|
189
189
|
"types-redis==4.6.0.20241004",
|
|
190
190
|
"types-toml==0.10.8.20240310",
|
|
191
|
-
"types-requests==2.32.
|
|
191
|
+
"types-requests==2.32.4.20250611",
|
|
192
192
|
"toml==0.10.2; python_version <= '3.10'",
|
|
193
193
|
"watchdog==6.0.0",
|
|
194
194
|
"yamllint==1.37.1",
|
|
@@ -213,9 +213,8 @@ docs = [
|
|
|
213
213
|
test = [
|
|
214
214
|
"ag2[redis]==0.9.2",
|
|
215
215
|
"ag2[websockets]==0.9.2",
|
|
216
|
-
"fakeredis>=2.28.1",
|
|
216
|
+
"fakeredis>=2.28.1,<=3.30.0",
|
|
217
217
|
"paho-mqtt>=2.1.0,<3.0",
|
|
218
|
-
|
|
219
218
|
"pytest==8.4.0",
|
|
220
219
|
"pytest-asyncio==1.0.0",
|
|
221
220
|
"pytest-cov==6.1.1",
|
|
@@ -284,6 +283,10 @@ test-io = """
|
|
|
284
283
|
hatch run pre-test
|
|
285
284
|
pytest -c pyproject.toml --cov=waldiez/io --cov-branch --cov-report=term-missing:skip-covered -vv tests/io
|
|
286
285
|
"""
|
|
286
|
+
test-running = """
|
|
287
|
+
hatch run pre-test
|
|
288
|
+
pytest -c pyproject.toml --cov=waldiez/running --cov-branch --cov-report=term-missing:skip-covered -vv tests/running
|
|
289
|
+
"""
|
|
287
290
|
|
|
288
291
|
format-black = "black --config pyproject.toml waldiez tests scripts"
|
|
289
292
|
format-autoflake = "autoflake --in-place --remove-all-unused-imports --remove-unused-variables --recursive waldiez tests scripts"
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
from .exporter import WaldiezExporter
|
|
6
6
|
from .models import Waldiez
|
|
7
7
|
from .runner import WaldiezRunner
|
|
8
|
-
from .utils import check_conflicts
|
|
8
|
+
from .utils import check_conflicts
|
|
9
9
|
|
|
10
10
|
# flake8: noqa: F401
|
|
11
11
|
# pylint: disable=import-error,line-too-long
|
|
@@ -28,7 +28,6 @@ __waldiez_initialized = False
|
|
|
28
28
|
if not __waldiez_initialized:
|
|
29
29
|
__waldiez_initialized = True
|
|
30
30
|
check_conflicts()
|
|
31
|
-
check_flaml_warnings()
|
|
32
31
|
|
|
33
32
|
__all__ = [
|
|
34
33
|
"Waldiez",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import json
|
|
9
9
|
import os
|
|
10
10
|
from pathlib import Path
|
|
11
|
-
from typing import
|
|
11
|
+
from typing import Optional
|
|
12
12
|
|
|
13
13
|
import anyio
|
|
14
14
|
import typer
|
|
@@ -16,7 +16,6 @@ from dotenv import load_dotenv
|
|
|
16
16
|
from typing_extensions import Annotated
|
|
17
17
|
|
|
18
18
|
from .exporter import WaldiezExporter
|
|
19
|
-
from .io import StructuredIOStream
|
|
20
19
|
from .logger import get_logger
|
|
21
20
|
from .models import Waldiez
|
|
22
21
|
from .runner import WaldiezRunner
|
|
@@ -97,6 +96,20 @@ def run(
|
|
|
97
96
|
"If set, running the flow will use structured io stream instead of the default 'input/print' "
|
|
98
97
|
),
|
|
99
98
|
),
|
|
99
|
+
threaded: bool = typer.Option( # noqa: B008
|
|
100
|
+
False,
|
|
101
|
+
help=(
|
|
102
|
+
"If set, the flow will be run in a separate thread. "
|
|
103
|
+
"This is useful for running flows that require user input or print output."
|
|
104
|
+
),
|
|
105
|
+
),
|
|
106
|
+
patch_io: bool = typer.Option( # noqa: B008
|
|
107
|
+
False,
|
|
108
|
+
help=(
|
|
109
|
+
"If set, the flow will patch ag2's IOStream to safe print and input methods. "
|
|
110
|
+
"This is useful for running flows that require user input or print output."
|
|
111
|
+
),
|
|
112
|
+
),
|
|
100
113
|
force: bool = typer.Option( # noqa: B008
|
|
101
114
|
False,
|
|
102
115
|
help="Override the output file if it already exists.",
|
|
@@ -106,18 +119,35 @@ def run(
|
|
|
106
119
|
os.environ["AUTOGEN_USE_DOCKER"] = "0"
|
|
107
120
|
os.environ["NEP50_DISABLE_WARNING"] = "1"
|
|
108
121
|
output_path = _get_output_path(output, force)
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
122
|
+
try:
|
|
123
|
+
runner = WaldiezRunner.load(file)
|
|
124
|
+
except FileNotFoundError as error:
|
|
125
|
+
typer.echo(f"File not found: {file}")
|
|
126
|
+
raise typer.Exit(code=1) from error
|
|
127
|
+
except json.decoder.JSONDecodeError as error:
|
|
128
|
+
typer.echo("Invalid .waldiez file. Not a valid json?")
|
|
129
|
+
raise typer.Exit(code=1) from error
|
|
130
|
+
except ValueError as error:
|
|
131
|
+
typer.echo(f"Invalid .waldiez file: {error}")
|
|
132
|
+
raise typer.Exit(code=1) from error
|
|
133
|
+
if runner.is_async:
|
|
134
|
+
anyio.run(
|
|
135
|
+
runner.a_run,
|
|
136
|
+
output_path,
|
|
137
|
+
uploads_root,
|
|
138
|
+
structured,
|
|
139
|
+
not patch_io, # skip_patch_io
|
|
140
|
+
False, # skip_mmd
|
|
141
|
+
)
|
|
142
|
+
else:
|
|
143
|
+
runner.run(
|
|
144
|
+
output_path=output_path,
|
|
145
|
+
uploads_root=uploads_root,
|
|
146
|
+
structured_io=structured,
|
|
147
|
+
threaded=threaded,
|
|
148
|
+
skip_patch_io=not patch_io,
|
|
149
|
+
skip_mmd=False,
|
|
150
|
+
)
|
|
121
151
|
|
|
122
152
|
|
|
123
153
|
@app.command()
|
|
@@ -201,42 +231,50 @@ def check(
|
|
|
201
231
|
LOG.success("Waldiez flow seems valid.")
|
|
202
232
|
|
|
203
233
|
|
|
204
|
-
def _do_run(
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
) -> None:
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
234
|
+
# def _do_run(
|
|
235
|
+
# data: dict[str, Any],
|
|
236
|
+
# structured: bool,
|
|
237
|
+
# uploads_root: Optional[Path],
|
|
238
|
+
# output_path: Optional[Path],
|
|
239
|
+
# ) -> None:
|
|
240
|
+
# """Run the Waldiez flow and get the results."""
|
|
241
|
+
# waldiez = Waldiez.from_dict(data)
|
|
242
|
+
# if structured:
|
|
243
|
+
# stream = StructuredIOStream(uploads_root=uploads_root)
|
|
244
|
+
# with StructuredIOStream.set_default(stream):
|
|
245
|
+
# runner = WaldiezRunner(waldiez)
|
|
246
|
+
# if waldiez.is_async:
|
|
247
|
+
# anyio.run(
|
|
248
|
+
# runner.a_run,
|
|
249
|
+
# output_path,
|
|
250
|
+
# uploads_root,
|
|
251
|
+
# True, # structured_io
|
|
252
|
+
# False, # skip_mmd
|
|
253
|
+
# )
|
|
254
|
+
# else:
|
|
255
|
+
# runner.run(
|
|
256
|
+
# output_path=output_path,
|
|
257
|
+
# uploads_root=uploads_root,
|
|
258
|
+
# structured_io=True,
|
|
259
|
+
# skip_mmd=False,
|
|
260
|
+
# )
|
|
261
|
+
# else:
|
|
262
|
+
# runner = WaldiezRunner(waldiez)
|
|
263
|
+
# if waldiez.is_async:
|
|
264
|
+
# anyio.run(
|
|
265
|
+
# runner.a_run,
|
|
266
|
+
# output_path,
|
|
267
|
+
# uploads_root,
|
|
268
|
+
# False, # structured_io
|
|
269
|
+
# False, # skip_mmd
|
|
270
|
+
# )
|
|
271
|
+
# else:
|
|
272
|
+
# runner.run(
|
|
273
|
+
# output_path=output_path,
|
|
274
|
+
# uploads_root=uploads_root,
|
|
275
|
+
# structured_io=False,
|
|
276
|
+
# skip_mmd=False,
|
|
277
|
+
# )
|
|
240
278
|
|
|
241
279
|
|
|
242
280
|
def _get_output_path(output: Optional[Path], force: bool) -> Optional[Path]:
|
|
@@ -11,7 +11,6 @@ to trigger the chat(s).
|
|
|
11
11
|
"""
|
|
12
12
|
|
|
13
13
|
from pathlib import Path
|
|
14
|
-
from typing import Union
|
|
15
14
|
|
|
16
15
|
import jupytext # type: ignore[import-untyped]
|
|
17
16
|
from jupytext.config import ( # type: ignore[import-untyped]
|
|
@@ -61,7 +60,10 @@ class WaldiezExporter:
|
|
|
61
60
|
|
|
62
61
|
def export(
|
|
63
62
|
self,
|
|
64
|
-
path:
|
|
63
|
+
path: str | Path,
|
|
64
|
+
structured_io: bool = False,
|
|
65
|
+
uploads_root: Path | None = None,
|
|
66
|
+
skip_patch_io: bool = True,
|
|
65
67
|
force: bool = False,
|
|
66
68
|
debug: bool = False,
|
|
67
69
|
) -> None:
|
|
@@ -69,8 +71,15 @@ class WaldiezExporter:
|
|
|
69
71
|
|
|
70
72
|
Parameters
|
|
71
73
|
----------
|
|
72
|
-
path :
|
|
74
|
+
path : str | Path
|
|
73
75
|
The path to export to.
|
|
76
|
+
structured_io : bool, (optional)
|
|
77
|
+
Whether to use structured IO instead of the default 'input/print',
|
|
78
|
+
by default False.
|
|
79
|
+
uploads_root : str | Path | None, (optional)
|
|
80
|
+
The uploads root, to get user-uploaded files, by default None.
|
|
81
|
+
skip_patch_io : bool, (optional)
|
|
82
|
+
Whether to skip patching I/O, by default True.
|
|
74
83
|
force : bool, (optional)
|
|
75
84
|
Override the output file if it already exists, by default False.
|
|
76
85
|
debug : bool, (optional)
|
|
@@ -99,23 +108,45 @@ class WaldiezExporter:
|
|
|
99
108
|
if extension == ".waldiez":
|
|
100
109
|
self.to_waldiez(path, debug=debug)
|
|
101
110
|
elif extension == ".py":
|
|
102
|
-
self.to_py(
|
|
111
|
+
self.to_py(
|
|
112
|
+
path,
|
|
113
|
+
structured_io=structured_io,
|
|
114
|
+
uploads_root=uploads_root,
|
|
115
|
+
skip_patch_io=skip_patch_io,
|
|
116
|
+
debug=debug,
|
|
117
|
+
)
|
|
103
118
|
elif extension == ".ipynb":
|
|
104
|
-
self.to_ipynb(
|
|
119
|
+
self.to_ipynb(
|
|
120
|
+
path,
|
|
121
|
+
structured_io=structured_io,
|
|
122
|
+
uploads_root=uploads_root,
|
|
123
|
+
skip_patch_io=skip_patch_io,
|
|
124
|
+
debug=debug,
|
|
125
|
+
)
|
|
105
126
|
else:
|
|
106
127
|
raise ValueError(f"Invalid extension: {extension}")
|
|
107
128
|
|
|
108
129
|
def to_ipynb(
|
|
109
130
|
self,
|
|
110
|
-
path: Path,
|
|
131
|
+
path: str | Path,
|
|
132
|
+
structured_io: bool = False,
|
|
133
|
+
uploads_root: Path | None = None,
|
|
134
|
+
skip_patch_io: bool = True,
|
|
111
135
|
debug: bool = False,
|
|
112
136
|
) -> None:
|
|
113
137
|
"""Export flow to jupyter notebook.
|
|
114
138
|
|
|
115
139
|
Parameters
|
|
116
140
|
----------
|
|
117
|
-
path : Path
|
|
141
|
+
path : str | Path
|
|
118
142
|
The path to export to.
|
|
143
|
+
structured_io : bool, optional
|
|
144
|
+
Whether to use structured IO instead of the default 'input/print',
|
|
145
|
+
by default False.
|
|
146
|
+
uploads_root : Path | None, optional
|
|
147
|
+
The uploads root, to get user-uploaded files, by default None.
|
|
148
|
+
skip_patch_io : bool, optional
|
|
149
|
+
Whether to skip patching I/O, by default True.
|
|
119
150
|
debug : bool, optional
|
|
120
151
|
Whether to enable debug mode, by default False.
|
|
121
152
|
|
|
@@ -126,10 +157,15 @@ class WaldiezExporter:
|
|
|
126
157
|
"""
|
|
127
158
|
# we first create a .py file with the content
|
|
128
159
|
# and then convert it to a notebook using jupytext
|
|
160
|
+
if not isinstance(path, Path):
|
|
161
|
+
path = Path(path)
|
|
129
162
|
exporter = create_flow_exporter(
|
|
130
163
|
waldiez=self.waldiez,
|
|
131
164
|
output_dir=path.parent,
|
|
165
|
+
uploads_root=uploads_root,
|
|
166
|
+
structured_io=structured_io,
|
|
132
167
|
for_notebook=True,
|
|
168
|
+
skip_patch_io=skip_patch_io,
|
|
133
169
|
debug=debug,
|
|
134
170
|
)
|
|
135
171
|
self.flow_extras = exporter.extras
|
|
@@ -161,13 +197,27 @@ class WaldiezExporter:
|
|
|
161
197
|
Path(ipynb_path).rename(ipynb_path.replace(".tmp.ipynb", ".ipynb"))
|
|
162
198
|
py_path.unlink(missing_ok=True)
|
|
163
199
|
|
|
164
|
-
def to_py(
|
|
200
|
+
def to_py(
|
|
201
|
+
self,
|
|
202
|
+
path: str | Path,
|
|
203
|
+
structured_io: bool = False,
|
|
204
|
+
uploads_root: Path | None = None,
|
|
205
|
+
skip_patch_io: bool = True,
|
|
206
|
+
debug: bool = False,
|
|
207
|
+
) -> None:
|
|
165
208
|
"""Export waldiez flow to a python script.
|
|
166
209
|
|
|
167
210
|
Parameters
|
|
168
211
|
----------
|
|
169
|
-
path : Path
|
|
212
|
+
path : str | Path
|
|
170
213
|
The path to export to.
|
|
214
|
+
structured_io : bool, optional
|
|
215
|
+
Whether to use structured IO instead of the default 'input/print',
|
|
216
|
+
by default False.
|
|
217
|
+
uploads_root : Path | None, optional
|
|
218
|
+
The uploads root, to get user-uploaded files, by default None.
|
|
219
|
+
skip_patch_io : bool, optional
|
|
220
|
+
Whether to skip patching I/O, by default True.
|
|
171
221
|
debug : bool, optional
|
|
172
222
|
Whether to enable debug mode, by default False.
|
|
173
223
|
|
|
@@ -176,10 +226,15 @@ class WaldiezExporter:
|
|
|
176
226
|
RuntimeError
|
|
177
227
|
If the python script could not be generated.
|
|
178
228
|
"""
|
|
229
|
+
if not isinstance(path, Path):
|
|
230
|
+
path = Path(path)
|
|
179
231
|
exporter = create_flow_exporter(
|
|
180
232
|
waldiez=self.waldiez,
|
|
181
233
|
output_dir=path.parent,
|
|
182
234
|
for_notebook=False,
|
|
235
|
+
uploads_root=uploads_root,
|
|
236
|
+
structured_io=structured_io,
|
|
237
|
+
skip_patch_io=skip_patch_io,
|
|
183
238
|
debug=debug,
|
|
184
239
|
)
|
|
185
240
|
self.flow_extras = exporter.extras
|
|
@@ -54,6 +54,8 @@ class ExporterContext:
|
|
|
54
54
|
is_async: bool = False,
|
|
55
55
|
output_directory: Optional[str] = None,
|
|
56
56
|
cache_seed: Optional[int] = None,
|
|
57
|
+
structured_io: bool = False,
|
|
58
|
+
skip_patch_io: bool = True,
|
|
57
59
|
) -> ExportConfig:
|
|
58
60
|
"""Get export config or return default.
|
|
59
61
|
|
|
@@ -75,6 +77,10 @@ class ExporterContext:
|
|
|
75
77
|
The directory where the output will be saved, by default None
|
|
76
78
|
cache_seed : Optional[int], optional
|
|
77
79
|
The seed for caching, by default None
|
|
80
|
+
structured_io : bool, optional
|
|
81
|
+
Whether to use structured I/O, by default False
|
|
82
|
+
skip_patch_io : bool, optional
|
|
83
|
+
Whether to skip patching I/O, by default True
|
|
78
84
|
|
|
79
85
|
Returns
|
|
80
86
|
-------
|
|
@@ -85,6 +91,12 @@ class ExporterContext:
|
|
|
85
91
|
"requirements": requirements or [],
|
|
86
92
|
"tags": tags or [],
|
|
87
93
|
"is_async": self.config.is_async if self.config else is_async,
|
|
94
|
+
"structured_io": (
|
|
95
|
+
self.config.structured_io if self.config else structured_io
|
|
96
|
+
),
|
|
97
|
+
"skip_patch_io": (
|
|
98
|
+
self.config.skip_patch_io if self.config else skip_patch_io
|
|
99
|
+
),
|
|
88
100
|
}
|
|
89
101
|
if output_extension is not None:
|
|
90
102
|
kwargs["output_extension"] = output_extension
|
|
@@ -7,19 +7,7 @@
|
|
|
7
7
|
from dataclasses import dataclass, field
|
|
8
8
|
from typing import Optional
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
# pyright: reportMissingImports=false
|
|
12
|
-
try:
|
|
13
|
-
from waldiez._version import __version__ as waldiez_version # type: ignore[unused-ignore, import-not-found, import-untyped] # noqa
|
|
14
|
-
except ImportError: # pragma: no cover
|
|
15
|
-
import warnings
|
|
16
|
-
|
|
17
|
-
# .gitingored (generated by hatch)
|
|
18
|
-
warnings.warn(
|
|
19
|
-
"Importing __version__ failed. Using 'dev' as version.",
|
|
20
|
-
stacklevel=2,
|
|
21
|
-
)
|
|
22
|
-
waldiez_version = "dev"
|
|
10
|
+
from waldiez.utils import get_waldiez_version
|
|
23
11
|
|
|
24
12
|
from ..result import ExportResult
|
|
25
13
|
from ..types import ExportConfig
|
|
@@ -34,7 +22,7 @@ class FlowExtras(BaseExtras):
|
|
|
34
22
|
flow_name: str = ""
|
|
35
23
|
description: str = ""
|
|
36
24
|
config: ExportConfig = field(default_factory=ExportConfig)
|
|
37
|
-
version: str =
|
|
25
|
+
version: str = field(default_factory=get_waldiez_version)
|
|
38
26
|
|
|
39
27
|
# Sub-exporter results
|
|
40
28
|
tools_result: Optional[ExportResult] = None
|
|
@@ -239,10 +239,28 @@ class ExportConfig:
|
|
|
239
239
|
|
|
240
240
|
Attributes
|
|
241
241
|
----------
|
|
242
|
+
name : str
|
|
243
|
+
The name of the export.
|
|
244
|
+
description : str
|
|
245
|
+
A brief description of the export.
|
|
246
|
+
requirements : list[str]
|
|
247
|
+
A list of requirements for the export.
|
|
248
|
+
tags : list[str]
|
|
249
|
+
A list of tags associated with the export.
|
|
250
|
+
output_directory : Optional[str | Path]
|
|
251
|
+
The directory where the exported content will be saved.
|
|
252
|
+
uploads_root : Optional[str | Path]
|
|
253
|
+
The root directory for uploads, if applicable.
|
|
254
|
+
cache_seed : Optional[int]
|
|
255
|
+
The seed for caching, if applicable.
|
|
256
|
+
structured_io : bool
|
|
257
|
+
Whether the export should use structured I/O.
|
|
242
258
|
output_extension : str
|
|
243
259
|
The file extension for the exported content.
|
|
244
260
|
is_async : bool
|
|
245
261
|
Whether the exported content should be asynchronous.
|
|
262
|
+
skip_patch_io : bool
|
|
263
|
+
Whether to skip patching I/O operations.
|
|
246
264
|
"""
|
|
247
265
|
|
|
248
266
|
name: str = "Waldiez Flow"
|
|
@@ -254,7 +272,10 @@ class ExportConfig:
|
|
|
254
272
|
output_extension: str = "py"
|
|
255
273
|
is_async: bool = False
|
|
256
274
|
output_directory: Optional[str | Path] = None
|
|
275
|
+
uploads_root: Optional[Path] = None
|
|
257
276
|
cache_seed: Optional[int] = None
|
|
277
|
+
structured_io: bool = False
|
|
278
|
+
skip_patch_io: bool = True
|
|
258
279
|
|
|
259
280
|
@property
|
|
260
281
|
def for_notebook(self) -> bool:
|
|
@@ -21,6 +21,8 @@ class FlowExporter(Exporter[FlowExtras]):
|
|
|
21
21
|
waldiez: Waldiez,
|
|
22
22
|
output_dir: Path | None,
|
|
23
23
|
for_notebook: bool,
|
|
24
|
+
structured_io: bool = False,
|
|
25
|
+
skip_patch_io: bool = True,
|
|
24
26
|
context: Optional[ExporterContext] = None,
|
|
25
27
|
**kwargs: Any,
|
|
26
28
|
) -> None:
|
|
@@ -52,6 +54,8 @@ class FlowExporter(Exporter[FlowExtras]):
|
|
|
52
54
|
is_async=waldiez.is_async,
|
|
53
55
|
output_directory=str(self.output_dir) if self.output_dir else None,
|
|
54
56
|
cache_seed=waldiez.cache_seed,
|
|
57
|
+
structured_io=structured_io,
|
|
58
|
+
skip_patch_io=skip_patch_io,
|
|
55
59
|
)
|
|
56
60
|
self._extras = self._generate_extras()
|
|
57
61
|
|