model-compose 0.3.10__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.
- {model_compose-0.3.10/src/model_compose.egg-info → model_compose-0.3.11}/PKG-INFO +7 -7
- {model_compose-0.3.10 → model_compose-0.3.11}/README.md +6 -6
- {model_compose-0.3.10 → model_compose-0.3.11}/pyproject.toml +1 -1
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/component/base.py +13 -12
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/component/component.py +9 -8
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/component/context.py +3 -3
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/component/services/http_server.py +1 -1
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/component/services/model/tasks/text_classification.py +5 -6
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/component/services/model/tasks/text_embedding.py +5 -6
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/controller/base.py +5 -5
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/controller/controller.py +2 -2
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/controller/runtime/specs.py +9 -11
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/controller/services/http_server.py +2 -2
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/controller/services/mcp_server.py +2 -2
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/controller/webui/webui.py +2 -2
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/listener/services/http_callback.py +1 -1
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/utils/renderers.py +5 -6
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/workflow/job/impl/__init__.py +2 -1
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/workflow/job/impl/delay.py +4 -4
- model_compose-0.3.11/src/mindor/core/workflow/job/impl/filter.py +13 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/workflow/job/impl/if_.py +3 -3
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/workflow/job/impl/random_router.py +3 -3
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/workflow/job/impl/switch.py +3 -3
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/workflow/schema.py +23 -23
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/workflow/workflow.py +11 -10
- model_compose-0.3.11/src/mindor/dsl/schema/action/impl/common.py +7 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/action/impl/http_client.py +1 -1
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/action/impl/http_server.py +1 -1
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/component/impl/common.py +2 -1
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/component/impl/http_client.py +7 -7
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/component/impl/http_server.py +3 -3
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/component/impl/mcp_client.py +3 -3
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/component/impl/mcp_server.py +3 -3
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/component/impl/model/impl/common.py +1 -1
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/component/impl/model/impl/image_to_text.py +3 -3
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/component/impl/model/impl/summarization.py +3 -3
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/component/impl/model/impl/text_classification.py +3 -3
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/component/impl/model/impl/text_embedding.py +3 -3
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/component/impl/model/impl/text_generation.py +3 -3
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/component/impl/model/impl/translation.py +3 -3
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/component/impl/shell.py +4 -4
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/component/impl/text_splitter.py +3 -3
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/component/impl/workflow.py +3 -3
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/compose.py +5 -5
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/job/impl/__init__.py +1 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/job/impl/common.py +2 -1
- model_compose-0.3.11/src/mindor/dsl/schema/job/impl/filter.py +8 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/job/impl/if_.py +1 -1
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/job/impl/switch.py +1 -1
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/job/impl/types.py +1 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/job/job.py +2 -1
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/listener/impl/http_callback.py +2 -2
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/workflow.py +13 -12
- {model_compose-0.3.10 → model_compose-0.3.11/src/model_compose.egg-info}/PKG-INFO +7 -7
- {model_compose-0.3.10 → model_compose-0.3.11}/src/model_compose.egg-info/SOURCES.txt +2 -0
- model_compose-0.3.10/src/mindor/dsl/schema/action/impl/common.py +0 -6
- {model_compose-0.3.10 → model_compose-0.3.11}/LICENSE +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/setup.cfg +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/cli/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/cli/compose.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/component/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/component/services/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/component/services/http_client.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/component/services/mcp_client.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/component/services/mcp_server.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/component/services/model/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/component/services/model/base.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/component/services/model/model.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/component/services/model/tasks/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/component/services/model/tasks/image_to_text.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/component/services/model/tasks/summarization.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/component/services/model/tasks/text_generation.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/component/services/model/tasks/translation.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/component/services/shell.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/component/services/text_splitter.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/component/services/workflow.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/compose/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/compose/compose.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/compose/manager.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/controller/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/controller/runner/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/controller/runner/client.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/controller/runner/http_client.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/controller/runner/mcp_client.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/controller/runner/runner.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/controller/runtime/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/controller/runtime/docker/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/controller/runtime/docker/context/Dockerfile +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/controller/runtime/docker/docker.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/controller/runtime/native/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/controller/runtime/native/native.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/controller/services/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/controller/webui/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/controller/webui/gradio.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/gateway/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/gateway/base.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/gateway/gateway.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/gateway/services/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/gateway/services/http_tunnel.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/gateway/services/ssh_tunnel.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/listener/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/listener/base.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/listener/listener.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/listener/services/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/logger/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/logger/base.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/logger/logger.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/logger/logging.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/logger/services/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/logger/services/console.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/logger/services/file.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/runtime/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/runtime/docker/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/runtime/docker/docker.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/runtime/env.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/services/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/services/async_service.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/utils/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/utils/caching.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/utils/http_client.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/utils/http_request.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/utils/http_status.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/utils/image.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/utils/mcp_client.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/utils/resolvers.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/utils/shell.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/utils/ssh_client.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/utils/streamer.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/utils/streaming.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/utils/time.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/utils/workqueue.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/workflow/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/workflow/context.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/workflow/job/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/workflow/job/base.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/workflow/job/impl/action.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/workflow/job/job.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/loader.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/action/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/action/action.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/action/impl/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/action/impl/mcp_client.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/action/impl/mcp_server.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/action/impl/model/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/action/impl/model/impl/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/action/impl/model/impl/common.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/action/impl/model/impl/image_to_text.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/action/impl/model/impl/summarization.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/action/impl/model/impl/text_classification.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/action/impl/model/impl/text_embedding.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/action/impl/model/impl/text_generation.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/action/impl/model/impl/translation.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/action/impl/model/model.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/action/impl/shell.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/action/impl/text_splitter.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/action/impl/workflow.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/component/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/component/component.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/component/impl/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/component/impl/model/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/component/impl/model/impl/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/component/impl/model/impl/types.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/component/impl/model/model.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/component/impl/types.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/controller/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/controller/controller.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/controller/impl/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/controller/impl/common.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/controller/impl/http_server.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/controller/impl/mcp_server.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/controller/impl/types.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/controller/webui/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/controller/webui/impl/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/controller/webui/impl/common.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/controller/webui/impl/dynamic.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/controller/webui/impl/gradio.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/controller/webui/impl/static.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/controller/webui/webui.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/gateway/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/gateway/gateway.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/gateway/impl/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/gateway/impl/common.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/gateway/impl/http_tunnel/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/gateway/impl/http_tunnel/http_tunnel.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/gateway/impl/http_tunnel/impl/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/gateway/impl/http_tunnel/impl/cloudflare.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/gateway/impl/http_tunnel/impl/common.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/gateway/impl/http_tunnel/impl/ngrok.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/gateway/impl/ssh_tunnel.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/gateway/impl/types.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/job/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/job/impl/action.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/job/impl/delay.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/job/impl/random_router.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/listener/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/listener/impl/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/listener/impl/common.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/listener/impl/types.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/listener/listener.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/logger/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/logger/impl/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/logger/impl/common.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/logger/impl/console.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/logger/impl/file.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/logger/impl/types.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/logger/logger.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/runtime/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/runtime/impl/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/runtime/impl/common.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/runtime/impl/docker.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/runtime/impl/native.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/runtime/impl/types.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/runtime/runtime.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/transport/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/schema/transport/ssh.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/utils/__init__.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/utils/annotation.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/dsl/utils/enum.py +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/model_compose.egg-info/dependency_links.txt +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/model_compose.egg-info/entry_points.txt +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/model_compose.egg-info/requires.txt +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/src/model_compose.egg-info/top_level.txt +0 -0
- {model_compose-0.3.10 → model_compose-0.3.11}/tests/test_cli.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: model-compose
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.11
|
|
4
4
|
Summary: model-compose: Declarative AI Model and Workflow Orchestrator
|
|
5
5
|
Author-email: Hanyeol Cho <hanyeol.cho@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -165,7 +165,7 @@ controller:
|
|
|
165
165
|
port: 8081
|
|
166
166
|
|
|
167
167
|
components:
|
|
168
|
-
chatgpt
|
|
168
|
+
- id: chatgpt
|
|
169
169
|
type: http-client
|
|
170
170
|
base_url: https://api.openai.com/v1
|
|
171
171
|
path: /chat/completions
|
|
@@ -182,10 +182,10 @@ components:
|
|
|
182
182
|
quote: ${response.choices[0].message.content}
|
|
183
183
|
|
|
184
184
|
workflows:
|
|
185
|
-
generate-quote
|
|
185
|
+
- id: generate-quote
|
|
186
186
|
default: true
|
|
187
187
|
jobs:
|
|
188
|
-
get-quote
|
|
188
|
+
- id: get-quote
|
|
189
189
|
component: chatgpt
|
|
190
190
|
```
|
|
191
191
|
|
|
@@ -302,7 +302,7 @@ controller:
|
|
|
302
302
|
base_path: /mcp
|
|
303
303
|
|
|
304
304
|
components:
|
|
305
|
-
chatgpt
|
|
305
|
+
- id: chatgpt
|
|
306
306
|
type: http-client
|
|
307
307
|
base_url: https://api.openai.com/v1
|
|
308
308
|
path: /chat/completions
|
|
@@ -319,10 +319,10 @@ components:
|
|
|
319
319
|
quote: ${response.choices[0].message.content}
|
|
320
320
|
|
|
321
321
|
workflows:
|
|
322
|
-
generate-quote
|
|
322
|
+
- id: generate-quote
|
|
323
323
|
default: true
|
|
324
324
|
jobs:
|
|
325
|
-
get-quote
|
|
325
|
+
- id: get-quote
|
|
326
326
|
component: chatgpt
|
|
327
327
|
```
|
|
328
328
|
This configuration launches the controller as an **MCP server**, which listens on port 8080 and exposes your workflows over a **JSON-RPC API**.
|
|
@@ -136,7 +136,7 @@ controller:
|
|
|
136
136
|
port: 8081
|
|
137
137
|
|
|
138
138
|
components:
|
|
139
|
-
chatgpt
|
|
139
|
+
- id: chatgpt
|
|
140
140
|
type: http-client
|
|
141
141
|
base_url: https://api.openai.com/v1
|
|
142
142
|
path: /chat/completions
|
|
@@ -153,10 +153,10 @@ components:
|
|
|
153
153
|
quote: ${response.choices[0].message.content}
|
|
154
154
|
|
|
155
155
|
workflows:
|
|
156
|
-
generate-quote
|
|
156
|
+
- id: generate-quote
|
|
157
157
|
default: true
|
|
158
158
|
jobs:
|
|
159
|
-
get-quote
|
|
159
|
+
- id: get-quote
|
|
160
160
|
component: chatgpt
|
|
161
161
|
```
|
|
162
162
|
|
|
@@ -273,7 +273,7 @@ controller:
|
|
|
273
273
|
base_path: /mcp
|
|
274
274
|
|
|
275
275
|
components:
|
|
276
|
-
chatgpt
|
|
276
|
+
- id: chatgpt
|
|
277
277
|
type: http-client
|
|
278
278
|
base_url: https://api.openai.com/v1
|
|
279
279
|
path: /chat/completions
|
|
@@ -290,10 +290,10 @@ components:
|
|
|
290
290
|
quote: ${response.choices[0].message.content}
|
|
291
291
|
|
|
292
292
|
workflows:
|
|
293
|
-
generate-quote
|
|
293
|
+
- id: generate-quote
|
|
294
294
|
default: true
|
|
295
295
|
jobs:
|
|
296
|
-
get-quote
|
|
296
|
+
- id: get-quote
|
|
297
297
|
component: chatgpt
|
|
298
298
|
```
|
|
299
299
|
This configuration launches the controller as an **MCP server**, which listens on port 8080 and exposes your workflows over a **JSON-RPC API**.
|
|
@@ -10,40 +10,41 @@ from mindor.core.utils.workqueue import WorkQueue
|
|
|
10
10
|
from .context import ComponentActionContext
|
|
11
11
|
|
|
12
12
|
class ActionResolver:
|
|
13
|
-
def __init__(self, actions:
|
|
14
|
-
self.actions = actions
|
|
13
|
+
def __init__(self, actions: List[ActionConfig]):
|
|
14
|
+
self.actions: List[ActionConfig] = actions
|
|
15
15
|
|
|
16
16
|
def resolve(self, action_id: Optional[str]) -> Tuple[str, ActionConfig]:
|
|
17
17
|
action_id = action_id or self._find_default_id(self.actions)
|
|
18
|
+
action = next((action for action in self.actions if action.id == action_id), None)
|
|
18
19
|
|
|
19
|
-
if
|
|
20
|
+
if action is None:
|
|
20
21
|
raise ValueError(f"Action not found: {action_id}")
|
|
21
22
|
|
|
22
|
-
return action_id,
|
|
23
|
+
return action_id, action
|
|
23
24
|
|
|
24
|
-
def _find_default_id(self, actions:
|
|
25
|
-
default_ids = [
|
|
25
|
+
def _find_default_id(self, actions: List[ActionConfig]) -> str:
|
|
26
|
+
default_ids = [ action.id for action in actions if action.default or action.id == "__default__" ]
|
|
26
27
|
|
|
27
28
|
if len(default_ids) > 1:
|
|
28
29
|
raise ValueError("Multiple actions have default: true")
|
|
29
30
|
|
|
30
|
-
if not default_ids
|
|
31
|
+
if not default_ids:
|
|
31
32
|
raise ValueError("No default action defined.")
|
|
32
33
|
|
|
33
|
-
return default_ids[0]
|
|
34
|
+
return default_ids[0]
|
|
34
35
|
|
|
35
36
|
class ComponentGlobalConfigs:
|
|
36
37
|
def __init__(
|
|
37
38
|
self,
|
|
38
|
-
components:
|
|
39
|
+
components: List[ComponentConfig],
|
|
39
40
|
listeners: List[ListenerConfig],
|
|
40
41
|
gateways: List[GatewayConfig],
|
|
41
|
-
workflows:
|
|
42
|
+
workflows: List[WorkflowConfig]
|
|
42
43
|
):
|
|
43
|
-
self.components:
|
|
44
|
+
self.components: List[ComponentConfig] = components
|
|
44
45
|
self.listeners: List[ListenerConfig] = listeners
|
|
45
46
|
self.gateways: List[GatewayConfig] = gateways
|
|
46
|
-
self.workflows:
|
|
47
|
+
self.workflows: List[WorkflowConfig] = workflows
|
|
47
48
|
|
|
48
49
|
class ComponentService(AsyncService):
|
|
49
50
|
def __init__(self, id: str, config: ComponentConfig, global_configs: ComponentGlobalConfigs, daemon: bool):
|
|
@@ -5,27 +5,28 @@ from .base import ComponentService, ComponentGlobalConfigs, ComponentRegistry
|
|
|
5
5
|
ComponentInstances: Dict[str, ComponentService] = {}
|
|
6
6
|
|
|
7
7
|
class ComponentResolver:
|
|
8
|
-
def __init__(self, components:
|
|
9
|
-
self.components:
|
|
8
|
+
def __init__(self, components: List[ComponentConfig]):
|
|
9
|
+
self.components: List[ComponentConfig] = components
|
|
10
10
|
|
|
11
11
|
def resolve(self, component_id: Optional[str]) -> Tuple[str, ComponentConfig]:
|
|
12
12
|
component_id = component_id or self._find_default_id(self.components)
|
|
13
|
+
component = next((component for component in self.components if component.id == component_id), None)
|
|
13
14
|
|
|
14
|
-
if
|
|
15
|
+
if component is None:
|
|
15
16
|
raise ValueError(f"Component not found: {component_id}")
|
|
16
17
|
|
|
17
|
-
return component_id,
|
|
18
|
+
return component_id, component
|
|
18
19
|
|
|
19
|
-
def _find_default_id(self, components:
|
|
20
|
-
default_ids = [
|
|
20
|
+
def _find_default_id(self, components: List[ComponentConfig]) -> str:
|
|
21
|
+
default_ids = [ component.id for component in components if component.default or component.id == "__default__" ]
|
|
21
22
|
|
|
22
23
|
if len(default_ids) > 1:
|
|
23
24
|
raise ValueError("Multiple components have default: true")
|
|
24
25
|
|
|
25
|
-
if not default_ids
|
|
26
|
+
if not default_ids:
|
|
26
27
|
raise ValueError("No default component defined.")
|
|
27
28
|
|
|
28
|
-
return default_ids[0]
|
|
29
|
+
return default_ids[0]
|
|
29
30
|
|
|
30
31
|
def create_component(id: str, config: ComponentConfig, global_configs: ComponentGlobalConfigs, daemon: bool) -> ComponentService:
|
|
31
32
|
try:
|
|
@@ -13,15 +13,15 @@ class ComponentActionContext:
|
|
|
13
13
|
def register_source(self, key: str, source: Any) -> None:
|
|
14
14
|
self.sources[key] = source
|
|
15
15
|
|
|
16
|
-
def has_reference(self, key: str, value: Any) -> bool:
|
|
17
|
-
return self.renderer.has_reference(key, value)
|
|
18
|
-
|
|
19
16
|
async def render_variable(self, value: Any, ignore_files: bool = False) -> Any:
|
|
20
17
|
return await self.renderer.render(value, ignore_files)
|
|
21
18
|
|
|
22
19
|
async def render_image(self, value: Any) -> Any:
|
|
23
20
|
return await ImageValueRenderer().render(await self.render_variable(value))
|
|
24
21
|
|
|
22
|
+
def contains_variable_reference(self, key: str, value: Any) -> bool:
|
|
23
|
+
return self.renderer.contains_reference(key, value)
|
|
24
|
+
|
|
25
25
|
async def _resolve_source(self, key: str, index: Optional[int]) -> Any:
|
|
26
26
|
if key in self.sources:
|
|
27
27
|
return self.sources[key][index] if index is not None else self.sources[key]
|
{model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/component/services/http_server.py
RENAMED
|
@@ -56,7 +56,7 @@ class HttpServerPollingCompletion(HttpServerCompletion):
|
|
|
56
56
|
|
|
57
57
|
class HttpServerCallbackCompletion(HttpServerCompletion):
|
|
58
58
|
async def run(self, context: ComponentActionContext, client: HttpClient) -> Any:
|
|
59
|
-
callback_id = await context.render_variable(self.config.wait_for)
|
|
59
|
+
callback_id = await context.render_variable(self.config.wait_for) if self.config.wait_for else "__default__"
|
|
60
60
|
future: asyncio.Future = asyncio.get_running_loop().create_future()
|
|
61
61
|
HttpCallbackListener.register_pending_future(callback_id, future)
|
|
62
62
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Any
|
|
2
2
|
from mindor.dsl.schema.component import ModelComponentConfig
|
|
3
3
|
from mindor.dsl.schema.action import ModelActionConfig, TextClassificationModelActionConfig
|
|
4
|
-
from mindor.core.utils.streamer import AsyncStreamer
|
|
5
4
|
from mindor.core.logger import logging
|
|
6
5
|
from ..base import ModelTaskService, ModelTaskType, register_model_task_service
|
|
7
6
|
from ..base import ComponentActionContext
|
|
@@ -26,7 +25,7 @@ class TextClassificationTaskAction:
|
|
|
26
25
|
stream = await context.render_variable(self.config.stream)
|
|
27
26
|
|
|
28
27
|
is_single_input: bool = True if not isinstance(text, list) else False
|
|
29
|
-
|
|
28
|
+
is_output_array_mode: bool = context.contains_variable_reference("result[]", self.config.output)
|
|
30
29
|
texts: List[str] = [ text ] if is_single_input else text
|
|
31
30
|
results = []
|
|
32
31
|
|
|
@@ -38,7 +37,7 @@ class TextClassificationTaskAction:
|
|
|
38
37
|
|
|
39
38
|
with torch.inference_mode():
|
|
40
39
|
outputs: SequenceClassifierOutput = self.model(**inputs)
|
|
41
|
-
logits = outputs.logits
|
|
40
|
+
logits = outputs.logits # shape: (batch_size, num_classes)
|
|
42
41
|
predictions = []
|
|
43
42
|
|
|
44
43
|
if return_probabilities:
|
|
@@ -54,7 +53,7 @@ class TextClassificationTaskAction:
|
|
|
54
53
|
for predicted_index in predicted_indices:
|
|
55
54
|
predictions.append(labels[predicted_index] if labels else predicted_index)
|
|
56
55
|
|
|
57
|
-
if self.config.output and
|
|
56
|
+
if self.config.output and is_output_array_mode:
|
|
58
57
|
rendered_outputs = []
|
|
59
58
|
for prediction in predictions:
|
|
60
59
|
context.register_source("result[]", prediction)
|
|
@@ -67,7 +66,7 @@ class TextClassificationTaskAction:
|
|
|
67
66
|
if stream:
|
|
68
67
|
async def _stream_generator():
|
|
69
68
|
async for predictions in _predict():
|
|
70
|
-
if not
|
|
69
|
+
if not is_output_array_mode:
|
|
71
70
|
for prediction in predictions:
|
|
72
71
|
context.register_source("result", prediction)
|
|
73
72
|
yield (await context.render_variable(self.config.output, ignore_files=True)) if self.config.output else result
|
|
@@ -80,7 +79,7 @@ class TextClassificationTaskAction:
|
|
|
80
79
|
async for predictions in _predict():
|
|
81
80
|
results.extend(predictions)
|
|
82
81
|
|
|
83
|
-
if not
|
|
82
|
+
if not is_output_array_mode:
|
|
84
83
|
result = results[0] if is_single_input else results
|
|
85
84
|
context.register_source("result", result)
|
|
86
85
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Any
|
|
2
2
|
from mindor.dsl.schema.component import ModelComponentConfig
|
|
3
3
|
from mindor.dsl.schema.action import ModelActionConfig, TextEmbeddingModelActionConfig
|
|
4
|
-
from mindor.core.utils.streamer import AsyncStreamer
|
|
5
4
|
from mindor.core.logger import logging
|
|
6
5
|
from ..base import ModelTaskService, ModelTaskType, register_model_task_service
|
|
7
6
|
from ..base import ComponentActionContext
|
|
@@ -27,7 +26,7 @@ class TextEmbeddingTaskAction:
|
|
|
27
26
|
stream = await context.render_variable(self.config.stream)
|
|
28
27
|
|
|
29
28
|
is_single_input: bool = True if not isinstance(text, list) else False
|
|
30
|
-
|
|
29
|
+
is_output_array_mode: bool = context.contains_variable_reference("result[]", self.config.output)
|
|
31
30
|
texts: List[str] = [ text ] if is_single_input else text
|
|
32
31
|
results = []
|
|
33
32
|
|
|
@@ -39,7 +38,7 @@ class TextEmbeddingTaskAction:
|
|
|
39
38
|
|
|
40
39
|
with torch.inference_mode():
|
|
41
40
|
outputs: BaseModelOutput = self.model(**inputs)
|
|
42
|
-
last_hidden_state = outputs.last_hidden_state
|
|
41
|
+
last_hidden_state = outputs.last_hidden_state # (batch_size, seq_len, hidden_size)
|
|
43
42
|
|
|
44
43
|
attention_mask = inputs.get("attention_mask", None)
|
|
45
44
|
embeddings = self._pool_hidden_state(last_hidden_state, attention_mask, pooling)
|
|
@@ -49,7 +48,7 @@ class TextEmbeddingTaskAction:
|
|
|
49
48
|
|
|
50
49
|
embeddings = embeddings.cpu().tolist()
|
|
51
50
|
|
|
52
|
-
if self.config.output and
|
|
51
|
+
if self.config.output and is_output_array_mode:
|
|
53
52
|
rendered_outputs = []
|
|
54
53
|
for embedding in embeddings:
|
|
55
54
|
context.register_source("result[]", embedding)
|
|
@@ -62,7 +61,7 @@ class TextEmbeddingTaskAction:
|
|
|
62
61
|
if stream:
|
|
63
62
|
async def _stream_generator():
|
|
64
63
|
async for embeddings in _embed():
|
|
65
|
-
if not
|
|
64
|
+
if not is_output_array_mode:
|
|
66
65
|
for embedding in embeddings:
|
|
67
66
|
context.register_source("result", embedding)
|
|
68
67
|
yield (await context.render_variable(self.config.output, ignore_files=True)) if self.config.output else result
|
|
@@ -75,7 +74,7 @@ class TextEmbeddingTaskAction:
|
|
|
75
74
|
async for embeddings in _embed():
|
|
76
75
|
results.extend(embeddings)
|
|
77
76
|
|
|
78
|
-
if not
|
|
77
|
+
if not is_output_array_mode:
|
|
79
78
|
result = results[0] if is_single_input else results
|
|
80
79
|
context.register_source("result", result)
|
|
81
80
|
|
|
@@ -42,8 +42,8 @@ class ControllerService(AsyncService):
|
|
|
42
42
|
def __init__(
|
|
43
43
|
self,
|
|
44
44
|
config: ControllerConfig,
|
|
45
|
-
workflows:
|
|
46
|
-
components:
|
|
45
|
+
workflows: List[WorkflowConfig],
|
|
46
|
+
components: List[ComponentConfig],
|
|
47
47
|
listeners: List[ListenerConfig],
|
|
48
48
|
gateways: List[GatewayConfig],
|
|
49
49
|
loggers: List[LoggerConfig],
|
|
@@ -52,8 +52,8 @@ class ControllerService(AsyncService):
|
|
|
52
52
|
super().__init__(daemon)
|
|
53
53
|
|
|
54
54
|
self.config: ControllerConfig = config
|
|
55
|
-
self.workflows:
|
|
56
|
-
self.components:
|
|
55
|
+
self.workflows: List[WorkflowConfig] = workflows
|
|
56
|
+
self.components: List[ComponentConfig] = components
|
|
57
57
|
self.listeners: List[ListenerConfig] = listeners
|
|
58
58
|
self.gateways: List[GatewayConfig] = gateways
|
|
59
59
|
self.loggers: List[LoggerConfig] = loggers
|
|
@@ -233,7 +233,7 @@ class ControllerService(AsyncService):
|
|
|
233
233
|
|
|
234
234
|
def _create_components(self) -> List[ComponentService]:
|
|
235
235
|
global_configs = self._get_component_global_configs()
|
|
236
|
-
return [ create_component(
|
|
236
|
+
return [ create_component(component.id, component, global_configs, self.daemon) for component in self.components ]
|
|
237
237
|
|
|
238
238
|
def _create_loggers(self) -> List[LoggerService]:
|
|
239
239
|
return [ create_logger(f"logger-{index}", config, self.daemon) for index, config in enumerate(self.loggers or [ self._get_default_logger_config() ]) ]
|
|
@@ -9,8 +9,8 @@ from .base import ControllerService, ControllerRegistry, TaskStatus
|
|
|
9
9
|
|
|
10
10
|
def create_controller(
|
|
11
11
|
config: ControllerConfig,
|
|
12
|
-
workflows:
|
|
13
|
-
components:
|
|
12
|
+
workflows: List[WorkflowConfig],
|
|
13
|
+
components: List[ComponentConfig],
|
|
14
14
|
listeners: List[ListenerConfig],
|
|
15
15
|
gateways: List[GatewayConfig],
|
|
16
16
|
loggers: List[LoggerConfig],
|
|
@@ -11,22 +11,21 @@ class ControllerRuntimeSpecs:
|
|
|
11
11
|
def __init__(
|
|
12
12
|
self,
|
|
13
13
|
controller: ControllerConfig,
|
|
14
|
-
components:
|
|
14
|
+
components: List[ComponentConfig],
|
|
15
15
|
listeners: List[ListenerConfig],
|
|
16
16
|
gateways: List[GatewayConfig],
|
|
17
|
-
workflows:
|
|
17
|
+
workflows: List[WorkflowConfig]
|
|
18
18
|
):
|
|
19
19
|
self.controller: ControllerConfig = controller
|
|
20
|
-
self.components:
|
|
20
|
+
self.components: List[ComponentConfig] = components
|
|
21
21
|
self.listeners: List[ListenerConfig] = listeners
|
|
22
22
|
self.gateways: List[GatewayConfig] = gateways
|
|
23
|
-
self.workflows:
|
|
23
|
+
self.workflows: List[WorkflowConfig] = workflows
|
|
24
24
|
|
|
25
25
|
def generate_native_runtime_specs(self) -> Dict[str, Any]:
|
|
26
26
|
specs: Dict[str, Any] = {}
|
|
27
27
|
|
|
28
|
-
specs["controller"] = self.controller.model_dump()
|
|
29
|
-
specs["controller"]["runtime"] = "native"
|
|
28
|
+
specs["controller"] = { **self.controller.model_dump(), "runtime": "native" }
|
|
30
29
|
|
|
31
30
|
if getattr(self.controller.webui, "server_dir", None):
|
|
32
31
|
specs["controller"]["webui"]["server_dir"] = "webui/server"
|
|
@@ -34,13 +33,12 @@ class ControllerRuntimeSpecs:
|
|
|
34
33
|
if getattr(self.controller.webui, "static_dir", None):
|
|
35
34
|
specs["controller"]["webui"]["static_dir"] = "webui/static"
|
|
36
35
|
|
|
37
|
-
specs["components"] =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
specs["components"][id]["runtime"] = "native"
|
|
36
|
+
specs["components"] = [
|
|
37
|
+
{ **component.model_dump(), "runtime": "native" } for component in self.components
|
|
38
|
+
]
|
|
41
39
|
|
|
42
40
|
specs["listeners"] = [ listener.model_dump() for listener in self.listeners ]
|
|
43
41
|
specs["gateways" ] = [ gateway.model_dump() for gateway in self.gateways ]
|
|
44
|
-
specs["workflows"] =
|
|
42
|
+
specs["workflows"] = [ workflow.model_dump() for workflow in self.workflows ]
|
|
45
43
|
|
|
46
44
|
return enum_union_to_str(specs)
|
{model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/controller/services/http_server.py
RENAMED
|
@@ -95,10 +95,10 @@ class HttpServerController(ControllerService):
|
|
|
95
95
|
def __init__(
|
|
96
96
|
self,
|
|
97
97
|
config: HttpServerControllerConfig,
|
|
98
|
-
components:
|
|
98
|
+
components: List[ComponentConfig],
|
|
99
99
|
listeners: List[ListenerConfig],
|
|
100
100
|
gateways: List[GatewayConfig],
|
|
101
|
-
workflows:
|
|
101
|
+
workflows: List[WorkflowConfig],
|
|
102
102
|
loggers: List[LoggerConfig],
|
|
103
103
|
daemon: bool
|
|
104
104
|
):
|
{model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/controller/services/mcp_server.py
RENAMED
|
@@ -133,8 +133,8 @@ class McpServerController(ControllerService):
|
|
|
133
133
|
def __init__(
|
|
134
134
|
self,
|
|
135
135
|
config: McpServerControllerConfig,
|
|
136
|
-
workflows:
|
|
137
|
-
components:
|
|
136
|
+
workflows: List[WorkflowConfig],
|
|
137
|
+
components: List[ComponentConfig],
|
|
138
138
|
listeners: List[ListenerConfig],
|
|
139
139
|
gateways: List[GatewayConfig],
|
|
140
140
|
loggers: List[LoggerConfig],
|
|
@@ -18,8 +18,8 @@ class ControllerWebUI(AsyncService):
|
|
|
18
18
|
self,
|
|
19
19
|
config: ControllerWebUIConfig,
|
|
20
20
|
controller: ControllerConfig,
|
|
21
|
-
components:
|
|
22
|
-
workflows:
|
|
21
|
+
components: List[ComponentConfig],
|
|
22
|
+
workflows: List[WorkflowConfig],
|
|
23
23
|
daemon: bool
|
|
24
24
|
):
|
|
25
25
|
super().__init__(daemon)
|
{model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/listener/services/http_callback.py
RENAMED
|
@@ -76,7 +76,7 @@ class HttpCallbackListener(ListenerService):
|
|
|
76
76
|
succeeded = await self._is_callback_succeeded(callback, context)
|
|
77
77
|
|
|
78
78
|
async for item in context.items():
|
|
79
|
-
callback_id = await item.render_variable(callback.identify_by)
|
|
79
|
+
callback_id = await item.render_variable(callback.identify_by) if callback.identify_by else "__default__"
|
|
80
80
|
future: asyncio.Future = self._get_pending_future(callback_id)
|
|
81
81
|
|
|
82
82
|
if future:
|
|
@@ -29,8 +29,8 @@ class VariableRenderer:
|
|
|
29
29
|
async def render(self, value: Any, ignore_files: bool = True) -> Any:
|
|
30
30
|
return await self._render_element(value, ignore_files)
|
|
31
31
|
|
|
32
|
-
def
|
|
33
|
-
return self.
|
|
32
|
+
def contains_reference(self, key: str, value: Any) -> bool:
|
|
33
|
+
return self._contains_reference(key, value)
|
|
34
34
|
|
|
35
35
|
async def _render_element(self, element: Any, ignore_files: bool) -> Any:
|
|
36
36
|
if isinstance(element, str):
|
|
@@ -123,19 +123,18 @@ class VariableRenderer:
|
|
|
123
123
|
|
|
124
124
|
return None
|
|
125
125
|
|
|
126
|
-
def
|
|
126
|
+
def _contains_reference(self, key: str, element: Any) -> bool:
|
|
127
127
|
if isinstance(element, str):
|
|
128
128
|
return any(key == m.group(1) for m in self.patterns["variable"].finditer(element))
|
|
129
129
|
|
|
130
130
|
if isinstance(element, dict):
|
|
131
|
-
return any([ self.
|
|
131
|
+
return any([ self._contains_reference(key, value) for value in element.values() ])
|
|
132
132
|
|
|
133
133
|
if isinstance(element, (list, tuple)):
|
|
134
|
-
return any([ self.
|
|
134
|
+
return any([ self._contains_reference(key, item) for item in element ])
|
|
135
135
|
|
|
136
136
|
return False
|
|
137
137
|
|
|
138
|
-
|
|
139
138
|
class ImageValueRenderer:
|
|
140
139
|
async def render(self, value: Any) -> Any:
|
|
141
140
|
return await self._render_element(value)
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Callable, Any
|
|
2
2
|
from mindor.dsl.schema.job import DelayJobConfig, DelayJobMode
|
|
3
|
-
from mindor.
|
|
3
|
+
from mindor.core.component import ComponentGlobalConfigs
|
|
4
4
|
from mindor.core.utils.time import parse_duration, parse_datetime, TimeTracker
|
|
5
5
|
from mindor.core.logger import logging
|
|
6
6
|
from ..base import Job, JobType, WorkflowContext, RoutingTarget, register_job
|
|
7
|
-
from datetime import datetime
|
|
7
|
+
from datetime import datetime
|
|
8
8
|
import asyncio
|
|
9
9
|
|
|
10
10
|
@register_job(JobType.DELAY)
|
|
11
11
|
class DelayJob(Job):
|
|
12
|
-
def __init__(self, id: str, config: DelayJobConfig,
|
|
13
|
-
super().__init__(id, config,
|
|
12
|
+
def __init__(self, id: str, config: DelayJobConfig, global_configs: ComponentGlobalConfigs):
|
|
13
|
+
super().__init__(id, config, global_configs)
|
|
14
14
|
|
|
15
15
|
async def run(self, context: WorkflowContext) -> Any:
|
|
16
16
|
output = await self._delay(self.config.mode, context)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Callable, Any
|
|
2
|
+
from mindor.dsl.schema.job import FilterJobConfig
|
|
3
|
+
from mindor.core.component import ComponentGlobalConfigs
|
|
4
|
+
from mindor.core.logger import logging
|
|
5
|
+
from ..base import Job, JobType, WorkflowContext, RoutingTarget, register_job
|
|
6
|
+
|
|
7
|
+
@register_job(JobType.FILTER)
|
|
8
|
+
class FilterJob(Job):
|
|
9
|
+
def __init__(self, id: str, config: FilterJobConfig, global_configs: ComponentGlobalConfigs):
|
|
10
|
+
super().__init__(id, config, global_configs)
|
|
11
|
+
|
|
12
|
+
async def run(self, context: WorkflowContext) -> Union[Any, RoutingTarget]:
|
|
13
|
+
return (await context.render_variable(self.config.output, ignore_files=True)) if self.config.output else None
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Callable, Any
|
|
2
2
|
from mindor.dsl.schema.job import IfJobConfig, IfConditionOperator
|
|
3
|
-
from mindor.
|
|
3
|
+
from mindor.core.component import ComponentGlobalConfigs
|
|
4
4
|
from mindor.core.logger import logging
|
|
5
5
|
from ..base import Job, JobType, WorkflowContext, RoutingTarget, register_job
|
|
6
6
|
import asyncio, re
|
|
7
7
|
|
|
8
8
|
@register_job(JobType.IF)
|
|
9
9
|
class IfJob(Job):
|
|
10
|
-
def __init__(self, id: str, config: IfJobConfig,
|
|
11
|
-
super().__init__(id, config,
|
|
10
|
+
def __init__(self, id: str, config: IfJobConfig, global_configs: ComponentGlobalConfigs):
|
|
11
|
+
super().__init__(id, config, global_configs)
|
|
12
12
|
|
|
13
13
|
async def run(self, context: WorkflowContext) -> Union[Any, RoutingTarget]:
|
|
14
14
|
for condition in self.config.conditions:
|
{model_compose-0.3.10 → model_compose-0.3.11}/src/mindor/core/workflow/job/impl/random_router.py
RENAMED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Callable, Any
|
|
2
2
|
from mindor.dsl.schema.job import RandomRouterJobConfig, RandomRoutingMode
|
|
3
|
-
from mindor.
|
|
3
|
+
from mindor.core.component import ComponentGlobalConfigs
|
|
4
4
|
from mindor.core.logger import logging
|
|
5
5
|
from ..base import Job, JobType, WorkflowContext, RoutingTarget, register_job
|
|
6
6
|
import random
|
|
7
7
|
|
|
8
8
|
@register_job(JobType.RANDOM_ROUTER)
|
|
9
9
|
class RandomRouterJob(Job):
|
|
10
|
-
def __init__(self, id: str, config: RandomRouterJobConfig,
|
|
11
|
-
super().__init__(id, config,
|
|
10
|
+
def __init__(self, id: str, config: RandomRouterJobConfig, global_configs: ComponentGlobalConfigs):
|
|
11
|
+
super().__init__(id, config, global_configs)
|
|
12
12
|
|
|
13
13
|
async def run(self, context: WorkflowContext) -> Union[Any, RoutingTarget]:
|
|
14
14
|
if self.config.mode == RandomRoutingMode.WEIGHTED:
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Callable, Any
|
|
2
2
|
from mindor.dsl.schema.job import SwitchJobConfig
|
|
3
|
-
from mindor.
|
|
3
|
+
from mindor.core.component import ComponentGlobalConfigs
|
|
4
4
|
from mindor.core.logger import logging
|
|
5
5
|
from ..base import Job, JobType, WorkflowContext, RoutingTarget, register_job
|
|
6
6
|
import asyncio
|
|
7
7
|
|
|
8
8
|
@register_job(JobType.SWITCH)
|
|
9
9
|
class SwitchJob(Job):
|
|
10
|
-
def __init__(self, id: str, config: SwitchJobConfig,
|
|
11
|
-
super().__init__(id, config,
|
|
10
|
+
def __init__(self, id: str, config: SwitchJobConfig, global_configs: ComponentGlobalConfigs):
|
|
11
|
+
super().__init__(id, config, global_configs)
|
|
12
12
|
|
|
13
13
|
async def run(self, context: WorkflowContext) -> Union[Any, RoutingTarget]:
|
|
14
14
|
input = (await context.render_variable(self.config.input)) if self.config.input else context.input
|