msgflux 0.1.0__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 (447) hide show
  1. msgflux-0.1.0/.github/CODEOWNERS +5 -0
  2. msgflux-0.1.0/.github/dependabot.yml +20 -0
  3. msgflux-0.1.0/.github/labeler.yml +48 -0
  4. msgflux-0.1.0/.github/pull_request_template.md +54 -0
  5. msgflux-0.1.0/.github/release-drafter.yml +80 -0
  6. msgflux-0.1.0/.github/workflows/ci.yml +133 -0
  7. msgflux-0.1.0/.github/workflows/docs.yml +43 -0
  8. msgflux-0.1.0/.github/workflows/labeler.yml +132 -0
  9. msgflux-0.1.0/.github/workflows/merge-bot.yml +289 -0
  10. msgflux-0.1.0/.github/workflows/pre-commit-autoupdate.yml +48 -0
  11. msgflux-0.1.0/.github/workflows/publish.yml +168 -0
  12. msgflux-0.1.0/.github/workflows/release-drafter.yml +21 -0
  13. msgflux-0.1.0/.github/workflows/validate-release.yml +83 -0
  14. msgflux-0.1.0/.gitignore +70 -0
  15. msgflux-0.1.0/.pre-commit-config.yaml +19 -0
  16. msgflux-0.1.0/.python-version +1 -0
  17. msgflux-0.1.0/.readthedocs.yaml +29 -0
  18. msgflux-0.1.0/CHANGELOG.md +5 -0
  19. msgflux-0.1.0/CONTRIBUTING.md +564 -0
  20. msgflux-0.1.0/LICENSE +21 -0
  21. msgflux-0.1.0/PKG-INFO +170 -0
  22. msgflux-0.1.0/README.md +129 -0
  23. msgflux-0.1.0/docs/CHANGELOG.md +1 -0
  24. msgflux-0.1.0/docs/CNAME +1 -0
  25. msgflux-0.1.0/docs/_includes/init_chat_completion_model.md +90 -0
  26. msgflux-0.1.0/docs/_includes/install.md +13 -0
  27. msgflux-0.1.0/docs/_includes/install_openai.md +13 -0
  28. msgflux-0.1.0/docs/anatomy/agent.md +365 -0
  29. msgflux-0.1.0/docs/anatomy/chat-schema-utils.md +265 -0
  30. msgflux-0.1.0/docs/anatomy/dict-lowering-and-restoration.md +71 -0
  31. msgflux-0.1.0/docs/anatomy/index.md +43 -0
  32. msgflux-0.1.0/docs/anatomy/logical-vs-provider-schema.md +87 -0
  33. msgflux-0.1.0/docs/anatomy/msgspec-transport-lowering.md +272 -0
  34. msgflux-0.1.0/docs/anatomy/openai-chat-completion.md +318 -0
  35. msgflux-0.1.0/docs/anatomy/react-provider-schemas.md +99 -0
  36. msgflux-0.1.0/docs/anatomy/signatures.md +277 -0
  37. msgflux-0.1.0/docs/anatomy/tool-flow-control.md +97 -0
  38. msgflux-0.1.0/docs/anatomy/tool-library.md +218 -0
  39. msgflux-0.1.0/docs/api-reference/databases/database.md +0 -0
  40. msgflux-0.1.0/docs/api-reference/databases/types/kv.md +3 -0
  41. msgflux-0.1.0/docs/api-reference/databases/types/vector.md +0 -0
  42. msgflux-0.1.0/docs/api-reference/models/model.md +1 -0
  43. msgflux-0.1.0/docs/api-reference/models/model_gateway.md +1 -0
  44. msgflux-0.1.0/docs/api-reference/models/types/chat_completion.md +5 -0
  45. msgflux-0.1.0/docs/api-reference/models/types/image_classifier.md +0 -0
  46. msgflux-0.1.0/docs/api-reference/models/types/image_embedder.md +0 -0
  47. msgflux-0.1.0/docs/api-reference/models/types/image_text_to_image.md +1 -0
  48. msgflux-0.1.0/docs/api-reference/models/types/moderation.md +1 -0
  49. msgflux-0.1.0/docs/api-reference/models/types/speech_to_text.md +1 -0
  50. msgflux-0.1.0/docs/api-reference/models/types/text_classifier.md +0 -0
  51. msgflux-0.1.0/docs/api-reference/models/types/text_embedder.md +1 -0
  52. msgflux-0.1.0/docs/api-reference/models/types/text_reranker.md +0 -0
  53. msgflux-0.1.0/docs/api-reference/models/types/text_to_image.md +1 -0
  54. msgflux-0.1.0/docs/api-reference/models/types/text_to_speech.md +1 -0
  55. msgflux-0.1.0/docs/api-reference/nn/functional.md +9 -0
  56. msgflux-0.1.0/docs/api-reference/nn/modules/agent.md +1 -0
  57. msgflux-0.1.0/docs/api-reference/nn/modules/module.md +0 -0
  58. msgflux-0.1.0/docs/api-reference/nn/modules/module_dict.md +1 -0
  59. msgflux-0.1.0/docs/api-reference/nn/modules/module_list.md +1 -0
  60. msgflux-0.1.0/docs/api-reference/nn/modules/predictor.md +1 -0
  61. msgflux-0.1.0/docs/api-reference/nn/modules/searcher.md +1 -0
  62. msgflux-0.1.0/docs/api-reference/nn/modules/sequential.md +1 -0
  63. msgflux-0.1.0/docs/api-reference/nn/modules/speaker.md +1 -0
  64. msgflux-0.1.0/docs/api-reference/nn/modules/tool.md +7 -0
  65. msgflux-0.1.0/docs/api-reference/nn/modules/transcriber.md +1 -0
  66. msgflux-0.1.0/docs/api-reference.md +0 -0
  67. msgflux-0.1.0/docs/assets/logo-msgflux-horizon.png +0 -0
  68. msgflux-0.1.0/docs/assets/logo.png +0 -0
  69. msgflux-0.1.0/docs/assets/msgflux-wordmark.png +0 -0
  70. msgflux-0.1.0/docs/assets/msgflux.png +0 -0
  71. msgflux-0.1.0/docs/assets/tmd-mascot.png +0 -0
  72. msgflux-0.1.0/docs/blog/.authors.yml +6 -0
  73. msgflux-0.1.0/docs/blog/index.md +2 -0
  74. msgflux-0.1.0/docs/blog/posts/.meta.yml +3 -0
  75. msgflux-0.1.0/docs/blog/posts/26-04/why-msgflux-exists.md +163 -0
  76. msgflux-0.1.0/docs/changelog.md +1 -0
  77. msgflux-0.1.0/docs/dependency-management.md +149 -0
  78. msgflux-0.1.0/docs/hooks/copy_markdown.py +159 -0
  79. msgflux-0.1.0/docs/index.md +731 -0
  80. msgflux-0.1.0/docs/learn/dotdict.md +403 -0
  81. msgflux-0.1.0/docs/learn/inline.md +711 -0
  82. msgflux-0.1.0/docs/learn/models/chat_completion.md +1702 -0
  83. msgflux-0.1.0/docs/learn/models/image_text_to_image.md +469 -0
  84. msgflux-0.1.0/docs/learn/models/model.md +339 -0
  85. msgflux-0.1.0/docs/learn/models/model_gateway.md +242 -0
  86. msgflux-0.1.0/docs/learn/models/moderation.md +64 -0
  87. msgflux-0.1.0/docs/learn/models/speech_to_text.md +551 -0
  88. msgflux-0.1.0/docs/learn/models/text_classifier.md +148 -0
  89. msgflux-0.1.0/docs/learn/models/text_embedder.md +418 -0
  90. msgflux-0.1.0/docs/learn/models/text_reranker.md +235 -0
  91. msgflux-0.1.0/docs/learn/models/text_to_image.md +398 -0
  92. msgflux-0.1.0/docs/learn/models/text_to_speech.md +410 -0
  93. msgflux-0.1.0/docs/learn/nn/agent/async.md +176 -0
  94. msgflux-0.1.0/docs/learn/nn/agent/debug.md +186 -0
  95. msgflux-0.1.0/docs/learn/nn/agent/generation-schemas.md +334 -0
  96. msgflux-0.1.0/docs/learn/nn/agent/hooks.md +357 -0
  97. msgflux-0.1.0/docs/learn/nn/agent/index.md +44 -0
  98. msgflux-0.1.0/docs/learn/nn/agent/model-gateway.md +25 -0
  99. msgflux-0.1.0/docs/learn/nn/agent/prefilling.md +71 -0
  100. msgflux-0.1.0/docs/learn/nn/agent/quickstart.md +114 -0
  101. msgflux-0.1.0/docs/learn/nn/agent/reasoning.md +627 -0
  102. msgflux-0.1.0/docs/learn/nn/agent/signatures.md +587 -0
  103. msgflux-0.1.0/docs/learn/nn/agent/streaming.md +131 -0
  104. msgflux-0.1.0/docs/learn/nn/agent/system-prompt.md +293 -0
  105. msgflux-0.1.0/docs/learn/nn/agent/task-and-context.md +896 -0
  106. msgflux-0.1.0/docs/learn/nn/agent/tools.md +1625 -0
  107. msgflux-0.1.0/docs/learn/nn/agent/vars.md +286 -0
  108. msgflux-0.1.0/docs/learn/nn/functional.md +630 -0
  109. msgflux-0.1.0/docs/learn/nn/mediamaker.md +294 -0
  110. msgflux-0.1.0/docs/learn/nn/message.md +136 -0
  111. msgflux-0.1.0/docs/learn/nn/module/composing.md +255 -0
  112. msgflux-0.1.0/docs/learn/nn/module/core-concepts.md +109 -0
  113. msgflux-0.1.0/docs/learn/nn/module/forward-and-async.md +153 -0
  114. msgflux-0.1.0/docs/learn/nn/module/index.md +55 -0
  115. msgflux-0.1.0/docs/learn/nn/module/module-dict.md +59 -0
  116. msgflux-0.1.0/docs/learn/nn/module/module-list.md +43 -0
  117. msgflux-0.1.0/docs/learn/nn/module/sequential.md +60 -0
  118. msgflux-0.1.0/docs/learn/nn/module/visualization.md +64 -0
  119. msgflux-0.1.0/docs/learn/nn/predictor.md +245 -0
  120. msgflux-0.1.0/docs/learn/nn/searcher.md +303 -0
  121. msgflux-0.1.0/docs/learn/nn/speaker.md +288 -0
  122. msgflux-0.1.0/docs/learn/nn/transcriber.md +202 -0
  123. msgflux-0.1.0/docs/learn/parsers.md +293 -0
  124. msgflux-0.1.0/docs/learn/retrievers/fuzzy.md +190 -0
  125. msgflux-0.1.0/docs/learn/retrievers/lexical.md +231 -0
  126. msgflux-0.1.0/docs/learn/retrievers/retriever.md +142 -0
  127. msgflux-0.1.0/docs/learn/retrievers/web.md +196 -0
  128. msgflux-0.1.0/docs/learn/telemetry.md +276 -0
  129. msgflux-0.1.0/docs/stylesheets/extra.css +568 -0
  130. msgflux-0.1.0/docs/tutorials/ad-focus-group.md +644 -0
  131. msgflux-0.1.0/docs/tutorials/call-transcript-analysis.md +669 -0
  132. msgflux-0.1.0/docs/tutorials/deal-briefing-generator.md +728 -0
  133. msgflux-0.1.0/docs/tutorials/email-auto-responder.md +409 -0
  134. msgflux-0.1.0/docs/tutorials/food-delivery-assistant.md +1130 -0
  135. msgflux-0.1.0/docs/tutorials/index.md +214 -0
  136. msgflux-0.1.0/docs/tutorials/intent-router.md +582 -0
  137. msgflux-0.1.0/docs/tutorials/lead-scoring.md +667 -0
  138. msgflux-0.1.0/docs/tutorials/meeting-action-items.md +690 -0
  139. msgflux-0.1.0/docs/tutorials/meeting-assistant.md +506 -0
  140. msgflux-0.1.0/docs/tutorials/oracle-specialist-tool.md +301 -0
  141. msgflux-0.1.0/docs/tutorials/pix-assistant.md +1045 -0
  142. msgflux-0.1.0/docs/tutorials/plan-tool-with-root-context.md +276 -0
  143. msgflux-0.1.0/docs/tutorials/product-poster.md +430 -0
  144. msgflux-0.1.0/docs/tutorials/restaurant-supply-assistant.md +1010 -0
  145. msgflux-0.1.0/docs/tutorials/signature-router.md +422 -0
  146. msgflux-0.1.0/docs/tutorials/streaming-support-triage.md +230 -0
  147. msgflux-0.1.0/docs/tutorials/support-ticket-router.md +480 -0
  148. msgflux-0.1.0/docs/tutorials/visit-report.md +1296 -0
  149. msgflux-0.1.0/docs/tutorials/workplace-incident-reporter.md +789 -0
  150. msgflux-0.1.0/docs/tutorials/youtube-cut-detector.md +526 -0
  151. msgflux-0.1.0/examples/ad_focus_group.py +153 -0
  152. msgflux-0.1.0/examples/call_transcript_analysis.py +208 -0
  153. msgflux-0.1.0/examples/deal_briefing_generator.py +244 -0
  154. msgflux-0.1.0/examples/food_delivery_assistant.py +331 -0
  155. msgflux-0.1.0/examples/intent-router.py +180 -0
  156. msgflux-0.1.0/examples/lead_scoring.py +203 -0
  157. msgflux-0.1.0/examples/meeting_action_items.py +218 -0
  158. msgflux-0.1.0/examples/meeting_assistant.py +145 -0
  159. msgflux-0.1.0/examples/oracle_specialist_tool.py +93 -0
  160. msgflux-0.1.0/examples/pix_assistant.py +330 -0
  161. msgflux-0.1.0/examples/plan_tool_with_root_history.py +78 -0
  162. msgflux-0.1.0/examples/restaurant-supply-assistant.py +360 -0
  163. msgflux-0.1.0/examples/streaming_support_triage.py +70 -0
  164. msgflux-0.1.0/examples/visit_report.py +524 -0
  165. msgflux-0.1.0/examples/youtube_cut_detector.py +162 -0
  166. msgflux-0.1.0/mkdocs.yml +247 -0
  167. msgflux-0.1.0/pyproject.toml +218 -0
  168. msgflux-0.1.0/scripts/release.sh +280 -0
  169. msgflux-0.1.0/scripts/setup-branch-protection.sh +123 -0
  170. msgflux-0.1.0/scripts/setup-labels.sh +53 -0
  171. msgflux-0.1.0/src/msgflux/__init__.py +104 -0
  172. msgflux-0.1.0/src/msgflux/_private/__init__.py +0 -0
  173. msgflux-0.1.0/src/msgflux/_private/client.py +105 -0
  174. msgflux-0.1.0/src/msgflux/_private/core.py +14 -0
  175. msgflux-0.1.0/src/msgflux/_private/executor.py +134 -0
  176. msgflux-0.1.0/src/msgflux/_private/response.py +230 -0
  177. msgflux-0.1.0/src/msgflux/auto/__init__.py +5 -0
  178. msgflux-0.1.0/src/msgflux/auto/params.py +167 -0
  179. msgflux-0.1.0/src/msgflux/cache.py +54 -0
  180. msgflux-0.1.0/src/msgflux/core/__init__.py +5 -0
  181. msgflux-0.1.0/src/msgflux/core/dotdict.py +264 -0
  182. msgflux-0.1.0/src/msgflux/core/examples.py +169 -0
  183. msgflux-0.1.0/src/msgflux/core/message.py +45 -0
  184. msgflux-0.1.0/src/msgflux/data/__init__.py +0 -0
  185. msgflux-0.1.0/src/msgflux/data/audio.py +1 -0
  186. msgflux-0.1.0/src/msgflux/data/dbs/__init__.py +16 -0
  187. msgflux-0.1.0/src/msgflux/data/dbs/base.py +124 -0
  188. msgflux-0.1.0/src/msgflux/data/dbs/db.py +65 -0
  189. msgflux-0.1.0/src/msgflux/data/dbs/providers/__init__.py +0 -0
  190. msgflux-0.1.0/src/msgflux/data/dbs/providers/cachetools.py +57 -0
  191. msgflux-0.1.0/src/msgflux/data/dbs/providers/diskcache.py +48 -0
  192. msgflux-0.1.0/src/msgflux/data/dbs/providers/faiss.py +220 -0
  193. msgflux-0.1.0/src/msgflux/data/dbs/registry.py +19 -0
  194. msgflux-0.1.0/src/msgflux/data/dbs/response.py +10 -0
  195. msgflux-0.1.0/src/msgflux/data/dbs/types.py +26 -0
  196. msgflux-0.1.0/src/msgflux/data/parsers/__init__.py +16 -0
  197. msgflux-0.1.0/src/msgflux/data/parsers/base.py +325 -0
  198. msgflux-0.1.0/src/msgflux/data/parsers/parser.py +101 -0
  199. msgflux-0.1.0/src/msgflux/data/parsers/providers/__init__.py +32 -0
  200. msgflux-0.1.0/src/msgflux/data/parsers/providers/csv_parser.py +278 -0
  201. msgflux-0.1.0/src/msgflux/data/parsers/providers/email_parser.py +264 -0
  202. msgflux-0.1.0/src/msgflux/data/parsers/providers/html_parser.py +265 -0
  203. msgflux-0.1.0/src/msgflux/data/parsers/providers/openpyxl.py +333 -0
  204. msgflux-0.1.0/src/msgflux/data/parsers/providers/pypdf.py +186 -0
  205. msgflux-0.1.0/src/msgflux/data/parsers/providers/python_docx.py +334 -0
  206. msgflux-0.1.0/src/msgflux/data/parsers/providers/python_pptx.py +197 -0
  207. msgflux-0.1.0/src/msgflux/data/parsers/registry.py +19 -0
  208. msgflux-0.1.0/src/msgflux/data/parsers/response.py +32 -0
  209. msgflux-0.1.0/src/msgflux/data/parsers/types.py +110 -0
  210. msgflux-0.1.0/src/msgflux/data/retrievers/__init__.py +16 -0
  211. msgflux-0.1.0/src/msgflux/data/retrievers/base.py +185 -0
  212. msgflux-0.1.0/src/msgflux/data/retrievers/providers/__init__.py +0 -0
  213. msgflux-0.1.0/src/msgflux/data/retrievers/providers/bm25.py +230 -0
  214. msgflux-0.1.0/src/msgflux/data/retrievers/providers/bm25s.py +221 -0
  215. msgflux-0.1.0/src/msgflux/data/retrievers/providers/rank_bm25.py +148 -0
  216. msgflux-0.1.0/src/msgflux/data/retrievers/providers/rapidfuzz.py +125 -0
  217. msgflux-0.1.0/src/msgflux/data/retrievers/providers/wikipedia.py +281 -0
  218. msgflux-0.1.0/src/msgflux/data/retrievers/registry.py +19 -0
  219. msgflux-0.1.0/src/msgflux/data/retrievers/retriever.py +83 -0
  220. msgflux-0.1.0/src/msgflux/data/retrievers/types.py +24 -0
  221. msgflux-0.1.0/src/msgflux/data/types/__init__.py +29 -0
  222. msgflux-0.1.0/src/msgflux/data/types/audio.py +112 -0
  223. msgflux-0.1.0/src/msgflux/data/types/base.py +70 -0
  224. msgflux-0.1.0/src/msgflux/data/types/file.py +114 -0
  225. msgflux-0.1.0/src/msgflux/data/types/image.py +134 -0
  226. msgflux-0.1.0/src/msgflux/data/types/video.py +121 -0
  227. msgflux-0.1.0/src/msgflux/dsl/__init__.py +0 -0
  228. msgflux-0.1.0/src/msgflux/dsl/inline.py +484 -0
  229. msgflux-0.1.0/src/msgflux/dsl/signature.py +393 -0
  230. msgflux-0.1.0/src/msgflux/dsl/typed_parsers/__init__.py +19 -0
  231. msgflux-0.1.0/src/msgflux/dsl/typed_parsers/base.py +24 -0
  232. msgflux-0.1.0/src/msgflux/dsl/typed_parsers/providers/__init__.py +0 -0
  233. msgflux-0.1.0/src/msgflux/dsl/typed_parsers/providers/xml.py +259 -0
  234. msgflux-0.1.0/src/msgflux/dsl/typed_parsers/registry.py +14 -0
  235. msgflux-0.1.0/src/msgflux/envs.py +100 -0
  236. msgflux-0.1.0/src/msgflux/exceptions.py +84 -0
  237. msgflux-0.1.0/src/msgflux/generation/__init__.py +0 -0
  238. msgflux-0.1.0/src/msgflux/generation/control_flow.py +163 -0
  239. msgflux-0.1.0/src/msgflux/generation/reasoning/__init__.py +5 -0
  240. msgflux-0.1.0/src/msgflux/generation/reasoning/cot.py +7 -0
  241. msgflux-0.1.0/src/msgflux/generation/reasoning/react.py +289 -0
  242. msgflux-0.1.0/src/msgflux/generation/reasoning/self_consistency.py +16 -0
  243. msgflux-0.1.0/src/msgflux/generation/templates.py +53 -0
  244. msgflux-0.1.0/src/msgflux/logger.py +159 -0
  245. msgflux-0.1.0/src/msgflux/models/__init__.py +16 -0
  246. msgflux-0.1.0/src/msgflux/models/base.py +39 -0
  247. msgflux-0.1.0/src/msgflux/models/cache.py +125 -0
  248. msgflux-0.1.0/src/msgflux/models/gateway.py +466 -0
  249. msgflux-0.1.0/src/msgflux/models/httpx.py +81 -0
  250. msgflux-0.1.0/src/msgflux/models/model.py +122 -0
  251. msgflux-0.1.0/src/msgflux/models/profiles/__init__.py +48 -0
  252. msgflux-0.1.0/src/msgflux/models/profiles/base.py +122 -0
  253. msgflux-0.1.0/src/msgflux/models/profiles/loader.py +264 -0
  254. msgflux-0.1.0/src/msgflux/models/profiles/registry.py +207 -0
  255. msgflux-0.1.0/src/msgflux/models/providers/__init__.py +0 -0
  256. msgflux-0.1.0/src/msgflux/models/providers/cerebras.py +30 -0
  257. msgflux-0.1.0/src/msgflux/models/providers/groq.py +52 -0
  258. msgflux-0.1.0/src/msgflux/models/providers/imagerouter.py +33 -0
  259. msgflux-0.1.0/src/msgflux/models/providers/jinaai.py +331 -0
  260. msgflux-0.1.0/src/msgflux/models/providers/ollama.py +51 -0
  261. msgflux-0.1.0/src/msgflux/models/providers/openai.py +1884 -0
  262. msgflux-0.1.0/src/msgflux/models/providers/openrouter.py +64 -0
  263. msgflux-0.1.0/src/msgflux/models/providers/replicate.py +218 -0
  264. msgflux-0.1.0/src/msgflux/models/providers/sambanova.py +38 -0
  265. msgflux-0.1.0/src/msgflux/models/providers/together.py +57 -0
  266. msgflux-0.1.0/src/msgflux/models/providers/vllm.py +131 -0
  267. msgflux-0.1.0/src/msgflux/models/registry.py +19 -0
  268. msgflux-0.1.0/src/msgflux/models/response.py +26 -0
  269. msgflux-0.1.0/src/msgflux/models/tool_call_agg.py +85 -0
  270. msgflux-0.1.0/src/msgflux/models/types.py +196 -0
  271. msgflux-0.1.0/src/msgflux/nn/__init__.py +57 -0
  272. msgflux-0.1.0/src/msgflux/nn/functional.py +645 -0
  273. msgflux-0.1.0/src/msgflux/nn/hooks/__init__.py +24 -0
  274. msgflux-0.1.0/src/msgflux/nn/hooks/guard.py +109 -0
  275. msgflux-0.1.0/src/msgflux/nn/hooks/hook.py +123 -0
  276. msgflux-0.1.0/src/msgflux/nn/modules/__init__.py +68 -0
  277. msgflux-0.1.0/src/msgflux/nn/modules/agent.py +1927 -0
  278. msgflux-0.1.0/src/msgflux/nn/modules/container.py +672 -0
  279. msgflux-0.1.0/src/msgflux/nn/modules/embedder.py +261 -0
  280. msgflux-0.1.0/src/msgflux/nn/modules/generator.py +21 -0
  281. msgflux-0.1.0/src/msgflux/nn/modules/mediamaker.py +285 -0
  282. msgflux-0.1.0/src/msgflux/nn/modules/module.py +2106 -0
  283. msgflux-0.1.0/src/msgflux/nn/modules/predictor.py +238 -0
  284. msgflux-0.1.0/src/msgflux/nn/modules/searcher.py +383 -0
  285. msgflux-0.1.0/src/msgflux/nn/modules/speaker.py +222 -0
  286. msgflux-0.1.0/src/msgflux/nn/modules/tool.py +839 -0
  287. msgflux-0.1.0/src/msgflux/nn/modules/transcriber.py +273 -0
  288. msgflux-0.1.0/src/msgflux/nn/parameter.py +77 -0
  289. msgflux-0.1.0/src/msgflux/protocols/__init__.py +1 -0
  290. msgflux-0.1.0/src/msgflux/protocols/mcp/__init__.py +61 -0
  291. msgflux-0.1.0/src/msgflux/protocols/mcp/auth/__init__.py +17 -0
  292. msgflux-0.1.0/src/msgflux/protocols/mcp/auth/apikey.py +70 -0
  293. msgflux-0.1.0/src/msgflux/protocols/mcp/auth/base.py +83 -0
  294. msgflux-0.1.0/src/msgflux/protocols/mcp/auth/basic.py +57 -0
  295. msgflux-0.1.0/src/msgflux/protocols/mcp/auth/bearer.py +97 -0
  296. msgflux-0.1.0/src/msgflux/protocols/mcp/auth/custom.py +76 -0
  297. msgflux-0.1.0/src/msgflux/protocols/mcp/auth/oauth2.py +133 -0
  298. msgflux-0.1.0/src/msgflux/protocols/mcp/client.py +454 -0
  299. msgflux-0.1.0/src/msgflux/protocols/mcp/exceptions.py +25 -0
  300. msgflux-0.1.0/src/msgflux/protocols/mcp/integration.py +95 -0
  301. msgflux-0.1.0/src/msgflux/protocols/mcp/loglevels.py +16 -0
  302. msgflux-0.1.0/src/msgflux/protocols/mcp/transports.py +435 -0
  303. msgflux-0.1.0/src/msgflux/protocols/mcp/types.py +51 -0
  304. msgflux-0.1.0/src/msgflux/py.typed +0 -0
  305. msgflux-0.1.0/src/msgflux/telemetry/__init__.py +22 -0
  306. msgflux-0.1.0/src/msgflux/telemetry/config.py +104 -0
  307. msgflux-0.1.0/src/msgflux/telemetry/span.py +245 -0
  308. msgflux-0.1.0/src/msgflux/tools/__init__.py +10 -0
  309. msgflux-0.1.0/src/msgflux/tools/builtin/__init__.py +5 -0
  310. msgflux-0.1.0/src/msgflux/tools/builtin/web_fetch.py +121 -0
  311. msgflux-0.1.0/src/msgflux/tools/config.py +196 -0
  312. msgflux-0.1.0/src/msgflux/tools/definitions.py +11 -0
  313. msgflux-0.1.0/src/msgflux/utils/__init__.py +0 -0
  314. msgflux-0.1.0/src/msgflux/utils/chat.py +682 -0
  315. msgflux-0.1.0/src/msgflux/utils/common.py +36 -0
  316. msgflux-0.1.0/src/msgflux/utils/console.py +55 -0
  317. msgflux-0.1.0/src/msgflux/utils/convert.py +20 -0
  318. msgflux-0.1.0/src/msgflux/utils/encode.py +192 -0
  319. msgflux-0.1.0/src/msgflux/utils/html.py +171 -0
  320. msgflux-0.1.0/src/msgflux/utils/imports.py +115 -0
  321. msgflux-0.1.0/src/msgflux/utils/inspect.py +81 -0
  322. msgflux-0.1.0/src/msgflux/utils/logging.py +15 -0
  323. msgflux-0.1.0/src/msgflux/utils/mermaid.py +20 -0
  324. msgflux-0.1.0/src/msgflux/utils/msgspec.py +1116 -0
  325. msgflux-0.1.0/src/msgflux/utils/pooling.py +51 -0
  326. msgflux-0.1.0/src/msgflux/utils/templates.py +51 -0
  327. msgflux-0.1.0/src/msgflux/utils/tenacity.py +38 -0
  328. msgflux-0.1.0/src/msgflux/utils/torch.py +7 -0
  329. msgflux-0.1.0/src/msgflux/utils/validation.py +31 -0
  330. msgflux-0.1.0/src/msgflux/utils/xml.py +7 -0
  331. msgflux-0.1.0/src/msgflux/version.py +1 -0
  332. msgflux-0.1.0/tests/__init__.py +0 -0
  333. msgflux-0.1.0/tests/auto/__init__.py +1 -0
  334. msgflux-0.1.0/tests/auto/test_params.py +58 -0
  335. msgflux-0.1.0/tests/conftest.py +42 -0
  336. msgflux-0.1.0/tests/data/__init__.py +1 -0
  337. msgflux-0.1.0/tests/data/parsers/__init__.py +0 -0
  338. msgflux-0.1.0/tests/data/parsers/test_parsers.py +424 -0
  339. msgflux-0.1.0/tests/data/retrievers/__init__.py +1 -0
  340. msgflux-0.1.0/tests/data/retrievers/providers/__init__.py +1 -0
  341. msgflux-0.1.0/tests/data/retrievers/providers/test_bm25.py +171 -0
  342. msgflux-0.1.0/tests/data/retrievers/providers/test_bm25s.py +114 -0
  343. msgflux-0.1.0/tests/data/retrievers/providers/test_rank_bm25.py +89 -0
  344. msgflux-0.1.0/tests/data/retrievers/providers/test_rapidfuzz.py +204 -0
  345. msgflux-0.1.0/tests/data/retrievers/providers/test_wikipedia.py +144 -0
  346. msgflux-0.1.0/tests/dsl/test_inline.py +816 -0
  347. msgflux-0.1.0/tests/dsl/test_signature.py +511 -0
  348. msgflux-0.1.0/tests/dsl/test_typed_parsers.py +136 -0
  349. msgflux-0.1.0/tests/generation/__init__.py +1 -0
  350. msgflux-0.1.0/tests/generation/test_control_flow.py +288 -0
  351. msgflux-0.1.0/tests/generation/test_reasoning.py +292 -0
  352. msgflux-0.1.0/tests/generation/test_templates.py +23 -0
  353. msgflux-0.1.0/tests/integration/test_agent_reasoning.py +364 -0
  354. msgflux-0.1.0/tests/integration/test_guard_moderation.py +62 -0
  355. msgflux-0.1.0/tests/integration/test_reasoning.py +271 -0
  356. msgflux-0.1.0/tests/integration/test_tool_dict_e2e.py +114 -0
  357. msgflux-0.1.0/tests/models/__init__.py +0 -0
  358. msgflux-0.1.0/tests/models/providers/__init__.py +1 -0
  359. msgflux-0.1.0/tests/models/providers/test_openai.py +969 -0
  360. msgflux-0.1.0/tests/models/providers/test_vllm.py +306 -0
  361. msgflux-0.1.0/tests/models/test_base.py +120 -0
  362. msgflux-0.1.0/tests/models/test_cache.py +234 -0
  363. msgflux-0.1.0/tests/models/test_gateway.py +666 -0
  364. msgflux-0.1.0/tests/models/test_httpx.py +241 -0
  365. msgflux-0.1.0/tests/models/test_model.py +159 -0
  366. msgflux-0.1.0/tests/models/test_profiles.py +39 -0
  367. msgflux-0.1.0/tests/models/test_registry.py +169 -0
  368. msgflux-0.1.0/tests/models/test_response.py +143 -0
  369. msgflux-0.1.0/tests/models/test_tool_call_agg.py +59 -0
  370. msgflux-0.1.0/tests/nn/__init__.py +0 -0
  371. msgflux-0.1.0/tests/nn/modules/__init__.py +0 -0
  372. msgflux-0.1.0/tests/nn/modules/test_agent.py +1231 -0
  373. msgflux-0.1.0/tests/nn/modules/test_container.py +552 -0
  374. msgflux-0.1.0/tests/nn/modules/test_embedder.py +295 -0
  375. msgflux-0.1.0/tests/nn/modules/test_lm.py +36 -0
  376. msgflux-0.1.0/tests/nn/modules/test_mediamaker.py +211 -0
  377. msgflux-0.1.0/tests/nn/modules/test_module.py +1089 -0
  378. msgflux-0.1.0/tests/nn/modules/test_predictor.py +321 -0
  379. msgflux-0.1.0/tests/nn/modules/test_searcher.py +683 -0
  380. msgflux-0.1.0/tests/nn/modules/test_speaker.py +198 -0
  381. msgflux-0.1.0/tests/nn/modules/test_tool.py +1363 -0
  382. msgflux-0.1.0/tests/nn/modules/test_tool_transport_params.py +235 -0
  383. msgflux-0.1.0/tests/nn/modules/test_transcriber.py +160 -0
  384. msgflux-0.1.0/tests/nn/test_functional.py +488 -0
  385. msgflux-0.1.0/tests/nn/test_guard.py +259 -0
  386. msgflux-0.1.0/tests/nn/test_parameter.py +153 -0
  387. msgflux-0.1.0/tests/protocols/__init__.py +1 -0
  388. msgflux-0.1.0/tests/protocols/mcp/__init__.py +1 -0
  389. msgflux-0.1.0/tests/protocols/mcp/auth/test_auth_providers.py +282 -0
  390. msgflux-0.1.0/tests/protocols/mcp/conftest.py +24 -0
  391. msgflux-0.1.0/tests/protocols/mcp/mcp_simple_server.py +37 -0
  392. msgflux-0.1.0/tests/protocols/mcp/test_client.py +387 -0
  393. msgflux-0.1.0/tests/protocols/mcp/test_exceptions.py +71 -0
  394. msgflux-0.1.0/tests/protocols/mcp/test_integration.py +217 -0
  395. msgflux-0.1.0/tests/protocols/mcp/test_loglevels.py +67 -0
  396. msgflux-0.1.0/tests/protocols/mcp/test_mcp_live.py +62 -0
  397. msgflux-0.1.0/tests/protocols/mcp/test_toollibrary_mcp.py +285 -0
  398. msgflux-0.1.0/tests/protocols/mcp/test_transports.py +288 -0
  399. msgflux-0.1.0/tests/protocols/mcp/test_types.py +151 -0
  400. msgflux-0.1.0/tests/telemetry/__init__.py +1 -0
  401. msgflux-0.1.0/tests/telemetry/test_config.py +127 -0
  402. msgflux-0.1.0/tests/telemetry/test_span_agent_decorators.py +261 -0
  403. msgflux-0.1.0/tests/telemetry/test_span_tool_decorators.py +179 -0
  404. msgflux-0.1.0/tests/test_agent_as_tool_with_signature.py +170 -0
  405. msgflux-0.1.0/tests/test_agent_generation_schema.py +99 -0
  406. msgflux-0.1.0/tests/test_agent_image_detail.py +103 -0
  407. msgflux-0.1.0/tests/test_agent_include_date.py +125 -0
  408. msgflux-0.1.0/tests/test_agent_named_kwargs.py +292 -0
  409. msgflux-0.1.0/tests/test_agent_signature_annotations.py +241 -0
  410. msgflux-0.1.0/tests/test_agent_templates_fix.py +121 -0
  411. msgflux-0.1.0/tests/test_async_hooks.py +206 -0
  412. msgflux-0.1.0/tests/test_autoparams.py +305 -0
  413. msgflux-0.1.0/tests/test_data_types.py +238 -0
  414. msgflux-0.1.0/tests/test_dotdict.py +912 -0
  415. msgflux-0.1.0/tests/test_embedder.py +229 -0
  416. msgflux-0.1.0/tests/test_examples.py +111 -0
  417. msgflux-0.1.0/tests/test_image_block_kwargs_refactor.py +184 -0
  418. msgflux-0.1.0/tests/test_inject_message.py +166 -0
  419. msgflux-0.1.0/tests/test_mcp_fastmcp.py +39 -0
  420. msgflux-0.1.0/tests/test_tool_config_decorator.py +236 -0
  421. msgflux-0.1.0/tests/test_tools_visualization.py +147 -0
  422. msgflux-0.1.0/tests/test_type_inheritance_struct.py +215 -0
  423. msgflux-0.1.0/tests/test_video_block_kwargs.py +187 -0
  424. msgflux-0.1.0/tests/tools/__init__.py +1 -0
  425. msgflux-0.1.0/tests/tools/builtin/__init__.py +0 -0
  426. msgflux-0.1.0/tests/tools/builtin/test_web_fetch.py +407 -0
  427. msgflux-0.1.0/tests/tools/test_config.py +412 -0
  428. msgflux-0.1.0/tests/tools/test_toolflowcontrol.py +157 -0
  429. msgflux-0.1.0/tests/utils/test_chat.py +258 -0
  430. msgflux-0.1.0/tests/utils/test_common.py +87 -0
  431. msgflux-0.1.0/tests/utils/test_console.py +33 -0
  432. msgflux-0.1.0/tests/utils/test_convert.py +23 -0
  433. msgflux-0.1.0/tests/utils/test_encode.py +73 -0
  434. msgflux-0.1.0/tests/utils/test_hint_to_schema_dict.py +104 -0
  435. msgflux-0.1.0/tests/utils/test_hooks.py +34 -0
  436. msgflux-0.1.0/tests/utils/test_imports.py +11 -0
  437. msgflux-0.1.0/tests/utils/test_inspect.py +23 -0
  438. msgflux-0.1.0/tests/utils/test_logging.py +40 -0
  439. msgflux-0.1.0/tests/utils/test_mermaid.py +15 -0
  440. msgflux-0.1.0/tests/utils/test_msgspec.py +214 -0
  441. msgflux-0.1.0/tests/utils/test_pooling.py +44 -0
  442. msgflux-0.1.0/tests/utils/test_templates.py +25 -0
  443. msgflux-0.1.0/tests/utils/test_tenacity.py +99 -0
  444. msgflux-0.1.0/tests/utils/test_torch.py +25 -0
  445. msgflux-0.1.0/tests/utils/test_validation.py +30 -0
  446. msgflux-0.1.0/tests/utils/test_xml.py +9 -0
  447. msgflux-0.1.0/uv.lock +2342 -0
@@ -0,0 +1,5 @@
1
+ # See https://help.github.com/articles/about-codeowners/
2
+ # for more info about CODEOWNERS file
3
+
4
+ # CODEOWNERS
5
+ * @vilsonrodrigues
@@ -0,0 +1,20 @@
1
+ version: 2
2
+
3
+ updates:
4
+ - package-ecosystem: "uv"
5
+ directory: "/"
6
+ schedule:
7
+ interval: "weekly"
8
+ open-pull-requests-limit: 10
9
+ labels:
10
+ - "dependencies"
11
+ - "python"
12
+
13
+ - package-ecosystem: "github-actions"
14
+ directory: "/"
15
+ schedule:
16
+ interval: "weekly"
17
+ open-pull-requests-limit: 5
18
+ labels:
19
+ - "dependencies"
20
+ - "github-actions"
@@ -0,0 +1,48 @@
1
+ # Configuration for labeler action
2
+ # https://github.com/actions/labeler
3
+
4
+ # Models
5
+ models:
6
+ - changed-files:
7
+ - any-glob-to-any-file: 'src/msgflux/models/**'
8
+
9
+ # Core
10
+ core:
11
+ - changed-files:
12
+ - any-glob-to-any-file:
13
+ - 'src/msgflux/generation/**'
14
+ - 'src/msgflux/dsl/**'
15
+ - 'src/msgflux/nn/**'
16
+
17
+ # Tests
18
+ tests:
19
+ - changed-files:
20
+ - any-glob-to-any-file: 'tests/**'
21
+
22
+ # Documentation
23
+ documentation:
24
+ - changed-files:
25
+ - any-glob-to-any-file:
26
+ - '**/*.md'
27
+ - 'docs/**'
28
+
29
+ # CI/CD
30
+ ci:
31
+ - changed-files:
32
+ - any-glob-to-any-file:
33
+ - '.github/workflows/**'
34
+ - '.github/dependabot.yml'
35
+ - '.github/labeler.yml'
36
+
37
+ # Dependencies
38
+ dependencies:
39
+ - changed-files:
40
+ - any-glob-to-any-file:
41
+ - 'pyproject.toml'
42
+ - 'uv.lock'
43
+ - '.pre-commit-config.yaml'
44
+
45
+ # Examples
46
+ examples:
47
+ - changed-files:
48
+ - any-glob-to-any-file: 'examples/**'
@@ -0,0 +1,54 @@
1
+ ## Summary
2
+
3
+ <!-- Brief description of what this PR does -->
4
+
5
+ ## Changes
6
+
7
+ <!-- List the main changes in this PR -->
8
+ -
9
+ -
10
+ -
11
+
12
+ ## Type of Change
13
+
14
+ <!-- Mark the relevant option with an "x" -->
15
+ - [ ] Bug fix (non-breaking change which fixes an issue)
16
+ - [ ] New feature (non-breaking change which adds functionality)
17
+ - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
18
+ - [ ] Documentation update
19
+ - [ ] Code refactoring
20
+ - [ ] Performance improvement
21
+ - [ ] Test improvement
22
+ - [ ] CI/CD improvement
23
+ - [ ] Chore/maintenance
24
+
25
+ ## Testing
26
+
27
+ <!-- Describe how you tested these changes -->
28
+ - [ ] Tests pass locally (`uv run pytest -v`)
29
+ - [ ] Added new tests for this change
30
+ - [ ] Updated existing tests
31
+
32
+ ## Documentation
33
+
34
+ <!-- Check if documentation needs updating -->
35
+ - [ ] Updated README.md (if API changed)
36
+ - [ ] Updated CHANGELOG.md (if notable change)
37
+ - [ ] Added/updated code comments
38
+ - [ ] Added/updated docstrings
39
+
40
+ ## Checklist
41
+
42
+ <!-- Mark completed items with an "x" -->
43
+ - [ ] Code formatted (`uv run ruff format`)
44
+ - [ ] Lint checks pass (`uv run ruff check`)
45
+ - [ ] Tests pass (`uv run pytest -v`)
46
+ - [ ] **Version NOT changed** (maintainers bump version after merge)
47
+ - [ ] Commit messages follow [conventional commits](https://www.conventionalcommits.org/)
48
+ - [ ] No breaking changes (or documented above)
49
+ - [ ] Added tests for new features
50
+ - [ ] Documentation is up to date
51
+
52
+ ## Additional Notes
53
+
54
+ <!-- Any additional information reviewers should know -->
@@ -0,0 +1,80 @@
1
+ name-template: 'v$RESOLVED_VERSION'
2
+ tag-template: 'v$RESOLVED_VERSION'
3
+
4
+ categories:
5
+ - title: '🚨 Breaking Changes'
6
+ labels:
7
+ - 'breaking-change'
8
+ - 'breaking'
9
+ - title: '🚀 Features'
10
+ labels:
11
+ - 'enhancement'
12
+ - 'feat'
13
+ - 'feature'
14
+ - title: '🐛 Bug Fixes'
15
+ labels:
16
+ - 'bug'
17
+ - 'fix'
18
+ - title: '⚡ Performance'
19
+ labels:
20
+ - 'performance'
21
+ - 'perf'
22
+ - title: '🔐 Security'
23
+ labels:
24
+ - 'security'
25
+ - title: '📚 Documentation'
26
+ labels:
27
+ - 'documentation'
28
+ - 'docs'
29
+ - title: '🔄 Refactoring'
30
+ labels:
31
+ - 'refactor'
32
+ - 'refactoring'
33
+ - title: '🧪 Tests'
34
+ labels:
35
+ - 'tests'
36
+ - 'test'
37
+ - title: '🤖 CI/CD'
38
+ labels:
39
+ - 'ci'
40
+ - 'ci-cd'
41
+ - title: '📦 Dependencies'
42
+ labels:
43
+ - 'dependencies'
44
+ - title: '🔧 Maintenance'
45
+ labels:
46
+ - 'maintenance'
47
+ - 'chore'
48
+
49
+ change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
50
+ change-title-escapes: '\<*_&'
51
+
52
+ version-resolver:
53
+ major:
54
+ labels:
55
+ - 'breaking-change'
56
+ - 'major'
57
+ minor:
58
+ labels:
59
+ - 'enhancement'
60
+ - 'feat'
61
+ - 'feature'
62
+ patch:
63
+ labels:
64
+ - 'bug'
65
+ - 'fix'
66
+ - 'patch'
67
+ - 'documentation'
68
+ - 'dependencies'
69
+ default: patch
70
+
71
+ template: |
72
+ ## Changes
73
+
74
+ $CHANGES
75
+
76
+ ## Contributors
77
+
78
+ Thank you to all contributors! 🙏
79
+
80
+ $CONTRIBUTORS
@@ -0,0 +1,133 @@
1
+ name: CI
2
+
3
+ on:
4
+ pull_request:
5
+ branches: [main]
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ lint-format:
13
+ name: Ruff Lint & Format
14
+ runs-on: ubuntu-latest
15
+
16
+ steps:
17
+ - uses: actions/checkout@v6
18
+ with:
19
+ fetch-depth: 0
20
+
21
+ - name: Set up Python
22
+ uses: actions/setup-python@v6
23
+ with:
24
+ python-version: '3.12'
25
+
26
+ - name: Install uv
27
+ uses: astral-sh/setup-uv@v7
28
+ with:
29
+ version: "latest"
30
+
31
+ - name: Install dependencies
32
+ run: uv sync --python 3.12 --group dev
33
+
34
+ - name: Determine changed Python files
35
+ id: changed-python
36
+ shell: bash
37
+ run: |
38
+ if [[ "${{ github.event_name }}" == "pull_request" ]]; then
39
+ BASE_SHA="${{ github.event.pull_request.base.sha }}"
40
+ HEAD_SHA="${{ github.event.pull_request.head.sha }}"
41
+ CHANGED_PY=$(git diff --name-only --diff-filter=ACMR "${BASE_SHA}...${HEAD_SHA}" -- '*.py')
42
+ elif git rev-parse HEAD~1 >/dev/null 2>&1; then
43
+ CHANGED_PY=$(git diff --name-only --diff-filter=ACMR HEAD~1 HEAD -- '*.py')
44
+ else
45
+ CHANGED_PY=$(git ls-files '*.py')
46
+ fi
47
+
48
+ {
49
+ echo "files<<EOF"
50
+ echo "$CHANGED_PY"
51
+ echo "EOF"
52
+ } >> "$GITHUB_OUTPUT"
53
+
54
+ - name: Run ruff format check on changed files
55
+ if: steps.changed-python.outputs.files != ''
56
+ run: |
57
+ printf '%s\n' "${{ steps.changed-python.outputs.files }}" | xargs uv run --python 3.12 ruff format --check
58
+
59
+ - name: Run ruff lint on changed files
60
+ if: steps.changed-python.outputs.files != ''
61
+ run: |
62
+ printf '%s\n' "${{ steps.changed-python.outputs.files }}" | xargs uv run --python 3.12 ruff check --output-format=github
63
+
64
+ - name: Skip ruff when no Python files changed
65
+ if: steps.changed-python.outputs.files == ''
66
+ run: echo "No Python files changed; skipping Ruff."
67
+
68
+ test:
69
+ name: Test Python ${{ matrix.python-version }}
70
+ runs-on: ubuntu-latest
71
+ strategy:
72
+ fail-fast: false
73
+ matrix:
74
+ python-version: ['3.10', '3.11', '3.12', '3.13']
75
+
76
+ steps:
77
+ - uses: actions/checkout@v6
78
+
79
+ - name: Set up Python ${{ matrix.python-version }}
80
+ uses: actions/setup-python@v6
81
+ with:
82
+ python-version: ${{ matrix.python-version }}
83
+
84
+ - name: Install uv
85
+ uses: astral-sh/setup-uv@v7
86
+ with:
87
+ version: "latest"
88
+
89
+ - name: Install dependencies
90
+ run: uv sync --python ${{ matrix.python-version }} --group dev
91
+
92
+ - name: Run tests
93
+ run: uv run --python ${{ matrix.python-version }} pytest -v --ignore=tests/integration --cov=src/msgflux --cov-report=xml --cov-report=term
94
+
95
+ - name: Upload coverage
96
+ uses: codecov/codecov-action@v6
97
+ if: matrix.python-version == '3.12'
98
+ with:
99
+ file: ./coverage.xml
100
+ fail_ci_if_error: false
101
+
102
+ build:
103
+ name: Build distribution
104
+ runs-on: ubuntu-latest
105
+ needs: [lint-format, test]
106
+
107
+ steps:
108
+ - uses: actions/checkout@v6
109
+
110
+ - name: Set up Python
111
+ uses: actions/setup-python@v6
112
+ with:
113
+ python-version: '3.12'
114
+
115
+ - name: Install uv
116
+ uses: astral-sh/setup-uv@v7
117
+
118
+ - name: Install dependencies
119
+ run: uv sync --python 3.12 --group dev
120
+
121
+ - name: Build package
122
+ run: uv build
123
+
124
+ - name: Check package
125
+ run: |
126
+ ls -lh dist/
127
+ uv run twine check dist/*
128
+
129
+ - name: Store distribution
130
+ uses: actions/upload-artifact@v7
131
+ with:
132
+ name: python-package-distributions
133
+ path: dist/
@@ -0,0 +1,43 @@
1
+ name: Deploy Documentation
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+
9
+ permissions:
10
+ contents: write
11
+
12
+ jobs:
13
+ deploy:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v6
17
+
18
+ - name: Set up Python
19
+ uses: actions/setup-python@v5
20
+ with:
21
+ python-version: '3.11'
22
+
23
+ - name: Install uv
24
+ uses: astral-sh/setup-uv@v7
25
+ with:
26
+ version: "latest"
27
+ enable-cache: true
28
+ cache-dependency-glob: "pyproject.toml"
29
+
30
+ - name: Install dependencies
31
+ run: |
32
+ uv sync --group doc
33
+
34
+ - name: Build documentation
35
+ run: uv run --group doc mkdocs build --clean
36
+
37
+ - name: Deploy to GitHub Pages
38
+ if: github.event_name == 'push' && github.ref == 'refs/heads/main'
39
+ uses: peaceiris/actions-gh-pages@v4
40
+ with:
41
+ github_token: ${{ secrets.GITHUB_TOKEN }}
42
+ publish_dir: ./site
43
+ publish_branch: gh-pages
@@ -0,0 +1,132 @@
1
+ name: Label PRs
2
+
3
+ on:
4
+ pull_request:
5
+ types: [opened, edited, synchronize]
6
+
7
+ permissions:
8
+ contents: read
9
+ pull-requests: write
10
+
11
+ jobs:
12
+ label:
13
+ # Disabled: fails on fork PRs due to token permissions
14
+ if: false
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - name: Checkout
18
+ uses: actions/checkout@v6
19
+
20
+ - name: Label PR based on files
21
+ uses: actions/labeler@v6
22
+ with:
23
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
24
+ configuration-path: .github/labeler.yml
25
+
26
+ - name: Label PR based on size
27
+ uses: actions/github-script@v8
28
+ with:
29
+ script: |
30
+ const pr = context.payload.pull_request;
31
+ const additions = pr.additions;
32
+ const deletions = pr.deletions;
33
+ const totalChanges = additions + deletions;
34
+
35
+ // Remove existing size labels
36
+ const existingLabels = pr.labels.map(label => label.name);
37
+ const sizeLabels = ['size/XS', 'size/S', 'size/M', 'size/L', 'size/XL'];
38
+ const labelsToRemove = existingLabels.filter(label => sizeLabels.includes(label));
39
+
40
+ for (const label of labelsToRemove) {
41
+ await github.rest.issues.removeLabel({
42
+ owner: context.repo.owner,
43
+ repo: context.repo.repo,
44
+ issue_number: pr.number,
45
+ name: label
46
+ });
47
+ }
48
+
49
+ // Determine size label
50
+ let sizeLabel;
51
+ if (totalChanges < 10) {
52
+ sizeLabel = 'size/XS';
53
+ } else if (totalChanges < 50) {
54
+ sizeLabel = 'size/S';
55
+ } else if (totalChanges < 200) {
56
+ sizeLabel = 'size/M';
57
+ } else if (totalChanges < 500) {
58
+ sizeLabel = 'size/L';
59
+ } else {
60
+ sizeLabel = 'size/XL';
61
+ }
62
+
63
+ // Add new size label
64
+ await github.rest.issues.addLabels({
65
+ owner: context.repo.owner,
66
+ repo: context.repo.repo,
67
+ issue_number: pr.number,
68
+ labels: [sizeLabel]
69
+ });
70
+
71
+ core.info(`Added label: ${sizeLabel} (${totalChanges} changes)`);
72
+
73
+ - name: Label PR based on title
74
+ uses: actions/github-script@v8
75
+ with:
76
+ script: |
77
+ const pr = context.payload.pull_request;
78
+ const title = pr.title.toLowerCase();
79
+
80
+ const labels = [];
81
+
82
+ // Conventional commit prefixes (case-insensitive with [] or () brackets)
83
+ const patterns = {
84
+ feat: /^(feat|FEAT)[\[:(]/,
85
+ fix: /^(fix|FIX)[\[:(]/,
86
+ docs: /^(docs|DOCS)[\[:(]/,
87
+ test: /^(test|TEST|tests|TESTS)[\[:(]/,
88
+ chore: /^(chore|CHORE)[\[:(]/,
89
+ refactor: /^(refactor|REFACTOR)[\[:(]/,
90
+ perf: /^(perf|PERF)[\[:(]/,
91
+ style: /^(style|STYLE)[\[:(]/,
92
+ ci: /^(ci|CI)[\[:(]/,
93
+ };
94
+
95
+ if (patterns.feat.test(pr.title)) {
96
+ labels.push('enhancement');
97
+ } else if (patterns.fix.test(pr.title)) {
98
+ labels.push('bug');
99
+ } else if (patterns.docs.test(pr.title)) {
100
+ labels.push('documentation');
101
+ } else if (patterns.test.test(pr.title)) {
102
+ labels.push('tests');
103
+ } else if (patterns.chore.test(pr.title)) {
104
+ labels.push('maintenance');
105
+ } else if (patterns.refactor.test(pr.title)) {
106
+ labels.push('refactor');
107
+ } else if (patterns.perf.test(pr.title)) {
108
+ labels.push('performance');
109
+ } else if (patterns.ci.test(pr.title)) {
110
+ labels.push('ci');
111
+ }
112
+
113
+ // Keywords
114
+ if (title.includes('breaking') || title.includes('breaking change')) {
115
+ labels.push('breaking-change');
116
+ }
117
+
118
+ if (title.includes('security')) {
119
+ labels.push('security');
120
+ }
121
+
122
+ // Add labels
123
+ if (labels.length > 0) {
124
+ await github.rest.issues.addLabels({
125
+ owner: context.repo.owner,
126
+ repo: context.repo.repo,
127
+ issue_number: pr.number,
128
+ labels: labels
129
+ });
130
+
131
+ core.info(`Added labels: ${labels.join(', ')}`);
132
+ }