model-compose 0.3.3__tar.gz → 0.3.5__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.3/src/model_compose.egg-info → model_compose-0.3.5}/PKG-INFO +1 -1
- {model_compose-0.3.3 → model_compose-0.3.5}/pyproject.toml +1 -1
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/cli/compose.py +20 -9
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/component/base.py +6 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/component/services/__init__.py +1 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/component/services/http_client.py +6 -4
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/component/services/mcp_client.py +6 -2
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/component/services/model/base.py +6 -2
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/component/services/shell.py +0 -6
- model_compose-0.3.5/src/mindor/core/component/services/text_splitter.py +82 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/component/services/workflow.py +0 -7
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/compose/compose.py +2 -2
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/compose/manager.py +12 -3
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/controller/controller.py +1 -1
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/controller/webui/gradio.py +4 -1
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/runtime/docker/docker.py +1 -1
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/services/async_service.py +23 -1
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/action/action.py +2 -1
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/action/impl/__init__.py +1 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/action/impl/http_server.py +1 -1
- model_compose-0.3.5/src/mindor/dsl/schema/action/impl/model/impl/common.py +18 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/action/impl/model/impl/summarization.py +2 -2
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/action/impl/model/impl/text_classification.py +2 -2
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/action/impl/model/impl/text_embedding.py +2 -2
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/action/impl/model/impl/text_generation.py +2 -2
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/action/impl/model/impl/translation.py +2 -2
- model_compose-0.3.5/src/mindor/dsl/schema/action/impl/text_splitter.py +12 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/component/component.py +2 -1
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/component/impl/__init__.py +1 -0
- model_compose-0.3.5/src/mindor/dsl/schema/component/impl/text_splitter.py +17 -0
- model_compose-0.3.5/src/mindor/dsl/schema/component/impl/types.py +11 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/runtime/impl/docker.py +4 -4
- {model_compose-0.3.3 → model_compose-0.3.5/src/model_compose.egg-info}/PKG-INFO +1 -1
- {model_compose-0.3.3 → model_compose-0.3.5}/src/model_compose.egg-info/SOURCES.txt +3 -0
- model_compose-0.3.3/src/mindor/dsl/schema/action/impl/model/impl/common.py +0 -11
- model_compose-0.3.3/src/mindor/dsl/schema/component/impl/types.py +0 -10
- {model_compose-0.3.3 → model_compose-0.3.5}/LICENSE +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/README.md +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/setup.cfg +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/cli/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/component/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/component/component.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/component/context.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/component/services/http_server.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/component/services/mcp_server.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/component/services/model/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/component/services/model/model.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/component/services/model/tasks/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/component/services/model/tasks/summarization.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/component/services/model/tasks/text_classification.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/component/services/model/tasks/text_embedding.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/component/services/model/tasks/text_generation.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/component/services/model/tasks/translation.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/compose/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/controller/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/controller/base.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/controller/runner/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/controller/runner/client.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/controller/runner/http_client.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/controller/runner/mcp_client.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/controller/runner/runner.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/controller/runtime/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/controller/runtime/docker/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/controller/runtime/docker/context/Dockerfile +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/controller/runtime/docker/docker.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/controller/runtime/specs.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/controller/services/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/controller/services/http_server.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/controller/services/mcp_server.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/controller/webui/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/controller/webui/webui.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/gateway/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/gateway/base.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/gateway/gateway.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/gateway/services/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/gateway/services/http_tunnel.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/gateway/services/ssh_tunnel.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/listener/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/listener/base.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/listener/listener.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/listener/services/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/listener/services/http_callback.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/logger/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/logger/base.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/logger/logger.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/logger/logging.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/logger/services/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/logger/services/console.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/logger/services/file.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/runtime/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/runtime/docker/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/runtime/env.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/services/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/utils/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/utils/caching.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/utils/http_client.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/utils/http_request.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/utils/http_status.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/utils/image.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/utils/mcp_client.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/utils/renderers.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/utils/resolvers.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/utils/ssh_client.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/utils/streaming.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/utils/time.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/utils/workqueue.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/workflow/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/workflow/context.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/workflow/job/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/workflow/job/base.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/workflow/job/impl/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/workflow/job/impl/action.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/workflow/job/impl/delay.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/workflow/job/impl/if_.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/workflow/job/impl/random_router.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/workflow/job/impl/switch.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/workflow/job/job.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/workflow/schema.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/workflow/workflow.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/loader.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/action/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/action/impl/common.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/action/impl/http_client.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/action/impl/mcp_client.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/action/impl/mcp_server.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/action/impl/model/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/action/impl/model/impl/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/action/impl/model/model.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/action/impl/shell.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/action/impl/workflow.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/component/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/component/impl/common.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/component/impl/http_client.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/component/impl/http_server.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/component/impl/mcp_client.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/component/impl/mcp_server.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/component/impl/model/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/component/impl/model/impl/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/component/impl/model/impl/common.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/component/impl/model/impl/summarization.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/component/impl/model/impl/text_classification.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/component/impl/model/impl/text_embedding.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/component/impl/model/impl/text_generation.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/component/impl/model/impl/translation.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/component/impl/model/impl/types.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/component/impl/model/model.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/component/impl/shell.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/component/impl/workflow.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/compose.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/controller/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/controller/controller.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/controller/impl/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/controller/impl/common.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/controller/impl/http_server.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/controller/impl/mcp_server.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/controller/impl/types.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/controller/webui/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/controller/webui/impl/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/controller/webui/impl/common.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/controller/webui/impl/dynamic.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/controller/webui/impl/gradio.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/controller/webui/impl/static.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/controller/webui/webui.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/gateway/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/gateway/gateway.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/gateway/impl/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/gateway/impl/common.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/gateway/impl/http_tunnel.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/gateway/impl/ssh_tunnel.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/gateway/impl/types.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/job/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/job/impl/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/job/impl/action.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/job/impl/common.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/job/impl/delay.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/job/impl/if_.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/job/impl/random_router.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/job/impl/switch.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/job/impl/types.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/job/job.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/listener/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/listener/impl/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/listener/impl/common.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/listener/impl/http_callback.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/listener/impl/types.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/listener/listener.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/logger/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/logger/impl/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/logger/impl/common.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/logger/impl/console.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/logger/impl/file.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/logger/impl/types.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/logger/logger.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/runtime/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/runtime/impl/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/runtime/impl/common.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/runtime/impl/native.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/runtime/impl/types.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/runtime/runtime.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/workflow.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/utils/__init__.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/utils/annotation.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/utils/enum.py +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/model_compose.egg-info/dependency_links.txt +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/model_compose.egg-info/entry_points.txt +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/model_compose.egg-info/requires.txt +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/src/model_compose.egg-info/top_level.txt +0 -0
- {model_compose-0.3.3 → model_compose-0.3.5}/tests/test_cli.py +0 -0
|
@@ -15,7 +15,7 @@ from mindor.core.compose import *
|
|
|
15
15
|
)
|
|
16
16
|
@click.pass_context
|
|
17
17
|
def compose_command(ctx: click.Context, config_files: List[Path]) -> None:
|
|
18
|
-
"""model-compose
|
|
18
|
+
"""model-compose"""
|
|
19
19
|
ctx.ensure_object(dict)
|
|
20
20
|
ctx.obj["config_files"] = list(config_files)
|
|
21
21
|
|
|
@@ -138,7 +138,7 @@ def stop_command(
|
|
|
138
138
|
asyncio.run(_async_command())
|
|
139
139
|
|
|
140
140
|
@click.command(name="run")
|
|
141
|
-
@click.argument("
|
|
141
|
+
@click.argument("workflow_id", required=False)
|
|
142
142
|
@click.option(
|
|
143
143
|
"--input", "-i", "input_json",
|
|
144
144
|
type=str,
|
|
@@ -155,14 +155,21 @@ def stop_command(
|
|
|
155
155
|
"--env", "-e", "env_data", multiple=True,
|
|
156
156
|
help="Environment variable in the form KEY=VALUE. Repeatable."
|
|
157
157
|
)
|
|
158
|
+
@click.option(
|
|
159
|
+
"--output", "-o", "output_path",
|
|
160
|
+
type=click.Path(dir_okay=False, writable=True, path_type=Path),
|
|
161
|
+
required=False,
|
|
162
|
+
help="Path to save the output result as a file."
|
|
163
|
+
)
|
|
158
164
|
@click.option("--verbose", "-v", is_flag=True, help="Enable verbose output.")
|
|
159
165
|
@click.pass_context
|
|
160
166
|
def run_command(
|
|
161
167
|
ctx: click.Context,
|
|
162
|
-
|
|
168
|
+
workflow_id: Optional[str],
|
|
163
169
|
input_json: Optional[str],
|
|
164
170
|
env_files: List[Path],
|
|
165
171
|
env_data: List[str],
|
|
172
|
+
output_path: Optional[Path],
|
|
166
173
|
verbose: bool
|
|
167
174
|
) -> None:
|
|
168
175
|
config_files = ctx.obj.get("config_files", [])
|
|
@@ -171,12 +178,16 @@ def run_command(
|
|
|
171
178
|
env = load_env_files(".", env_files or [])
|
|
172
179
|
config = load_compose_config(".", config_files, env)
|
|
173
180
|
input = json.loads(input_json) if input_json else {}
|
|
174
|
-
state = await run_workflow(config,
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
181
|
+
state = await run_workflow(config, workflow_id, input, output_path, verbose)
|
|
182
|
+
if isinstance(state.output, (dict, list)) or state.error:
|
|
183
|
+
click.echo(json.dumps(
|
|
184
|
+
state.output or state.error,
|
|
185
|
+
indent=2,
|
|
186
|
+
ensure_ascii=False
|
|
187
|
+
))
|
|
188
|
+
else:
|
|
189
|
+
if state.output is not None:
|
|
190
|
+
click.echo(state.output)
|
|
180
191
|
except json.JSONDecodeError:
|
|
181
192
|
click.echo("❌ Invalid JSON provided for --input", err=True)
|
|
182
193
|
except Exception as e:
|
|
@@ -78,6 +78,12 @@ class ComponentService(AsyncService):
|
|
|
78
78
|
|
|
79
79
|
await super()._stop()
|
|
80
80
|
|
|
81
|
+
async def _serve(self) -> None:
|
|
82
|
+
pass
|
|
83
|
+
|
|
84
|
+
async def _shutdown(self) -> None:
|
|
85
|
+
pass
|
|
86
|
+
|
|
81
87
|
@abstractmethod
|
|
82
88
|
async def _run(self, action: ActionConfig, context: ComponentActionContext) -> Any:
|
|
83
89
|
pass
|
{model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/component/services/http_client.py
RENAMED
|
@@ -62,7 +62,7 @@ class HttpClientPollingCompletion(HttpClientCompletion):
|
|
|
62
62
|
class HttpClientCallbackCompletion(HttpClientCompletion):
|
|
63
63
|
async def run(self, context: ComponentActionContext, client: HttpClient) -> Any:
|
|
64
64
|
callback_id = await context.render_variable(self.config.wait_for)
|
|
65
|
-
future: asyncio.Future = asyncio.
|
|
65
|
+
future: asyncio.Future = asyncio.get_running_loop().create_future()
|
|
66
66
|
HttpCallbackListener.register_pending_future(callback_id, future)
|
|
67
67
|
|
|
68
68
|
return await future
|
|
@@ -113,12 +113,14 @@ class HttpClientComponent(ComponentService):
|
|
|
113
113
|
def __init__(self, id: str, config: HttpClientComponentConfig, global_configs: ComponentGlobalConfigs, daemon: bool):
|
|
114
114
|
super().__init__(id, config, global_configs, daemon)
|
|
115
115
|
|
|
116
|
-
self.client: HttpClient = None
|
|
116
|
+
self.client: Optional[HttpClient] = None
|
|
117
117
|
|
|
118
|
-
async def
|
|
118
|
+
async def _start(self) -> None:
|
|
119
119
|
self.client = HttpClient(self.config.base_url, self.config.headers)
|
|
120
|
+
await super()._start()
|
|
120
121
|
|
|
121
|
-
async def
|
|
122
|
+
async def _stop(self) -> None:
|
|
123
|
+
await super()._stop()
|
|
122
124
|
await self.client.close()
|
|
123
125
|
self.client = None
|
|
124
126
|
|
{model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/component/services/mcp_client.py
RENAMED
|
@@ -32,10 +32,14 @@ class McpClientComponent(ComponentService):
|
|
|
32
32
|
def __init__(self, id: str, config: McpClientComponentConfig, global_configs: ComponentGlobalConfigs, daemon: bool):
|
|
33
33
|
super().__init__(id, config, global_configs, daemon)
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
self.client: Optional[McpClient] = None
|
|
36
|
+
|
|
37
|
+
async def _start(self) -> None:
|
|
36
38
|
self.client = McpClient(self.config.url, self.config.headers)
|
|
39
|
+
await super()._start()
|
|
37
40
|
|
|
38
|
-
async def
|
|
41
|
+
async def _stop(self) -> None:
|
|
42
|
+
await super()._stop()
|
|
39
43
|
await self.client.close()
|
|
40
44
|
self.client = None
|
|
41
45
|
|
{model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/core/component/services/model/base.py
RENAMED
|
@@ -5,7 +5,8 @@ from mindor.dsl.schema.action import ModelActionConfig
|
|
|
5
5
|
from mindor.core.services import AsyncService
|
|
6
6
|
from ...context import ComponentActionContext
|
|
7
7
|
from transformers import PreTrainedModel, PreTrainedTokenizer
|
|
8
|
-
import
|
|
8
|
+
from threading import Thread
|
|
9
|
+
import torch, asyncio
|
|
9
10
|
|
|
10
11
|
class ModelTaskService(AsyncService):
|
|
11
12
|
def __init__(self, id: str, config: ModelComponentConfig, daemon: bool):
|
|
@@ -15,7 +16,10 @@ class ModelTaskService(AsyncService):
|
|
|
15
16
|
self.config: ModelComponentConfig = config
|
|
16
17
|
|
|
17
18
|
async def run(self, action: ModelActionConfig, context: ComponentActionContext) -> Any:
|
|
18
|
-
|
|
19
|
+
async def _run():
|
|
20
|
+
return await self._run(action, context)
|
|
21
|
+
|
|
22
|
+
return await self.run_in_thread(_run)
|
|
19
23
|
|
|
20
24
|
@abstractmethod
|
|
21
25
|
async def _run(self, action: ModelActionConfig, context: ComponentActionContext) -> Any:
|
|
@@ -69,11 +69,5 @@ class ShellComponent(ComponentService):
|
|
|
69
69
|
def __init__(self, id: str, config: ShellComponentConfig, global_configs: ComponentGlobalConfigs, daemon: bool):
|
|
70
70
|
super().__init__(id, config, global_configs, daemon)
|
|
71
71
|
|
|
72
|
-
async def _serve(self) -> None:
|
|
73
|
-
pass
|
|
74
|
-
|
|
75
|
-
async def _shutdown(self) -> None:
|
|
76
|
-
pass
|
|
77
|
-
|
|
78
72
|
async def _run(self, action: ActionConfig, context: ComponentActionContext) -> Any:
|
|
79
73
|
return await ShellAction(action, self.config.base_dir, self.config.env).run(context)
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Any
|
|
2
|
+
from mindor.dsl.schema.component import TextSplitterComponentConfig
|
|
3
|
+
from mindor.dsl.schema.action import ActionConfig, TextSplitterActionConfig
|
|
4
|
+
from ..base import ComponentService, ComponentType, ComponentGlobalConfigs, register_component
|
|
5
|
+
from ..context import ComponentActionContext
|
|
6
|
+
|
|
7
|
+
class TextSplitterAction:
|
|
8
|
+
def __init__(self, config: TextSplitterActionConfig):
|
|
9
|
+
self.config: TextSplitterActionConfig = config
|
|
10
|
+
|
|
11
|
+
async def run(self, context: ComponentActionContext) -> Any:
|
|
12
|
+
text = await context.render_variable(self.config.text)
|
|
13
|
+
separators = await context.render_variable(self.config.separators)
|
|
14
|
+
chunk_size = await context.render_variable(self.config.chunk_size)
|
|
15
|
+
chunk_overlap = await context.render_variable(self.config.chunk_overlap)
|
|
16
|
+
maximize_chunk = await context.render_variable(self.config.maximize_chunk)
|
|
17
|
+
stream = await context.render_variable(self.config.stream)
|
|
18
|
+
|
|
19
|
+
chunks = self._recursive_split(text, separators or [ "\n\n", "\n", " ", "" ], chunk_size, maximize_chunk)
|
|
20
|
+
|
|
21
|
+
if chunk_overlap > 0 and len(chunks) > 1:
|
|
22
|
+
return self._overlap_chunks(chunks, chunk_overlap)
|
|
23
|
+
|
|
24
|
+
return chunks
|
|
25
|
+
|
|
26
|
+
def _recursive_split(self, text: str, separators: List[str], chunk_size: int, maximize_chunk: bool) -> List[str]:
|
|
27
|
+
if len(text) <= chunk_size:
|
|
28
|
+
return [ text ]
|
|
29
|
+
|
|
30
|
+
separator = separators[0] if separators else ""
|
|
31
|
+
if separator == "":
|
|
32
|
+
return self._character_split(text, chunk_size)
|
|
33
|
+
|
|
34
|
+
chunks, current = [], ""
|
|
35
|
+
for part in text.split(separator):
|
|
36
|
+
candidate = current + separator + part if current else part
|
|
37
|
+
|
|
38
|
+
if len(candidate) > chunk_size:
|
|
39
|
+
if current:
|
|
40
|
+
chunks.append(current)
|
|
41
|
+
current = part
|
|
42
|
+
else:
|
|
43
|
+
if len(separators) > 1:
|
|
44
|
+
sub_chunks = self._recursive_split(part, separators[1:], chunk_size, maximize_chunk)
|
|
45
|
+
else:
|
|
46
|
+
sub_chunks = self._character_split(part, chunk_size)
|
|
47
|
+
chunks.extend(sub_chunks)
|
|
48
|
+
current = ""
|
|
49
|
+
else:
|
|
50
|
+
if maximize_chunk:
|
|
51
|
+
current = candidate
|
|
52
|
+
else:
|
|
53
|
+
if current:
|
|
54
|
+
chunks.append(current)
|
|
55
|
+
current = part
|
|
56
|
+
|
|
57
|
+
if current:
|
|
58
|
+
chunks.append(current)
|
|
59
|
+
|
|
60
|
+
return chunks
|
|
61
|
+
|
|
62
|
+
def _character_split(self, text: str, chunk_size: int) -> List[str]:
|
|
63
|
+
return [ text[i:i + chunk_size] for i in range(0, len(text), chunk_size) ]
|
|
64
|
+
|
|
65
|
+
def _overlap_chunks(self, chunks: List[str], chunk_overlap: int) -> List[str]:
|
|
66
|
+
overlapped = [ chunks[0] ]
|
|
67
|
+
|
|
68
|
+
for i in range(1, len(chunks)):
|
|
69
|
+
prev = chunks[i - 1]
|
|
70
|
+
current = chunks[i]
|
|
71
|
+
overlap = prev[-chunk_overlap:] if len(prev) >= chunk_overlap else prev
|
|
72
|
+
overlapped.append(overlap + current)
|
|
73
|
+
|
|
74
|
+
return overlapped
|
|
75
|
+
|
|
76
|
+
@register_component(ComponentType.TEXT_SPLITTER)
|
|
77
|
+
class TextSplitterComponent(ComponentService):
|
|
78
|
+
def __init__(self, id: str, config: TextSplitterComponentConfig, global_configs: ComponentGlobalConfigs, daemon: bool):
|
|
79
|
+
super().__init__(id, config, global_configs, daemon)
|
|
80
|
+
|
|
81
|
+
async def _run(self, action: ActionConfig, context: ComponentActionContext) -> Any:
|
|
82
|
+
return await TextSplitterAction(action).run(context)
|
|
@@ -5,7 +5,6 @@ from mindor.dsl.schema.workflow import WorkflowConfig
|
|
|
5
5
|
from mindor.core.workflow import Workflow, WorkflowResolver, create_workflow
|
|
6
6
|
from ..base import ComponentService, ComponentType, ComponentGlobalConfigs, register_component
|
|
7
7
|
from ..context import ComponentActionContext
|
|
8
|
-
import asyncio, os
|
|
9
8
|
|
|
10
9
|
class WorkflowAction:
|
|
11
10
|
def __init__(self, config: WorkflowActionConfig, global_configs: ComponentGlobalConfigs):
|
|
@@ -30,11 +29,5 @@ class WorkflowComponent(ComponentService):
|
|
|
30
29
|
def __init__(self, id: str, config: WorkflowComponentConfig, global_configs: ComponentGlobalConfigs, daemon: bool):
|
|
31
30
|
super().__init__(id, config, global_configs, daemon)
|
|
32
31
|
|
|
33
|
-
async def _serve(self) -> None:
|
|
34
|
-
pass
|
|
35
|
-
|
|
36
|
-
async def _shutdown(self) -> None:
|
|
37
|
-
pass
|
|
38
|
-
|
|
39
32
|
async def _run(self, action: ActionConfig, context: ComponentActionContext) -> Any:
|
|
40
33
|
return await WorkflowAction(action, self.global_configs).run(context)
|
|
@@ -14,5 +14,5 @@ async def start_services(config: ComposeConfig, verbose: bool):
|
|
|
14
14
|
async def stop_services(config: ComposeConfig, verbose: bool):
|
|
15
15
|
await ComposeManager(config, daemon=False).stop_services(verbose)
|
|
16
16
|
|
|
17
|
-
async def run_workflow(config: ComposeConfig, workflow_id: Optional[str], input: Dict[str, Any], verbose: bool) -> TaskState:
|
|
18
|
-
return await ComposeManager(config, daemon=False).run_workflow(workflow_id, input, verbose)
|
|
17
|
+
async def run_workflow(config: ComposeConfig, workflow_id: Optional[str], input: Dict[str, Any], output_path: Optional[str], verbose: bool) -> TaskState:
|
|
18
|
+
return await ComposeManager(config, daemon=False).run_workflow(workflow_id, input, output_path, verbose)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Any
|
|
2
2
|
from mindor.dsl.schema.compose import ComposeConfig
|
|
3
|
-
from mindor.core.controller import ControllerService, TaskState, create_controller
|
|
3
|
+
from mindor.core.controller import ControllerService, TaskState, TaskStatus, create_controller
|
|
4
4
|
|
|
5
5
|
class ComposeManager:
|
|
6
6
|
def __init__(self, config: ComposeConfig, daemon: bool):
|
|
@@ -27,8 +27,17 @@ class ComposeManager:
|
|
|
27
27
|
async def stop_services(self, verbose: bool):
|
|
28
28
|
await self.controller.stop()
|
|
29
29
|
|
|
30
|
-
async def run_workflow(self, workflow_id: Optional[str], input: Dict[str, Any], verbose: bool) -> TaskState:
|
|
30
|
+
async def run_workflow(self, workflow_id: Optional[str], input: Dict[str, Any], output_path: Optional[str], verbose: bool) -> TaskState:
|
|
31
31
|
if not self.controller.started:
|
|
32
32
|
await self.controller.start()
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
state = await self.controller.run_workflow(workflow_id, input)
|
|
35
|
+
|
|
36
|
+
if output_path and state.status == TaskStatus.COMPLETED:
|
|
37
|
+
await self._save_output(state.output, output_path)
|
|
38
|
+
state.output = None
|
|
39
|
+
|
|
40
|
+
return state
|
|
41
|
+
|
|
42
|
+
async def _save_output(self, output: Any, path: str) -> None:
|
|
43
|
+
pass
|
|
@@ -5,7 +5,7 @@ from mindor.dsl.schema.listener import ListenerConfig
|
|
|
5
5
|
from mindor.dsl.schema.gateway import GatewayConfig
|
|
6
6
|
from mindor.dsl.schema.workflow import WorkflowConfig
|
|
7
7
|
from mindor.dsl.schema.logger import LoggerConfig
|
|
8
|
-
from .base import ControllerService, ControllerRegistry
|
|
8
|
+
from .base import ControllerService, ControllerRegistry, TaskStatus
|
|
9
9
|
|
|
10
10
|
def create_controller(
|
|
11
11
|
config: ControllerConfig,
|
|
@@ -211,7 +211,10 @@ class GradioWebUIBuilder:
|
|
|
211
211
|
if isinstance(value, (dict, list)):
|
|
212
212
|
return json.dumps(value)
|
|
213
213
|
|
|
214
|
-
|
|
214
|
+
if value is not None:
|
|
215
|
+
return str(value)
|
|
216
|
+
|
|
217
|
+
return None
|
|
215
218
|
|
|
216
219
|
async def _resolve_json_field_from_value(self, value: Any, subtype: Optional[str], format: Optional[WorkflowVariableFormat]) -> Optional[Any]:
|
|
217
220
|
try:
|
|
@@ -246,7 +246,7 @@ class DockerRuntimeManager:
|
|
|
246
246
|
for line in container.logs(stream=True, follow=True, since=int(time.time())):
|
|
247
247
|
sys.stdout.buffer.write(line)
|
|
248
248
|
sys.stdout.flush()
|
|
249
|
-
loop = asyncio.
|
|
249
|
+
loop = asyncio.get_running_loop()
|
|
250
250
|
await loop.run_in_executor(None, _stream_logs_sync, container)
|
|
251
251
|
except Exception as e:
|
|
252
252
|
logging.error("Error while streaming logs from container '%s': %s", container.name, e)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Optional
|
|
1
|
+
from typing import Optional, Callable, Awaitable, Any
|
|
2
2
|
from abc import ABC, abstractmethod
|
|
3
3
|
from threading import Thread
|
|
4
4
|
import asyncio
|
|
@@ -42,6 +42,28 @@ class AsyncService(ABC):
|
|
|
42
42
|
if self.daemon_task:
|
|
43
43
|
await self.daemon_task
|
|
44
44
|
|
|
45
|
+
def run_in_thread(self, runner: Callable[[], Awaitable[Any]]) -> asyncio.Future:
|
|
46
|
+
loop = asyncio.get_running_loop()
|
|
47
|
+
future: asyncio.Future = loop.create_future()
|
|
48
|
+
|
|
49
|
+
def _start_in_thread():
|
|
50
|
+
thread_loop = asyncio.new_event_loop()
|
|
51
|
+
asyncio.set_event_loop(thread_loop)
|
|
52
|
+
|
|
53
|
+
async def _run_and_set_result():
|
|
54
|
+
try:
|
|
55
|
+
result = await runner()
|
|
56
|
+
loop.call_soon_threadsafe(future.set_result, result)
|
|
57
|
+
except Exception as e:
|
|
58
|
+
loop.call_soon_threadsafe(future.set_exception, e)
|
|
59
|
+
|
|
60
|
+
thread_loop.run_until_complete(_run_and_set_result())
|
|
61
|
+
|
|
62
|
+
thread = Thread(target=_start_in_thread)
|
|
63
|
+
thread.start()
|
|
64
|
+
|
|
65
|
+
return future
|
|
66
|
+
|
|
45
67
|
async def _start(self) -> None:
|
|
46
68
|
self.started = True
|
|
47
69
|
|
{model_compose-0.3.3 → model_compose-0.3.5}/src/mindor/dsl/schema/action/impl/http_server.py
RENAMED
|
@@ -5,4 +5,4 @@ from .common import CommonActionConfig
|
|
|
5
5
|
|
|
6
6
|
class HttpServerActionConfig(CommonActionConfig):
|
|
7
7
|
path: Optional[str] = Field(default=None)
|
|
8
|
-
method: Literal["GET", "POST", "PUT", "DELETE", "PATCH"] = Field(default="POST")
|
|
8
|
+
method: Literal[ "GET", "POST", "PUT", "DELETE", "PATCH" ] = Field(default="POST")
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Any
|
|
2
|
+
from enum import Enum
|
|
3
|
+
from pydantic import BaseModel, Field
|
|
4
|
+
from ...common import CommonActionConfig
|
|
5
|
+
|
|
6
|
+
class ModelTaskMode(str, Enum):
|
|
7
|
+
INFERENCE = "inference"
|
|
8
|
+
TRAINING = "training"
|
|
9
|
+
|
|
10
|
+
class CommonModelActionConfig(CommonActionConfig):
|
|
11
|
+
mode: ModelTaskMode = Field(..., description="Mode for model task execution.")
|
|
12
|
+
|
|
13
|
+
class CommonModelInferenceActionConfig(CommonModelActionConfig):
|
|
14
|
+
mode: ModelTaskMode = Literal[ModelTaskMode.INFERENCE]
|
|
15
|
+
stream: bool = Field(default=False, description="Whether to enable streaming responses for inference.")
|
|
16
|
+
|
|
17
|
+
class CommonModelTrainingActionConfig(CommonModelActionConfig):
|
|
18
|
+
mode: ModelTaskMode = Literal[ModelTaskMode.TRAINING]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Any
|
|
2
2
|
from pydantic import BaseModel, Field
|
|
3
3
|
from pydantic import model_validator
|
|
4
|
-
from .common import
|
|
4
|
+
from .common import CommonModelInferenceActionConfig
|
|
5
5
|
|
|
6
6
|
class SummarizationParamsConfig(BaseModel):
|
|
7
7
|
max_input_length: Union[int, str] = Field(default=1024, description="Maximum number of tokens per input text.")
|
|
@@ -13,6 +13,6 @@ class SummarizationParamsConfig(BaseModel):
|
|
|
13
13
|
do_sample: bool = Field(default=True, description="Whether to use sampling.")
|
|
14
14
|
batch_size: Union[int, str] = Field(default=32, description="Number of input texts to process in a single batch.")
|
|
15
15
|
|
|
16
|
-
class SummarizationModelActionConfig(
|
|
16
|
+
class SummarizationModelActionConfig(CommonModelInferenceActionConfig):
|
|
17
17
|
text: Union[str, List[str]] = Field(..., description="Input text to summarize.")
|
|
18
18
|
params: SummarizationParamsConfig = Field(default_factory=SummarizationParamsConfig, description="Summarization configuration parameters.")
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Any
|
|
2
2
|
from pydantic import BaseModel, Field
|
|
3
3
|
from pydantic import model_validator
|
|
4
|
-
from .common import
|
|
4
|
+
from .common import CommonModelInferenceActionConfig
|
|
5
5
|
|
|
6
6
|
class TextClassificationParamsConfig(BaseModel):
|
|
7
7
|
return_probabilities: Union[bool, str] = Field(default=False, description="Whether to return class probabilities for each prediction.")
|
|
8
8
|
batch_size: Union[int, str] = Field(default=32, description="Number of input texts to process in a single batch.")
|
|
9
9
|
|
|
10
|
-
class TextClassificationModelActionConfig(
|
|
10
|
+
class TextClassificationModelActionConfig(CommonModelInferenceActionConfig):
|
|
11
11
|
text: Union[str, List[str]] = Field(..., description="Input text to classify.")
|
|
12
12
|
params: TextClassificationParamsConfig = Field(default_factory=TextClassificationParamsConfig, description="Text classification configuration parameters.")
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Any
|
|
2
2
|
from pydantic import BaseModel, Field
|
|
3
3
|
from pydantic import model_validator
|
|
4
|
-
from .common import
|
|
4
|
+
from .common import CommonModelInferenceActionConfig
|
|
5
5
|
|
|
6
6
|
class TextEmbeddingParamsConfig(BaseModel):
|
|
7
7
|
max_input_length: Union[int, str] = Field(default=512, description="Maximum number of tokens per input text.")
|
|
@@ -9,6 +9,6 @@ class TextEmbeddingParamsConfig(BaseModel):
|
|
|
9
9
|
normalize: Union[bool, str] = Field(default=True, description="Whether to apply L2 normalization to the output embeddings.")
|
|
10
10
|
batch_size: Union[int, str] = Field(default=32, description="Number of input texts to process in a single batch.")
|
|
11
11
|
|
|
12
|
-
class TextEmbeddingModelActionConfig(
|
|
12
|
+
class TextEmbeddingModelActionConfig(CommonModelInferenceActionConfig):
|
|
13
13
|
text: Union[str, List[str]] = Field(..., description="Input text to be embedded.")
|
|
14
14
|
params: TextEmbeddingParamsConfig = Field(default_factory=TextEmbeddingParamsConfig, description="Configuration parameters for embedding generation.")
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Any
|
|
2
2
|
from pydantic import BaseModel, Field
|
|
3
3
|
from pydantic import model_validator
|
|
4
|
-
from .common import
|
|
4
|
+
from .common import CommonModelInferenceActionConfig
|
|
5
5
|
|
|
6
6
|
class TextGenerationParamsConfig(BaseModel):
|
|
7
7
|
max_output_length: Union[int, str] = Field(default=1024, description="The maximum number of tokens to generate.")
|
|
@@ -11,6 +11,6 @@ class TextGenerationParamsConfig(BaseModel):
|
|
|
11
11
|
top_p: Union[int, str] = Field(default=0.9, description="Top-p (nucleus) sampling; restricts sampling to tokens with cumulative probability >= top_p.")
|
|
12
12
|
batch_size: Union[int, str] = Field(default=32, description="Number of input texts to process in a single batch.")
|
|
13
13
|
|
|
14
|
-
class TextGenerationModelActionConfig(
|
|
14
|
+
class TextGenerationModelActionConfig(CommonModelInferenceActionConfig):
|
|
15
15
|
prompt: Union[str, List[str]] = Field(..., description="Input prompt to generate text from.")
|
|
16
16
|
params: TextGenerationParamsConfig = Field(default_factory=TextGenerationParamsConfig, description="Text generation configuration parameters.")
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Any
|
|
2
2
|
from pydantic import BaseModel, Field
|
|
3
3
|
from pydantic import model_validator
|
|
4
|
-
from .common import
|
|
4
|
+
from .common import CommonModelInferenceActionConfig
|
|
5
5
|
|
|
6
6
|
class TranslationParamsConfig(BaseModel):
|
|
7
7
|
max_input_length: Union[int, str] = Field(default=1024, description="Maximum number of tokens per input text.")
|
|
@@ -11,6 +11,6 @@ class TranslationParamsConfig(BaseModel):
|
|
|
11
11
|
length_penalty: Union[float, str] = Field(default=1.0, description="Length penalty applied during beam search.")
|
|
12
12
|
batch_size: Union[int, str] = Field(default=32, description="Number of input texts to process in a single batch.")
|
|
13
13
|
|
|
14
|
-
class TranslationModelActionConfig(
|
|
14
|
+
class TranslationModelActionConfig(CommonModelInferenceActionConfig):
|
|
15
15
|
text: Union[str, List[str]] = Field(..., description="Input text to translate.")
|
|
16
16
|
params: TranslationParamsConfig = Field(default_factory=TranslationParamsConfig, description="Translation configuration parameters.")
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Any
|
|
2
|
+
from pydantic import BaseModel, Field
|
|
3
|
+
from pydantic import model_validator
|
|
4
|
+
from .common import CommonActionConfig
|
|
5
|
+
|
|
6
|
+
class TextSplitterActionConfig(CommonActionConfig):
|
|
7
|
+
text: str = Field(..., description="Input text to be split.")
|
|
8
|
+
separators: Optional[List[str]] = Field(default=None, description="Separators used for splitting.")
|
|
9
|
+
chunk_size: Union[int, str] = Field(default=1000, description="Maximum number of characters per chunk.")
|
|
10
|
+
chunk_overlap: Union[int, str] = Field(default=200, description="Number of overlapping characters between chunks.")
|
|
11
|
+
maximize_chunk: Union[bool, str] = Field(default=True, description="Whether to combine parts to fill each chunk as close to the maximum size as possible.")
|
|
12
|
+
stream: Union[bool, str] = Field(default=False, description="Whether to stream the output chunks one by one instead of returning the full list.")
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Any
|
|
2
|
+
from pydantic import BaseModel, Field
|
|
3
|
+
from pydantic import model_validator
|
|
4
|
+
from mindor.dsl.schema.action import TextSplitterActionConfig
|
|
5
|
+
from .common import ComponentType, CommonComponentConfig
|
|
6
|
+
|
|
7
|
+
class TextSplitterComponentConfig(CommonComponentConfig):
|
|
8
|
+
type: Literal[ComponentType.TEXT_SPLITTER]
|
|
9
|
+
actions: Optional[Dict[str, TextSplitterActionConfig]] = Field(default_factory=dict, description="Text split actions mapped by an identifier.")
|
|
10
|
+
|
|
11
|
+
@model_validator(mode="before")
|
|
12
|
+
def inflate_single_action(cls, values: Dict[str, Any]):
|
|
13
|
+
if "actions" not in values:
|
|
14
|
+
action_keys = set(TextSplitterActionConfig.model_fields.keys())
|
|
15
|
+
if any(k in values for k in action_keys):
|
|
16
|
+
values["actions"] = { "__default__": { k: values.pop(k) for k in action_keys if k in values } }
|
|
17
|
+
return values
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
|
|
3
|
+
class ComponentType(str, Enum):
|
|
4
|
+
HTTP_SERVER = "http-server"
|
|
5
|
+
HTTP_CLIENT = "http-client"
|
|
6
|
+
MCP_SERVER = "mcp-server"
|
|
7
|
+
MCP_CLIENT = "mcp-client"
|
|
8
|
+
MODEL = "model"
|
|
9
|
+
WORKFLOW = "workflow"
|
|
10
|
+
SHELL = "shell"
|
|
11
|
+
TEXT_SPLITTER = "text-splitter"
|
|
@@ -17,11 +17,11 @@ class DockerBuildConfig(BaseModel):
|
|
|
17
17
|
class DockerPortConfig(BaseModel):
|
|
18
18
|
target: int = Field(..., description="Port exposed by the container.")
|
|
19
19
|
published: Optional[int] = Field(default=None, description="Host port to publish.")
|
|
20
|
-
protocol: Optional[Literal["tcp", "udp"]] = Field(default="tcp", description="Protocol.")
|
|
21
|
-
mode: Optional[Literal["host", "ingress"]] = Field(default=None, description="Publishing mode.")
|
|
20
|
+
protocol: Optional[Literal[ "tcp", "udp" ]] = Field(default="tcp", description="Protocol.")
|
|
21
|
+
mode: Optional[Literal[ "host", "ingress" ]] = Field(default=None, description="Publishing mode.")
|
|
22
22
|
|
|
23
23
|
class DockerVolumeConfig(BaseModel):
|
|
24
|
-
type: Optional[Literal["bind", "volume", "tmpfs"]] = Field(default=None, description="Volume type.")
|
|
24
|
+
type: Optional[Literal[ "bind", "volume", "tmpfs" ]] = Field(default=None, description="Volume type.")
|
|
25
25
|
target: str = Field(..., description="Target path inside the container.")
|
|
26
26
|
source: Optional[str] = Field(default=None, description="Source path or volume name on the host.")
|
|
27
27
|
read_only: Optional[bool] = Field(default=None, description="Mount as read-only.")
|
|
@@ -63,7 +63,7 @@ class DockerRuntimeConfig(CommonRuntimeConfig):
|
|
|
63
63
|
cpus: Optional[Union[str, float]] = Field(default=None, description="CPU quota.")
|
|
64
64
|
cpu_shares: Optional[int] = Field(default=None, description="Relative CPU weight.")
|
|
65
65
|
# Restart policy and health checks
|
|
66
|
-
restart: Literal["no", "always", "on-failure", "unless-stopped"] = Field(default="no", description="Restart policy.")
|
|
66
|
+
restart: Literal[ "no", "always", "on-failure", "unless-stopped" ] = Field(default="no", description="Restart policy.")
|
|
67
67
|
healthcheck: Optional[DockerHealthCheck] = Field(default=None, description="Health check configuration.")
|
|
68
68
|
# Miscellaneous
|
|
69
69
|
labels: Optional[Dict[str, str]] = Field(default=None, description="Container labels.")
|