model-compose 0.4.7__tar.gz → 0.4.9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (361) hide show
  1. {model_compose-0.4.7/src/model_compose.egg-info → model_compose-0.4.9}/PKG-INFO +1 -2
  2. {model_compose-0.4.7 → model_compose-0.4.9}/pyproject.toml +1 -2
  3. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/base.py +14 -38
  4. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/context.py +2 -1
  5. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/__init__.py +2 -0
  6. model_compose-0.4.9/src/mindor/core/component/services/datasets/__init__.py +1 -0
  7. model_compose-0.4.9/src/mindor/core/component/services/datasets/datasets.py +129 -0
  8. model_compose-0.4.9/src/mindor/core/component/services/datasets/providers/__init__.py +2 -0
  9. model_compose-0.4.9/src/mindor/core/component/services/datasets/providers/common.py +18 -0
  10. model_compose-0.4.9/src/mindor/core/component/services/datasets/providers/huggingface.py +36 -0
  11. model_compose-0.4.9/src/mindor/core/component/services/datasets/providers/local.py +32 -0
  12. model_compose-0.4.9/src/mindor/core/component/services/datasets/utils.py +12 -0
  13. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/http_client.py +5 -5
  14. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/http_server.py +2 -2
  15. model_compose-0.4.9/src/mindor/core/component/services/image_processor.py +210 -0
  16. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/base/common.py +1 -1
  17. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/base/huggingface.py +96 -20
  18. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/__init__.py +1 -0
  19. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/chat_completion/huggingface.py +12 -2
  20. model_compose-0.4.9/src/mindor/core/component/services/model/tasks/face_embedding/common.py +47 -0
  21. model_compose-0.4.9/src/mindor/core/component/services/model/tasks/face_embedding/custom.py +12 -0
  22. model_compose-0.4.9/src/mindor/core/component/services/model/tasks/face_embedding/insightface.py +113 -0
  23. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/image_generation/common.py +6 -6
  24. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/image_generation/custom.py +1 -1
  25. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/image_generation/flux.py +1 -1
  26. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/image_generation/hunyuan_image.py +1 -1
  27. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/image_generation/sdxl.py +1 -1
  28. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/image_to_text/huggingface.py +7 -7
  29. model_compose-0.4.9/src/mindor/core/component/services/model/tasks/image_upscale/__init__.py +1 -0
  30. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/image_upscale/common.py +2 -2
  31. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/image_upscale/esrgan.py +2 -2
  32. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/image_upscale/ldsr.py +2 -2
  33. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/image_upscale/real_esrgan.py +1 -1
  34. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/image_upscale/swinir.py +2 -2
  35. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/text_classification/huggingface.py +2 -2
  36. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/text_embedding/huggingface.py +2 -2
  37. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/text_generation/huggingface.py +13 -10
  38. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/text_splitter.py +0 -1
  39. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/vector_store/base.py +1 -1
  40. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/vector_store/vector_store.py +8 -8
  41. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/base.py +17 -1
  42. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/runner/http_client.py +6 -5
  43. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/services/http_server.py +44 -24
  44. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/services/mcp_server.py +1 -1
  45. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/webui/gradio.py +6 -0
  46. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/webui/webui.py +1 -1
  47. {model_compose-0.4.7/src/mindor/core/services → model_compose-0.4.9/src/mindor/core/foundation}/async_service.py +32 -2
  48. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/gateway/base.py +6 -1
  49. model_compose-0.4.9/src/mindor/core/gateway/services/http_tunnel/base.py +29 -0
  50. model_compose-0.4.9/src/mindor/core/gateway/services/http_tunnel/drivers/__init__.py +2 -0
  51. model_compose-0.4.9/src/mindor/core/gateway/services/http_tunnel/drivers/cloudflare.py +14 -0
  52. model_compose-0.4.9/src/mindor/core/gateway/services/http_tunnel/drivers/ngrok.py +36 -0
  53. model_compose-0.4.9/src/mindor/core/gateway/services/http_tunnel/http_tunnel.py +41 -0
  54. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/gateway/services/ssh_tunnel.py +0 -1
  55. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/listener/base.py +12 -7
  56. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/listener/services/http_callback.py +2 -2
  57. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/logger/base.py +1 -1
  58. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/utils/renderers.py +9 -3
  59. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/utils/time.py +6 -3
  60. model_compose-0.4.9/src/mindor/core/utils/websocket_client.py +56 -0
  61. model_compose-0.4.7/src/mindor/core/utils/workqueue.py → model_compose-0.4.9/src/mindor/core/utils/work_queue.py +3 -3
  62. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/workflow/job/impl/random_router.py +2 -2
  63. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/workflow/workflow.py +4 -4
  64. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/loader.py +4 -0
  65. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/action.py +1 -0
  66. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/__init__.py +3 -0
  67. model_compose-0.4.9/src/mindor/dsl/schema/action/impl/datasets/__init__.py +1 -0
  68. model_compose-0.4.9/src/mindor/dsl/schema/action/impl/datasets/common.py +14 -0
  69. model_compose-0.4.9/src/mindor/dsl/schema/action/impl/datasets/datasets.py +48 -0
  70. model_compose-0.4.9/src/mindor/dsl/schema/action/impl/datasets/providers/__init__.py +2 -0
  71. model_compose-0.4.9/src/mindor/dsl/schema/action/impl/datasets/providers/common.py +19 -0
  72. model_compose-0.4.9/src/mindor/dsl/schema/action/impl/datasets/providers/huggingface.py +12 -0
  73. model_compose-0.4.9/src/mindor/dsl/schema/action/impl/datasets/providers/local.py +10 -0
  74. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/http_client.py +2 -2
  75. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/http_server.py +2 -2
  76. model_compose-0.4.9/src/mindor/dsl/schema/action/impl/image_processor.py +91 -0
  77. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/__init__.py +2 -0
  78. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/chat_completion.py +14 -1
  79. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/common.py +1 -1
  80. model_compose-0.4.9/src/mindor/dsl/schema/action/impl/model/impl/face_embedding/__init__.py +1 -0
  81. model_compose-0.4.9/src/mindor/dsl/schema/action/impl/model/impl/face_embedding/face_embedding.py +8 -0
  82. model_compose-0.4.9/src/mindor/dsl/schema/action/impl/model/impl/face_embedding/impl/__init__.py +4 -0
  83. model_compose-0.4.9/src/mindor/dsl/schema/action/impl/model/impl/face_embedding/impl/common.py +12 -0
  84. model_compose-0.4.9/src/mindor/dsl/schema/action/impl/model/impl/face_embedding/impl/dlib.py +18 -0
  85. model_compose-0.4.9/src/mindor/dsl/schema/action/impl/model/impl/face_embedding/impl/facenet.py +19 -0
  86. model_compose-0.4.9/src/mindor/dsl/schema/action/impl/model/impl/face_embedding/impl/insightface.py +19 -0
  87. model_compose-0.4.9/src/mindor/dsl/schema/action/impl/model_trainer/__init__.py +1 -0
  88. model_compose-0.4.9/src/mindor/dsl/schema/action/impl/model_trainer/impl/__init__.py +3 -0
  89. model_compose-0.4.9/src/mindor/dsl/schema/action/impl/model_trainer/impl/classification.py +7 -0
  90. model_compose-0.4.9/src/mindor/dsl/schema/action/impl/model_trainer/impl/common.py +85 -0
  91. model_compose-0.4.9/src/mindor/dsl/schema/action/impl/model_trainer/impl/sft.py +25 -0
  92. model_compose-0.4.9/src/mindor/dsl/schema/action/impl/model_trainer/model_trainer.py +8 -0
  93. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/text_splitter.py +0 -1
  94. {model_compose-0.4.7/src/mindor/dsl/schema/component → model_compose-0.4.9/src/mindor/dsl/schema/action}/impl/vector_store/impl/__init__.py +1 -0
  95. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/vector_store/impl/chroma.py +6 -1
  96. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/vector_store/impl/faiss.py +6 -1
  97. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/vector_store/impl/milvus.py +6 -1
  98. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/vector_store/impl/qdrant.py +6 -1
  99. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/component.py +3 -1
  100. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/__init__.py +3 -0
  101. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/common.py +10 -3
  102. model_compose-0.4.9/src/mindor/dsl/schema/component/impl/datasets/__init__.py +1 -0
  103. model_compose-0.4.9/src/mindor/dsl/schema/component/impl/datasets/datasets.py +18 -0
  104. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/http_client.py +2 -2
  105. model_compose-0.4.9/src/mindor/dsl/schema/component/impl/image_processor.py +17 -0
  106. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/__init__.py +1 -0
  107. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/chat_completion.py +3 -3
  108. model_compose-0.4.9/src/mindor/dsl/schema/component/impl/model/impl/common.py +140 -0
  109. model_compose-0.4.9/src/mindor/dsl/schema/component/impl/model/impl/face_embedding/__init__.py +1 -0
  110. model_compose-0.4.9/src/mindor/dsl/schema/component/impl/model/impl/face_embedding/face_embedding.py +12 -0
  111. model_compose-0.4.9/src/mindor/dsl/schema/component/impl/model/impl/face_embedding/impl/__init__.py +4 -0
  112. model_compose-0.4.9/src/mindor/dsl/schema/component/impl/model/impl/face_embedding/impl/common.py +29 -0
  113. model_compose-0.4.9/src/mindor/dsl/schema/component/impl/model/impl/face_embedding/impl/dlib.py +14 -0
  114. model_compose-0.4.9/src/mindor/dsl/schema/component/impl/model/impl/face_embedding/impl/facenet.py +14 -0
  115. model_compose-0.4.9/src/mindor/dsl/schema/component/impl/model/impl/face_embedding/impl/insightface.py +14 -0
  116. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/text_classification.py +4 -3
  117. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/text_embedding.py +3 -3
  118. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/text_generation.py +3 -3
  119. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/model.py +1 -0
  120. model_compose-0.4.9/src/mindor/dsl/schema/component/impl/model_trainer/__init__.py +1 -0
  121. model_compose-0.4.9/src/mindor/dsl/schema/component/impl/model_trainer/impl/__init__.py +3 -0
  122. model_compose-0.4.9/src/mindor/dsl/schema/component/impl/model_trainer/impl/classification.py +17 -0
  123. model_compose-0.4.9/src/mindor/dsl/schema/component/impl/model_trainer/impl/common.py +27 -0
  124. model_compose-0.4.9/src/mindor/dsl/schema/component/impl/model_trainer/impl/sft.py +17 -0
  125. model_compose-0.4.9/src/mindor/dsl/schema/component/impl/model_trainer/model_trainer.py +11 -0
  126. model_compose-0.4.9/src/mindor/dsl/schema/component/impl/types.py +15 -0
  127. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/vector_store/impl/chroma.py +1 -1
  128. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/vector_store/impl/common.py +6 -1
  129. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/vector_store/impl/milvus.py +2 -2
  130. model_compose-0.4.9/src/mindor/dsl/schema/component/impl/vector_store/impl/qdrant.py +32 -0
  131. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/controller/impl/http_server.py +1 -1
  132. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/controller/impl/mcp_server.py +1 -1
  133. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/controller/webui/impl/common.py +1 -1
  134. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/gateway/impl/common.py +1 -1
  135. model_compose-0.4.9/src/mindor/dsl/schema/gateway/impl/http_tunnel/__init__.py +1 -0
  136. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/listener/impl/http_callback.py +2 -2
  137. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/runtime/impl/docker.py +3 -3
  138. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/transport/ssh.py +1 -1
  139. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/workflow.py +1 -0
  140. model_compose-0.4.9/src/mindor/dsl/utils/path.py +23 -0
  141. {model_compose-0.4.7 → model_compose-0.4.9/src/model_compose.egg-info}/PKG-INFO +1 -2
  142. {model_compose-0.4.7 → model_compose-0.4.9}/src/model_compose.egg-info/SOURCES.txt +60 -6
  143. {model_compose-0.4.7 → model_compose-0.4.9}/src/model_compose.egg-info/requires.txt +0 -1
  144. model_compose-0.4.7/src/mindor/core/gateway/services/http_tunnel.py +0 -82
  145. model_compose-0.4.7/src/mindor/dsl/schema/component/impl/model/impl/common.py +0 -97
  146. model_compose-0.4.7/src/mindor/dsl/schema/component/impl/model/impl/types.py +0 -10
  147. model_compose-0.4.7/src/mindor/dsl/schema/component/impl/types.py +0 -12
  148. model_compose-0.4.7/src/mindor/dsl/schema/component/impl/vector_store/impl/qdrant.py +0 -41
  149. model_compose-0.4.7/src/mindor/dsl/schema/component/impl/vector_store/impl/types.py +0 -7
  150. {model_compose-0.4.7 → model_compose-0.4.9}/LICENSE +0 -0
  151. {model_compose-0.4.7 → model_compose-0.4.9}/README.md +0 -0
  152. {model_compose-0.4.7 → model_compose-0.4.9}/setup.cfg +0 -0
  153. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/__init__.py +0 -0
  154. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/cli/__init__.py +0 -0
  155. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/cli/compose.py +0 -0
  156. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/__init__.py +0 -0
  157. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/__init__.py +0 -0
  158. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/component.py +0 -0
  159. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/mcp_client.py +0 -0
  160. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/mcp_server.py +0 -0
  161. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/__init__.py +0 -0
  162. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/base/__init__.py +0 -0
  163. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/base/huggingface_hub.py +0 -0
  164. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/base/unsloth.py +0 -0
  165. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/model.py +0 -0
  166. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/chat_completion/__init__.py +0 -0
  167. {model_compose-0.4.7/src/mindor/core/component/services/model/tasks/image_generation → model_compose-0.4.9/src/mindor/core/component/services/model/tasks/face_embedding}/__init__.py +0 -0
  168. {model_compose-0.4.7/src/mindor/core/component/services/model/tasks/image_upscale → model_compose-0.4.9/src/mindor/core/component/services/model/tasks/image_generation}/__init__.py +0 -0
  169. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/image_to_text/__init__.py +0 -0
  170. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/image_upscale/custom.py +0 -0
  171. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/text_classification/__init__.py +0 -0
  172. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/text_embedding/__init__.py +0 -0
  173. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/text_generation/__init__.py +0 -0
  174. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/shell.py +0 -0
  175. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/vector_store/__init__.py +0 -0
  176. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/vector_store/drivers/__init__.py +0 -0
  177. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/vector_store/drivers/chroma.py +0 -0
  178. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/vector_store/drivers/milvus.py +0 -0
  179. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/workflow.py +0 -0
  180. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/compose/__init__.py +0 -0
  181. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/compose/compose.py +0 -0
  182. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/compose/manager.py +0 -0
  183. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/__init__.py +0 -0
  184. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/controller.py +0 -0
  185. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/runner/__init__.py +0 -0
  186. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/runner/client.py +0 -0
  187. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/runner/mcp_client.py +0 -0
  188. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/runner/runner.py +0 -0
  189. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/runtime/__init__.py +0 -0
  190. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/runtime/docker/__init__.py +0 -0
  191. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/runtime/docker/context/Dockerfile +0 -0
  192. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/runtime/docker/docker.py +0 -0
  193. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/runtime/native/__init__.py +0 -0
  194. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/runtime/native/native.py +0 -0
  195. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/runtime/specs.py +0 -0
  196. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/services/__init__.py +0 -0
  197. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/webui/__init__.py +0 -0
  198. {model_compose-0.4.7/src/mindor/core/services → model_compose-0.4.9/src/mindor/core/foundation}/__init__.py +0 -0
  199. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/gateway/__init__.py +0 -0
  200. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/gateway/gateway.py +0 -0
  201. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/gateway/services/__init__.py +0 -0
  202. {model_compose-0.4.7/src/mindor/dsl/schema/gateway/impl → model_compose-0.4.9/src/mindor/core/gateway/services}/http_tunnel/__init__.py +0 -0
  203. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/listener/__init__.py +0 -0
  204. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/listener/listener.py +0 -0
  205. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/listener/services/__init__.py +0 -0
  206. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/logger/__init__.py +0 -0
  207. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/logger/logger.py +0 -0
  208. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/logger/logging.py +0 -0
  209. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/logger/services/__init__.py +0 -0
  210. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/logger/services/console.py +0 -0
  211. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/logger/services/file.py +0 -0
  212. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/runtime/__init__.py +0 -0
  213. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/runtime/docker/__init__.py +0 -0
  214. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/runtime/docker/docker.py +0 -0
  215. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/runtime/env.py +0 -0
  216. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/utils/__init__.py +0 -0
  217. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/utils/caching.py +0 -0
  218. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/utils/http_client.py +0 -0
  219. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/utils/http_request.py +0 -0
  220. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/utils/http_response.py +0 -0
  221. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/utils/http_status.py +0 -0
  222. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/utils/image.py +0 -0
  223. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/utils/mcp_client.py +0 -0
  224. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/utils/package.py +0 -0
  225. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/utils/resolvers.py +0 -0
  226. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/utils/shell.py +0 -0
  227. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/utils/ssh_client.py +0 -0
  228. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/utils/streamer.py +0 -0
  229. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/utils/streaming.py +0 -0
  230. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/workflow/__init__.py +0 -0
  231. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/workflow/context.py +0 -0
  232. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/workflow/job/__init__.py +0 -0
  233. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/workflow/job/base.py +0 -0
  234. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/workflow/job/impl/__init__.py +0 -0
  235. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/workflow/job/impl/action.py +0 -0
  236. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/workflow/job/impl/delay.py +0 -0
  237. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/workflow/job/impl/filter.py +0 -0
  238. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/workflow/job/impl/if_.py +0 -0
  239. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/workflow/job/impl/switch.py +0 -0
  240. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/workflow/job/job.py +0 -0
  241. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/workflow/schema.py +0 -0
  242. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/__init__.py +0 -0
  243. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/__init__.py +0 -0
  244. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/__init__.py +0 -0
  245. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/common.py +0 -0
  246. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/mcp_client.py +0 -0
  247. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/mcp_server.py +0 -0
  248. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/__init__.py +0 -0
  249. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/image_generation/__init__.py +0 -0
  250. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/image_generation/image_generation.py +0 -0
  251. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/image_generation/impl/__init__.py +0 -0
  252. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/image_generation/impl/common.py +0 -0
  253. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/image_generation/impl/flux.py +0 -0
  254. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/image_generation/impl/hunyuan_image.py +0 -0
  255. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/image_generation/impl/sdxl.py +0 -0
  256. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/image_to_text.py +0 -0
  257. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/image_upscale/__init__.py +0 -0
  258. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/image_upscale/image_upscale.py +0 -0
  259. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/image_upscale/impl/__init__.py +0 -0
  260. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/image_upscale/impl/common.py +0 -0
  261. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/image_upscale/impl/esrgan.py +0 -0
  262. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/image_upscale/impl/ldsr.py +0 -0
  263. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/image_upscale/impl/real_esrgan.py +0 -0
  264. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/image_upscale/impl/swinir.py +0 -0
  265. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/text_classification.py +0 -0
  266. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/text_embedding.py +0 -0
  267. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/text_generation.py +0 -0
  268. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/model.py +0 -0
  269. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/shell.py +0 -0
  270. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/vector_store/__init__.py +0 -0
  271. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/vector_store/impl/common.py +0 -0
  272. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/vector_store/vector_store.py +0 -0
  273. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/workflow.py +0 -0
  274. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/__init__.py +0 -0
  275. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/http_server.py +0 -0
  276. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/mcp_client.py +0 -0
  277. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/mcp_server.py +0 -0
  278. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/__init__.py +0 -0
  279. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/image_generation/__init__.py +0 -0
  280. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/image_generation/image_generation.py +0 -0
  281. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/image_generation/impl/__init__.py +0 -0
  282. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/image_generation/impl/common.py +0 -0
  283. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/image_generation/impl/flux.py +0 -0
  284. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/image_generation/impl/hunyuan_image.py +0 -0
  285. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/image_generation/impl/sdxl.py +0 -0
  286. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/image_to_text.py +0 -0
  287. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/image_upscale/__init__.py +0 -0
  288. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/image_upscale/image_upscale.py +0 -0
  289. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/image_upscale/impl/__init__.py +0 -0
  290. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/image_upscale/impl/common.py +0 -0
  291. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/image_upscale/impl/esrgan.py +0 -0
  292. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/image_upscale/impl/ldsr.py +0 -0
  293. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/image_upscale/impl/real_esrgan.py +0 -0
  294. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/image_upscale/impl/swinir.py +0 -0
  295. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/shell.py +0 -0
  296. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/text_splitter.py +0 -0
  297. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/vector_store/__init__.py +0 -0
  298. {model_compose-0.4.7/src/mindor/dsl/schema/action → model_compose-0.4.9/src/mindor/dsl/schema/component}/impl/vector_store/impl/__init__.py +0 -0
  299. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/vector_store/impl/faiss.py +0 -0
  300. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/vector_store/vector_store.py +0 -0
  301. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/workflow.py +0 -0
  302. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/compose.py +0 -0
  303. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/controller/__init__.py +0 -0
  304. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/controller/controller.py +0 -0
  305. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/controller/impl/__init__.py +0 -0
  306. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/controller/impl/common.py +0 -0
  307. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/controller/impl/types.py +0 -0
  308. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/controller/webui/__init__.py +0 -0
  309. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/controller/webui/impl/__init__.py +0 -0
  310. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/controller/webui/impl/dynamic.py +0 -0
  311. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/controller/webui/impl/gradio.py +0 -0
  312. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/controller/webui/impl/static.py +0 -0
  313. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/controller/webui/webui.py +0 -0
  314. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/gateway/__init__.py +0 -0
  315. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/gateway/gateway.py +0 -0
  316. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/gateway/impl/__init__.py +0 -0
  317. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/gateway/impl/http_tunnel/http_tunnel.py +0 -0
  318. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/gateway/impl/http_tunnel/impl/__init__.py +0 -0
  319. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/gateway/impl/http_tunnel/impl/cloudflare.py +0 -0
  320. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/gateway/impl/http_tunnel/impl/common.py +0 -0
  321. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/gateway/impl/http_tunnel/impl/ngrok.py +0 -0
  322. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/gateway/impl/ssh_tunnel.py +0 -0
  323. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/gateway/impl/types.py +0 -0
  324. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/job/__init__.py +0 -0
  325. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/job/impl/__init__.py +0 -0
  326. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/job/impl/action.py +0 -0
  327. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/job/impl/common.py +0 -0
  328. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/job/impl/delay.py +0 -0
  329. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/job/impl/filter.py +0 -0
  330. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/job/impl/if_.py +0 -0
  331. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/job/impl/random_router.py +0 -0
  332. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/job/impl/switch.py +0 -0
  333. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/job/impl/types.py +0 -0
  334. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/job/job.py +0 -0
  335. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/listener/__init__.py +0 -0
  336. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/listener/impl/__init__.py +0 -0
  337. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/listener/impl/common.py +0 -0
  338. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/listener/impl/types.py +0 -0
  339. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/listener/listener.py +0 -0
  340. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/logger/__init__.py +0 -0
  341. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/logger/impl/__init__.py +0 -0
  342. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/logger/impl/common.py +0 -0
  343. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/logger/impl/console.py +0 -0
  344. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/logger/impl/file.py +0 -0
  345. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/logger/impl/types.py +0 -0
  346. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/logger/logger.py +0 -0
  347. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/runtime/__init__.py +0 -0
  348. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/runtime/impl/__init__.py +0 -0
  349. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/runtime/impl/common.py +0 -0
  350. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/runtime/impl/native.py +0 -0
  351. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/runtime/impl/types.py +0 -0
  352. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/runtime/runtime.py +0 -0
  353. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/transport/__init__.py +0 -0
  354. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/transport/http.py +0 -0
  355. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/utils/__init__.py +0 -0
  356. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/utils/annotation.py +0 -0
  357. {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/utils/enum.py +0 -0
  358. {model_compose-0.4.7 → model_compose-0.4.9}/src/model_compose.egg-info/dependency_links.txt +0 -0
  359. {model_compose-0.4.7 → model_compose-0.4.9}/src/model_compose.egg-info/entry_points.txt +0 -0
  360. {model_compose-0.4.7 → model_compose-0.4.9}/src/model_compose.egg-info/top_level.txt +0 -0
  361. {model_compose-0.4.7 → model_compose-0.4.9}/tests/test_cli.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: model-compose
3
- Version: 0.4.7
3
+ Version: 0.4.9
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
@@ -16,7 +16,6 @@ Requires-Dist: requests
16
16
  Requires-Dist: fastapi
17
17
  Requires-Dist: uvicorn
18
18
  Requires-Dist: mcp>=1.10.1
19
- Requires-Dist: pyngrok
20
19
  Requires-Dist: ulid
21
20
  Requires-Dist: gradio
22
21
  Requires-Dist: Pillow
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "model-compose"
3
- version = "0.4.7"
3
+ version = "0.4.9"
4
4
  description = "model-compose: Declarative AI Model and Workflow Orchestrator"
5
5
  authors = [
6
6
  { name = "Hanyeol Cho", email = "hanyeol.cho@gmail.com" }
@@ -17,7 +17,6 @@ dependencies = [
17
17
  "fastapi",
18
18
  "uvicorn",
19
19
  "mcp>=1.10.1",
20
- "pyngrok",
21
20
  "ulid",
22
21
  "gradio",
23
22
  "Pillow",
@@ -5,9 +5,8 @@ from mindor.dsl.schema.action import ActionConfig
5
5
  from mindor.dsl.schema.listener import ListenerConfig
6
6
  from mindor.dsl.schema.gateway import GatewayConfig
7
7
  from mindor.dsl.schema.workflow import WorkflowConfig
8
- from mindor.core.services import AsyncService
9
- from mindor.core.utils.workqueue import WorkQueue
10
- from mindor.core.utils.package import install_package, parse_requirement, is_requirement_satisfied
8
+ from mindor.core.foundation import AsyncService
9
+ from mindor.core.utils.work_queue import WorkQueue
11
10
  from mindor.core.logger import logging
12
11
  from .context import ComponentActionContext
13
12
 
@@ -50,20 +49,10 @@ class ComponentService(AsyncService):
50
49
  self.id: str = id
51
50
  self.config: ComponentConfig = config
52
51
  self.global_configs: ComponentGlobalConfigs = global_configs
53
- self.queue: Optional[WorkQueue] = None
52
+ self.work_queue: Optional[WorkQueue] = None
54
53
 
55
54
  if self.config.max_concurrent_count > 0:
56
- self.queue = WorkQueue(self.config.max_concurrent_count, self._run)
57
-
58
- async def setup(self) -> None:
59
- dependencies = self._get_setup_requirements()
60
- if dependencies:
61
- await self._install_packages(dependencies)
62
-
63
- await self._setup()
64
-
65
- async def teardown(self) -> None:
66
- await self._teardown()
55
+ self.work_queue = WorkQueue(self.config.max_concurrent_count, self._run)
67
56
 
68
57
  async def start(self, background: bool = False) -> None:
69
58
  await super().start(background)
@@ -73,29 +62,20 @@ class ComponentService(AsyncService):
73
62
  _, action = ActionResolver(self.config.actions).resolve(action_id)
74
63
  context = ComponentActionContext(run_id, input)
75
64
 
76
- if self.queue:
77
- return await (await self.queue.schedule(action, context))
65
+ if self.work_queue:
66
+ return await (await self.work_queue.schedule(action, context))
78
67
 
79
68
  return await self._run(action, context)
80
69
 
81
- async def _setup(self) -> None:
82
- pass
83
-
84
- async def _teardown(self) -> None:
85
- pass
86
-
87
- def _get_setup_requirements(self) -> Optional[List[str]]:
88
- return None
89
-
90
70
  async def _start(self) -> None:
91
- if self.queue:
92
- await self.queue.start()
71
+ if self.work_queue:
72
+ await self.work_queue.start()
93
73
 
94
74
  await super()._start()
95
75
 
96
76
  async def _stop(self) -> None:
97
- if self.queue:
98
- await self.queue.stop()
77
+ if self.work_queue:
78
+ await self.work_queue.stop()
99
79
 
100
80
  await super()._stop()
101
81
 
@@ -111,14 +91,10 @@ class ComponentService(AsyncService):
111
91
  @abstractmethod
112
92
  async def _run(self, action: ActionConfig, context: ComponentActionContext) -> Any:
113
93
  pass
114
-
115
- async def _install_packages(self, packages: List[str]) -> None:
116
- for package_spec in packages:
117
- package_spec, repository = (package_spec.split("@") + [ None ])[:2]
118
- requirement = parse_requirement(package_spec)
119
- if not requirement or not is_requirement_satisfied(requirement):
120
- logging.info(f"Installing missing module: {package_spec}")
121
- await install_package(repository or package_spec)
94
+
95
+ async def _install_package(self, package_spec: str, repository: Optional[str]) -> None:
96
+ logging.info(f"Installing required module: {package_spec}")
97
+ await super()._install_package(package_spec, repository)
122
98
 
123
99
  def register_component(type: ComponentType):
124
100
  def decorator(cls: Type[ComponentService]) -> Type[ComponentService]:
@@ -1,6 +1,7 @@
1
1
  from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Any
2
2
  from mindor.core.utils.renderers import VariableRenderer, ImageValueRenderer
3
3
  from mindor.core.gateway import find_gateway_by_port
4
+ from PIL import Image as PILImage
4
5
 
5
6
  class ComponentActionContext:
6
7
  def __init__(self, run_id: str, input: Dict[str, Any]):
@@ -16,7 +17,7 @@ class ComponentActionContext:
16
17
  async def render_variable(self, value: Any, ignore_files: bool = False) -> Any:
17
18
  return await self.renderer.render(value, ignore_files)
18
19
 
19
- async def render_image(self, value: Any) -> Any:
20
+ async def render_image(self, value: Any) -> Optional[PILImage.Image]:
20
21
  return await ImageValueRenderer().render(await self.render_variable(value))
21
22
 
22
23
  def contains_variable_reference(self, key: str, value: Any) -> bool:
@@ -3,7 +3,9 @@ from .http_client import *
3
3
  from .mcp_server import *
4
4
  from .mcp_client import *
5
5
  from .model import *
6
+ from .datasets import *
6
7
  from .vector_store import *
7
8
  from .workflow import *
8
9
  from .shell import *
9
10
  from .text_splitter import *
11
+ from .image_processor import *
@@ -0,0 +1 @@
1
+ from .datasets import *
@@ -0,0 +1,129 @@
1
+ from __future__ import annotations
2
+ from typing import TYPE_CHECKING
3
+
4
+ from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, AsyncIterator, Any
5
+ from mindor.dsl.schema.action import DatasetsActionConfig, DatasetsActionMethod, DatasetsProvider
6
+ from ...base import ComponentService, ComponentType, ComponentGlobalConfigs, register_component
7
+ from ...context import ComponentActionContext
8
+ from .providers import HuggingfaceDatasetsProvider, LocalDatasetsProvider
9
+ from .utils import format_template_example
10
+
11
+ if TYPE_CHECKING:
12
+ from datasets import Dataset
13
+
14
+ class DatasetsAction:
15
+ def __init__(self, config: DatasetsActionConfig):
16
+ self.config: DatasetsActionConfig = config
17
+
18
+ async def run(self, context: ComponentActionContext) -> Any:
19
+ result = await self._dispatch(context)
20
+ context.register_source("result", result)
21
+
22
+ return (await context.render_variable(self.config.output, ignore_files=True)) if self.config.output else result
23
+
24
+ async def _dispatch(self, context: ComponentActionContext) -> Dataset:
25
+ if self.config.method == DatasetsActionMethod.LOAD:
26
+ return await self._load(context)
27
+
28
+ if self.config.method == DatasetsActionMethod.CONCAT:
29
+ return await self._concat(context)
30
+
31
+ if self.config.method == DatasetsActionMethod.SELECT:
32
+ return await self._select(context)
33
+
34
+ if self.config.method == DatasetsActionMethod.MAP:
35
+ return await self._map(context)
36
+
37
+ raise ValueError(f"Unsupported datasets action method: {self.config.method}")
38
+
39
+ async def _load(self, context: ComponentActionContext) -> Dataset:
40
+ fraction = await context.render_variable(self.config.fraction)
41
+ shuffle = await context.render_variable(self.config.shuffle)
42
+
43
+ dataset = await self._load_dataset(context)
44
+
45
+ if shuffle:
46
+ dataset = dataset.shuffle()
47
+
48
+ if isinstance(fraction, float) and fraction < 1.0:
49
+ sample_size = max(int(len(dataset) * fraction), 1)
50
+ dataset = dataset.select(range(sample_size))
51
+
52
+ return dataset
53
+
54
+ async def _load_dataset(self, context: ComponentActionContext) -> Dataset:
55
+ if self.config.provider == DatasetsProvider.HUGGINGFACE:
56
+ return await HuggingfaceDatasetsProvider(self.config).load(context)
57
+
58
+ if self.config.provider == DatasetsProvider.LOCAL:
59
+ return await LocalDatasetsProvider(self.config).load(context)
60
+
61
+ raise ValueError(f"Unsupported dataset provider: {self.config.provider}")
62
+
63
+ async def _concat(self, context: ComponentActionContext) -> Dataset:
64
+ from datasets import concatenate_datasets
65
+
66
+ datasets = await context.render_variable(self.config.datasets)
67
+ direction = await context.render_variable(self.config.direction)
68
+ info = await context.render_variable(self.config.info)
69
+ split = await context.render_variable(self.config.split)
70
+
71
+ for dataset in datasets:
72
+ if not isinstance(dataset, Dataset):
73
+ raise ValueError(f"Expected Dataset instance, but got {type(dataset).__name__}")
74
+
75
+ return concatenate_datasets(
76
+ datasets,
77
+ info=info,
78
+ split=split,
79
+ axis=0 if direction == "vertical" else 1
80
+ )
81
+
82
+ async def _select(self, context: ComponentActionContext) -> Dataset:
83
+ dataset = await context.render_variable(self.config.dataset)
84
+ axis = await context.render_variable(self.config.axis)
85
+ indices = await context.render_variable(self.config.indices)
86
+ columns = await context.render_variable(self.config.columns)
87
+
88
+ if not isinstance(dataset, Dataset):
89
+ raise ValueError(f"Expected Dataset instance, but got {type(dataset).__name__}")
90
+
91
+ if axis == "rows":
92
+ if indices is None:
93
+ raise ValueError("indices must be provided when axis='rows'")
94
+ return dataset.select([ int(index) for index in indices ])
95
+
96
+ if axis == "columns":
97
+ if columns is None:
98
+ raise ValueError("columns must be provided when axis='columns'")
99
+ return dataset.select_columns(columns)
100
+
101
+ raise ValueError(f"Unsupported axis: {axis}")
102
+
103
+ async def _map(self, context: ComponentActionContext) -> Dataset:
104
+ dataset = await context.render_variable(self.config.dataset)
105
+ template = await context.render_variable(self.config.template)
106
+ output_column = await context.render_variable(self.config.output_column)
107
+ remove_columns = await context.render_variable(self.config.remove_columns)
108
+
109
+ if not isinstance(dataset, Dataset):
110
+ raise ValueError(f"Expected Dataset instance, but got {type(dataset).__name__}")
111
+
112
+ def format_example(example):
113
+ return { output_column: format_template_example(template, example) }
114
+
115
+ return dataset.map(format_example, remove_columns=remove_columns)
116
+
117
+ @register_component(ComponentType.DATASETS)
118
+ class DatasetsComponent(ComponentService):
119
+ def __init__(self, id: str, config: DatasetsActionConfig, global_configs: ComponentGlobalConfigs, daemon: bool):
120
+ super().__init__(id, config, global_configs, daemon)
121
+
122
+ def _get_setup_requirements(self) -> Optional[List[str]]:
123
+ return [ "datasets" ]
124
+
125
+ async def _run(self, action: DatasetsActionConfig, context: ComponentActionContext) -> Any:
126
+ async def _run():
127
+ return await DatasetsAction(action).run(context)
128
+
129
+ return await self.run_in_thread(_run)
@@ -0,0 +1,2 @@
1
+ from .huggingface import *
2
+ from .local import *
@@ -0,0 +1,18 @@
1
+ from __future__ import annotations
2
+ from typing import TYPE_CHECKING
3
+
4
+ from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, AsyncIterator, Any
5
+ from abc import ABC, abstractmethod
6
+ from mindor.dsl.schema.action import DatasetsLoadActionConfig
7
+ from ....context import ComponentActionContext
8
+
9
+ if TYPE_CHECKING:
10
+ from datasets import Dataset
11
+
12
+ class CommonDatasetsProvider(ABC):
13
+ def __init__(self, config: DatasetsLoadActionConfig):
14
+ self.config: DatasetsLoadActionConfig = config
15
+
16
+ @abstractmethod
17
+ async def load(self, context: ComponentActionContext) -> Dataset:
18
+ pass
@@ -0,0 +1,36 @@
1
+ from __future__ import annotations
2
+ from typing import TYPE_CHECKING
3
+
4
+ from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, AsyncIterator, Any
5
+ from .common import CommonDatasetsProvider, ComponentActionContext
6
+
7
+ if TYPE_CHECKING:
8
+ from datasets import Dataset
9
+
10
+ class HuggingfaceDatasetsProvider(CommonDatasetsProvider):
11
+ async def load(self, context: ComponentActionContext) -> Dataset:
12
+ from datasets import load_dataset
13
+
14
+ path = await context.render_variable(self.config.path)
15
+ name = await context.render_variable(self.config.name)
16
+ revision = await context.render_variable(self.config.revision)
17
+ token = await context.render_variable(self.config.token)
18
+ split = await context.render_variable(self.config.split)
19
+ streaming = await context.render_variable(self.config.streaming)
20
+ keep_in_memory = await context.render_variable(self.config.keep_in_memory)
21
+ cache_dir = await context.render_variable(self.config.cache_dir)
22
+ save_infos = await context.render_variable(self.config.save_infos)
23
+ trust_remote_code = await context.render_variable(self.config.trust_remote_code)
24
+
25
+ return load_dataset(
26
+ path=path,
27
+ name=name,
28
+ revision=revision,
29
+ token=token,
30
+ split=split,
31
+ streaming=streaming,
32
+ keep_in_memory=keep_in_memory,
33
+ cache_dir=cache_dir,
34
+ save_infos=save_infos,
35
+ trust_remote_code=trust_remote_code
36
+ )
@@ -0,0 +1,32 @@
1
+ from __future__ import annotations
2
+ from typing import TYPE_CHECKING
3
+
4
+ from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, AsyncIterator, Any
5
+ from .common import CommonDatasetsProvider, ComponentActionContext
6
+
7
+ if TYPE_CHECKING:
8
+ from datasets import Dataset
9
+
10
+ class LocalDatasetsProvider(CommonDatasetsProvider):
11
+ async def load(self, context: ComponentActionContext) -> Dataset:
12
+ from datasets import load_dataset
13
+
14
+ loader = await context.render_variable(self.config.loader)
15
+ data_files = await context.render_variable(self.config.data_files)
16
+ data_dir = await context.render_variable(self.config.data_dir)
17
+ split = await context.render_variable(self.config.split)
18
+ streaming = await context.render_variable(self.config.streaming)
19
+ keep_in_memory = await context.render_variable(self.config.keep_in_memory)
20
+ cache_dir = await context.render_variable(self.config.cache_dir)
21
+ save_infos = await context.render_variable(self.config.save_infos)
22
+
23
+ return load_dataset(
24
+ path=loader,
25
+ data_files=data_files,
26
+ data_dir=data_dir,
27
+ split=split,
28
+ streaming=streaming,
29
+ keep_in_memory=keep_in_memory,
30
+ cache_dir=cache_dir,
31
+ save_infos=save_infos
32
+ )
@@ -0,0 +1,12 @@
1
+ from typing import Dict, List, Any
2
+ import re
3
+
4
+ def format_template_example(template: str, example: Dict[str, Any]) -> str:
5
+ column_names = set(re.findall(r"\{(\w+)\}", template))
6
+ formatted = template
7
+
8
+ for column in column_names:
9
+ if column in example:
10
+ formatted = formatted.replace(f"{{{column}}}", str(example[column]))
11
+
12
+ return formatted
@@ -43,16 +43,16 @@ class HttpClientPollingCompletion(HttpClientCompletion):
43
43
  if status in (self.config.success_when or []):
44
44
  return response
45
45
  if status in (self.config.fail_when or []):
46
- raise RuntimeError(f"Polling failed: status '{status}' matched a failure condition.")
46
+ raise RuntimeError(f"Polling failed: status '{status}' matched a failure condition")
47
47
  else: # use status code
48
48
  if is_status_code_matched(status_code, self.config.success_when or []):
49
49
  return response
50
50
  if is_status_code_matched(status_code, self.config.fail_when or []):
51
- raise RuntimeError(f"Polling failed: status code '{status_code}' matched a failure condition.")
51
+ raise RuntimeError(f"Polling failed: status code '{status_code}' matched a failure condition")
52
52
 
53
53
  await asyncio.sleep(interval.total_seconds())
54
54
 
55
- raise TimeoutError(f"Polling timed out after {timeout}.")
55
+ raise TimeoutError(f"Polling timed out after {timeout}")
56
56
 
57
57
  async def _resolve_url_or_path(self, context: ComponentActionContext) -> str:
58
58
  if self.config.path:
@@ -128,13 +128,13 @@ class HttpClientAction:
128
128
  return await context.render_variable(self.config.endpoint)
129
129
 
130
130
  def _convert_stream_chunk(self, chunk: bytes) -> Any:
131
- if self.config.stream_format == HttpStreamFormat.JSON:
131
+ if self.config.streaming_format == HttpStreamFormat.JSON:
132
132
  try:
133
133
  return json.loads(chunk)
134
134
  except:
135
135
  return None
136
136
 
137
- if self.config.stream_format == HttpStreamFormat.TEXT:
137
+ if self.config.streaming_format == HttpStreamFormat.TEXT:
138
138
  return chunk.decode("utf-8", errors="replace")
139
139
 
140
140
  return chunk
@@ -117,13 +117,13 @@ class HttpServerAction:
117
117
  return (await context.render_variable(self.config.output, ignore_files=True)) if self.config.output else (result or response)
118
118
 
119
119
  def _convert_stream_chunk(self, chunk: bytes) -> Any:
120
- if self.config.stream_format == HttpStreamFormat.JSON:
120
+ if self.config.streaming_format == HttpStreamFormat.JSON:
121
121
  try:
122
122
  return json.loads(chunk)
123
123
  except:
124
124
  return None
125
125
 
126
- if self.config.stream_format == HttpStreamFormat.TEXT:
126
+ if self.config.streaming_format == HttpStreamFormat.TEXT:
127
127
  return chunk.decode("utf-8", errors="replace")
128
128
 
129
129
  return chunk
@@ -0,0 +1,210 @@
1
+ from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Any
2
+ from mindor.dsl.schema.component import ImageProcessorComponentConfig
3
+ from mindor.dsl.schema.action import ActionConfig, ImageProcessorActionConfig, ImageProcessorActionMethod, ImageScaleMode, FlipDirection
4
+ from ..base import ComponentService, ComponentType, ComponentGlobalConfigs, register_component
5
+ from ..context import ComponentActionContext
6
+ from PIL import Image as PILImage, ImageFilter, ImageEnhance
7
+
8
+ class ImageProcessorAction:
9
+ def __init__(self, config: ImageProcessorActionConfig):
10
+ self.config: ImageProcessorActionConfig = config
11
+
12
+ async def run(self, context: ComponentActionContext) -> Any:
13
+ result = await self._dispatch(context)
14
+ context.register_source("result", result)
15
+
16
+ return (await context.render_variable(self.config.output, ignore_files=True)) if self.config.output else result
17
+
18
+ async def _dispatch(self, context: ComponentActionContext) -> Any:
19
+ if self.config.method == ImageProcessorActionMethod.RESIZE:
20
+ return await self._resize(context)
21
+
22
+ if self.config.method == ImageProcessorActionMethod.CROP:
23
+ return await self._crop(context)
24
+
25
+ if self.config.method == ImageProcessorActionMethod.ROTATE:
26
+ return await self._rotate(context)
27
+
28
+ if self.config.method == ImageProcessorActionMethod.FLIP:
29
+ return await self._flip(context)
30
+
31
+ if self.config.method == ImageProcessorActionMethod.GRAYSCALE:
32
+ return await self._grayscale(context)
33
+
34
+ if self.config.method == ImageProcessorActionMethod.BLUR:
35
+ return await self._blur(context)
36
+
37
+ if self.config.method == ImageProcessorActionMethod.SHARPEN:
38
+ return await self._sharpen(context)
39
+
40
+ if self.config.method == ImageProcessorActionMethod.ADJUST_BRIGHTNESS:
41
+ return await self._adjust_brightness(context)
42
+
43
+ if self.config.method == ImageProcessorActionMethod.ADJUST_CONTRAST:
44
+ return await self._adjust_contrast(context)
45
+
46
+ if self.config.method == ImageProcessorActionMethod.ADJUST_SATURATION:
47
+ return await self._adjust_saturation(context)
48
+
49
+ raise ValueError(f"Unsupported image processing action method: {self.config.method}")
50
+
51
+ async def _resize(self, context: ComponentActionContext) -> Optional[PILImage.Image]:
52
+ image = await context.render_image(self.config.image)
53
+ width = await context.render_variable(self.config.width) if self.config.width else None
54
+ height = await context.render_variable(self.config.height) if self.config.height else None
55
+ scale_mode = await context.render_variable(self.config.scale_mode)
56
+
57
+ if width is None and height is None:
58
+ raise ValueError("At least one of width or height must be specified for resize")
59
+
60
+ if image:
61
+ return self._resize_image(image, width, height, scale_mode)
62
+
63
+ return None
64
+
65
+ async def _crop(self, context: ComponentActionContext) -> Optional[PILImage.Image]:
66
+ image = await context.render_image(self.config.image)
67
+ x = await context.render_variable(self.config.x)
68
+ y = await context.render_variable(self.config.y)
69
+ width = await context.render_variable(self.config.width)
70
+ height = await context.render_variable(self.config.height)
71
+
72
+ if image:
73
+ return image.crop(x, y, x + width, y + height)
74
+
75
+ return None
76
+
77
+ async def _rotate(self, context: ComponentActionContext) -> Optional[PILImage.Image]:
78
+ image = await context.render_image(self.config.image)
79
+ angle = await context.render_variable(self.config.angle)
80
+ expand = await context.render_variable(self.config.expand)
81
+
82
+ if image:
83
+ return image.rotate(-angle, expand=expand, resample=PILImage.Resampling.BICUBIC)
84
+
85
+ return None
86
+
87
+ async def _flip(self, context: ComponentActionContext) -> Optional[PILImage.Image]:
88
+ image = await context.render_image(self.config.image)
89
+ direction = await context.render_variable(self.config.direction)
90
+
91
+ if image:
92
+ if direction == FlipDirection.HORIZONTAL:
93
+ return image.transpose(PILImage.Transpose.FLIP_LEFT_RIGHT)
94
+
95
+ if direction == FlipDirection.VERTICAL:
96
+ return image.transpose(PILImage.Transpose.FLIP_TOP_BOTTOM)
97
+
98
+ return None
99
+
100
+ async def _grayscale(self, context: ComponentActionContext) -> Optional[PILImage.Image]:
101
+ image = await context.render_image(self.config.image)
102
+
103
+ if image:
104
+ return image.convert("L")
105
+
106
+ return None
107
+
108
+ async def _blur(self, context: ComponentActionContext) -> Optional[PILImage.Image]:
109
+ image = await context.render_image(self.config.image)
110
+ radius = await context.render_variable(self.config.radius)
111
+
112
+ if image:
113
+ return image.filter(ImageFilter.GaussianBlur(radius=radius))
114
+
115
+ async def _sharpen(self, context: ComponentActionContext) -> Optional[PILImage.Image]:
116
+ image = await context.render_image(self.config.image)
117
+ factor = await context.render_variable(self.config.factor)
118
+
119
+ if image:
120
+ return ImageEnhance.Sharpness(image).enhance(factor)
121
+
122
+ return FileNotFoundError
123
+
124
+ async def _adjust_brightness(self, context: ComponentActionContext) -> Optional[PILImage.Image]:
125
+ image = await context.render_image(self.config.image)
126
+ factor = await context.render_variable(self.config.factor)
127
+
128
+ if image:
129
+ return ImageEnhance.Brightness(image).enhance(factor)
130
+
131
+ return None
132
+
133
+ async def _adjust_contrast(self, context: ComponentActionContext) -> Optional[PILImage.Image]:
134
+ image = await context.render_image(self.config.image)
135
+ factor = await context.render_variable(self.config.factor)
136
+
137
+ if image:
138
+ return ImageEnhance.Contrast(image).enhance(factor)
139
+
140
+ return image
141
+
142
+ async def _adjust_saturation(self, context: ComponentActionContext) -> Optional[PILImage.Image]:
143
+ image = await context.render_image(self.config.image)
144
+ factor = await context.render_variable(self.config.factor)
145
+
146
+ if image:
147
+ return ImageEnhance.Color(image).enhance(factor)
148
+
149
+ return None
150
+
151
+ def _resize_image(self, image: PILImage.Image, width: int, height: int, scale_mode: str) -> PILImage.Image:
152
+ original_width, original_height = image.size
153
+ target_width = width or original_width
154
+ target_height = height or original_height
155
+
156
+ if scale_mode == ImageScaleMode.FIT:
157
+ new_width, new_height = self._get_size_aspect_fit(target_width, target_height, original_width, original_height)
158
+ return image.resize((new_width, new_height), PILImage.Resampling.LANCZOS)
159
+
160
+ if scale_mode == ImageScaleMode.FILL:
161
+ new_width, new_height = self._get_size_aspect_fill(target_width, target_height, original_width, original_height)
162
+ image = image.resize((new_width, new_height), PILImage.Resampling.LANCZOS)
163
+
164
+ crop_box = self._get_center_crop_box(new_width, new_height, target_width, target_height)
165
+ return image.crop(crop_box)
166
+
167
+ if scale_mode == ImageScaleMode.STRETCH:
168
+ return image.resize((target_width, target_height), PILImage.Resampling.LANCZOS)
169
+
170
+ raise ValueError(f"Invalid scale_mode: {scale_mode}")
171
+
172
+ def _get_size_aspect_fit(self, target_width: int, target_height: int, original_width: int, original_height: int) -> Tuple[int, int]:
173
+ aspect_ratio = original_width / original_height
174
+
175
+ height = target_height
176
+ width = height * aspect_ratio
177
+
178
+ if width > target_width:
179
+ width = target_width
180
+ height = width / aspect_ratio
181
+
182
+ return (int(width), int(height))
183
+
184
+ def _get_size_aspect_fill(self, target_width: int, target_height: int, original_width: int, original_height: int) -> Tuple[int, int]:
185
+ aspect_ratio = original_width / original_height
186
+
187
+ height = target_height
188
+ width = height * aspect_ratio
189
+
190
+ if width < target_width:
191
+ width = target_width
192
+ height = width / aspect_ratio
193
+
194
+ return (int(width), int(height))
195
+
196
+ def _get_center_crop_box(self, image_width: int, image_height: int, target_width: int, target_height: int) -> Tuple[int, int, int, int]:
197
+ left = (image_width - target_width ) // 2
198
+ top = (image_height - target_height) // 2
199
+ right = left + target_width
200
+ bottom = top + target_height
201
+
202
+ return (left, top, right, bottom)
203
+
204
+ @register_component(ComponentType.IMAGE_PROCESSOR)
205
+ class ImageProcessorComponent(ComponentService):
206
+ def __init__(self, id: str, config: ImageProcessorComponentConfig, global_configs: ComponentGlobalConfigs, daemon: bool):
207
+ super().__init__(id, config, global_configs, daemon)
208
+
209
+ async def _run(self, action: ActionConfig, context: ComponentActionContext) -> Any:
210
+ return await ImageProcessorAction(action).run(context)
@@ -5,7 +5,7 @@ from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annot
5
5
  from abc import ABC, abstractmethod
6
6
  from mindor.dsl.schema.component import ModelComponentConfig, ModelTaskType, ModelDriver, HuggingfaceModelConfig, LocalModelConfig
7
7
  from mindor.dsl.schema.action import ModelActionConfig
8
- from mindor.core.services import AsyncService
8
+ from mindor.core.foundation import AsyncService
9
9
  from mindor.core.logger import logging
10
10
  from ....context import ComponentActionContext
11
11
  import asyncio