fabricatio 0.5.0.dev0__tar.gz → 0.5.1.dev0__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 (241) hide show
  1. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/.github/workflows/build-package.yaml +3 -2
  2. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/PKG-INFO +13 -16
  3. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/README.md +12 -15
  4. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/examples/minor/hello_fabricatio.py +2 -8
  5. fabricatio-0.5.1.dev0/examples/yue/compose.py +22 -0
  6. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-yue/pyproject.toml +19 -6
  7. fabricatio-0.5.1.dev0/packages/fabricatio-yue/python/fabricatio_yue/actions/compose.py +16 -0
  8. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-yue/python/fabricatio_yue/capabilities/genre.py +37 -6
  9. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-yue/python/fabricatio_yue/capabilities/lyricize.py +12 -1
  10. fabricatio-0.5.1.dev0/packages/fabricatio-yue/python/fabricatio_yue/cli.py +60 -0
  11. fabricatio-0.5.1.dev0/packages/fabricatio-yue/python/fabricatio_yue/models/segment.py +137 -0
  12. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/pyproject.toml +1 -1
  13. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/python/fabricatio/actions/__init__.py +5 -0
  14. fabricatio-0.5.1.dev0/uv.lock +2705 -0
  15. fabricatio-0.5.0.dev0/packages/fabricatio-yue/python/fabricatio_yue/models/segment.py +0 -72
  16. fabricatio-0.5.0.dev0/uv.lock +0 -2696
  17. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/.github/workflows/ruff.yaml +0 -0
  18. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/.github/workflows/tests.yaml +0 -0
  19. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/.gitignore +0 -0
  20. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/.readthedocs.yaml +0 -0
  21. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/Cargo.lock +0 -0
  22. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/Cargo.toml +0 -0
  23. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/LICENSE +0 -0
  24. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/Makefile +0 -0
  25. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/assets/band.png +0 -0
  26. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/assets/logo/16.svg +0 -0
  27. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/assets/logo/400.svg +0 -0
  28. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/assets/logo/64.svg +0 -0
  29. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/docs/Makefile +0 -0
  30. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/docs/source/conf.py +0 -0
  31. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/docs/source/configuration.rst +0 -0
  32. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/docs/source/contributing.rst +0 -0
  33. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/docs/source/development.rst +0 -0
  34. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/docs/source/index.rst +0 -0
  35. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/docs/source/installation.rst +0 -0
  36. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/docs/source/usage.rst +0 -0
  37. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/examples/anki_deck/.gitignore +0 -0
  38. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/examples/anki_deck/deck_gen.py +0 -0
  39. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/examples/correct/correct.py +0 -0
  40. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/examples/correct/correct_loop.py +0 -0
  41. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/examples/extract_and_inject/.gitignore +0 -0
  42. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/examples/extract_and_inject/article_rag.py +0 -0
  43. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/examples/extract_and_inject/ask.py +0 -0
  44. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/examples/extract_and_inject/chunk_article.py +0 -0
  45. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/examples/extract_and_inject/extract_and_inject.py +0 -0
  46. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/examples/extract_article/extract.py +0 -0
  47. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/examples/llm_usages/llm_usage.py +0 -0
  48. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/examples/make_a_rating/rating.py +0 -0
  49. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/examples/make_diary/commits.json +0 -0
  50. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/examples/make_diary/diary.py +0 -0
  51. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/examples/minor/write_a_poem.py +0 -0
  52. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/examples/propose_task/.gitignore +0 -0
  53. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/examples/propose_task/propose.py +0 -0
  54. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/examples/reviewer/censor.py +0 -0
  55. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/examples/reviewer/review.py +0 -0
  56. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/examples/rules/.gitignore +0 -0
  57. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/examples/rules/draft_ruleset.py +0 -0
  58. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/examples/search_bibtex/.gitignore +0 -0
  59. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/examples/search_bibtex/search.py +0 -0
  60. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/examples/simple_chat/chat.py +0 -0
  61. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/examples/simple_rag/simple_rag.py +0 -0
  62. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/examples/task_handle/handle_task.py +0 -0
  63. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/examples/write_article/.gitignore +0 -0
  64. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/examples/write_article/article_rag.py +0 -0
  65. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/examples/write_article/post_process.py +0 -0
  66. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/examples/write_article/write_article.py +0 -0
  67. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/examples/write_outline/.gitignore +0 -0
  68. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/examples/write_outline/write_outline.py +0 -0
  69. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/examples/write_outline/write_outline_corrected.py +0 -0
  70. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/extra/scripts/tdown +0 -0
  71. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-actions/LICENSE +0 -0
  72. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-actions/README.md +0 -0
  73. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-actions/pyproject.toml +0 -0
  74. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-actions/python/fabricatio_actions/__init__.py +0 -0
  75. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-actions/python/fabricatio_actions/actions/__init__.py +0 -0
  76. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-actions/python/fabricatio_actions/actions/fs.py +0 -0
  77. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-actions/python/fabricatio_actions/actions/output.py +0 -0
  78. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-actions/python/fabricatio_actions/models/__init__.py +0 -0
  79. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-actions/python/fabricatio_actions/models/generic.py +0 -0
  80. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-actions/python/fabricatio_actions/py.typed +0 -0
  81. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-digest/.gitignore +0 -0
  82. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-digest/LICENSE +0 -0
  83. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-digest/README.md +0 -0
  84. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-digest/pyproject.toml +0 -0
  85. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-digest/python/fabricatio_digest/__init__.py +0 -0
  86. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-digest/python/fabricatio_digest/actions/__init__.py +0 -0
  87. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-digest/python/fabricatio_digest/capabilities/__init__.py +0 -0
  88. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-digest/python/fabricatio_digest/capabilities/digest.py +0 -0
  89. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-digest/python/fabricatio_digest/config.py +0 -0
  90. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-digest/python/fabricatio_digest/models/__init__.py +0 -0
  91. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-digest/python/fabricatio_digest/models/tasklist.py +0 -0
  92. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-digest/python/fabricatio_digest/py.typed +0 -0
  93. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-digest/python/fabricatio_digest/workflows/__init__.py +0 -0
  94. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-digest/python/tests/tests.py +0 -0
  95. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-improve/LICENSE +0 -0
  96. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-improve/README.md +0 -0
  97. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-improve/pyproject.toml +0 -0
  98. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-improve/python/fabricatio_improve/__init__.py +0 -0
  99. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-improve/python/fabricatio_improve/actions/__init__.py +0 -0
  100. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-improve/python/fabricatio_improve/capabilities/__init__.py +0 -0
  101. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-improve/python/fabricatio_improve/capabilities/correct.py +0 -0
  102. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-improve/python/fabricatio_improve/capabilities/review.py +0 -0
  103. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-improve/python/fabricatio_improve/config.py +0 -0
  104. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-improve/python/fabricatio_improve/models/__init__.py +0 -0
  105. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-improve/python/fabricatio_improve/models/improve.py +0 -0
  106. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-improve/python/fabricatio_improve/models/kwargs_types.py +0 -0
  107. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-improve/python/fabricatio_improve/models/problem.py +0 -0
  108. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-improve/python/fabricatio_improve/py.typed +0 -0
  109. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-improve/python/fabricatio_improve/workflows/__init__.py +0 -0
  110. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-judge/LICENSE +0 -0
  111. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-judge/README.md +0 -0
  112. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-judge/pyproject.toml +0 -0
  113. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-judge/python/fabricatio_judge/__init__.py +0 -0
  114. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-judge/python/fabricatio_judge/capabilities/__init__.py +0 -0
  115. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-judge/python/fabricatio_judge/capabilities/advanced_judge.py +0 -0
  116. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-judge/python/fabricatio_judge/models/__init__.py +0 -0
  117. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-judge/python/fabricatio_judge/models/advanced_judge.py +0 -0
  118. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-judge/python/fabricatio_judge/py.typed +0 -0
  119. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-question/.gitignore +0 -0
  120. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-question/LICENSE +0 -0
  121. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-question/README.md +0 -0
  122. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-question/pyproject.toml +0 -0
  123. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-question/python/fabricatio_question/__init__.py +0 -0
  124. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-question/python/fabricatio_question/actions/__init__.py +0 -0
  125. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-question/python/fabricatio_question/capabilities/__init__.py +0 -0
  126. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-question/python/fabricatio_question/capabilities/questioning.py +0 -0
  127. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-question/python/fabricatio_question/config.py +0 -0
  128. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-question/python/fabricatio_question/models/__init__.py +0 -0
  129. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-question/python/fabricatio_question/models/questions.py +0 -0
  130. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-question/python/fabricatio_question/py.typed +0 -0
  131. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-question/python/fabricatio_question/workflows/__init__.py +0 -0
  132. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-question/python/tests/tests.py +0 -0
  133. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-rule/LICENSE +0 -0
  134. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-rule/README.md +0 -0
  135. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-rule/pyproject.toml +0 -0
  136. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-rule/python/fabricatio_rule/__init__.py +0 -0
  137. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-rule/python/fabricatio_rule/actions/__init__.py +0 -0
  138. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-rule/python/fabricatio_rule/actions/rules.py +0 -0
  139. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-rule/python/fabricatio_rule/capabilities/__init__.py +0 -0
  140. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-rule/python/fabricatio_rule/capabilities/censor.py +0 -0
  141. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-rule/python/fabricatio_rule/capabilities/check.py +0 -0
  142. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-rule/python/fabricatio_rule/config.py +0 -0
  143. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-rule/python/fabricatio_rule/models/__init__.py +0 -0
  144. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-rule/python/fabricatio_rule/models/kwargs_types.py +0 -0
  145. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-rule/python/fabricatio_rule/models/patch.py +0 -0
  146. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-rule/python/fabricatio_rule/models/rule.py +0 -0
  147. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-rule/python/fabricatio_rule/py.typed +0 -0
  148. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-tagging/.gitignore +0 -0
  149. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-tagging/LICENSE +0 -0
  150. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-tagging/README.md +0 -0
  151. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-tagging/pyproject.toml +0 -0
  152. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-tagging/python/fabricatio_tagging/__init__.py +0 -0
  153. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-tagging/python/fabricatio_tagging/actions/__init__.py +0 -0
  154. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-tagging/python/fabricatio_tagging/capabilities/__init__.py +0 -0
  155. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-tagging/python/fabricatio_tagging/capabilities/tagging.py +0 -0
  156. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-tagging/python/fabricatio_tagging/config.py +0 -0
  157. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-tagging/python/fabricatio_tagging/models/__init__.py +0 -0
  158. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-tagging/python/fabricatio_tagging/py.typed +0 -0
  159. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-tagging/python/fabricatio_tagging/workflows/__init__.py +0 -0
  160. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-tagging/python/tests/tests.py +0 -0
  161. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-yue/.gitignore +0 -0
  162. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-yue/LICENSE +0 -0
  163. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-yue/README.md +0 -0
  164. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-yue/python/fabricatio_yue/__init__.py +0 -0
  165. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-yue/python/fabricatio_yue/actions/__init__.py +0 -0
  166. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-yue/python/fabricatio_yue/capabilities/__init__.py +0 -0
  167. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-yue/python/fabricatio_yue/config.py +0 -0
  168. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-yue/python/fabricatio_yue/models/__init__.py +0 -0
  169. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-yue/python/fabricatio_yue/py.typed +0 -0
  170. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-yue/python/fabricatio_yue/top_200_tags.json +0 -0
  171. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-yue/python/fabricatio_yue/workflows/__init__.py +0 -0
  172. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/packages/fabricatio-yue/python/tests/tests.py +0 -0
  173. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/python/fabricatio/__init__.py +0 -0
  174. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/python/fabricatio/capabilities/__init__.py +0 -0
  175. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/python/fabricatio/models/__init__.py +0 -0
  176. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/python/fabricatio/py.typed +0 -0
  177. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/python/fabricatio/toolboxes/__init__.py +0 -0
  178. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/python/fabricatio/toolboxes/arithmetic.py +0 -0
  179. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/python/fabricatio/toolboxes/fs.py +0 -0
  180. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/python/fabricatio/workflows/__init__.py +0 -0
  181. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/python/tests/test_minor_integration.py +0 -0
  182. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/src/bin/tdown.rs +0 -0
  183. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/src/lib.rs +0 -0
  184. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/subpackages.py +0 -0
  185. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/as_prompt.hbs +0 -0
  186. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/binary-exploitation-ctf-solver.hbs +0 -0
  187. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/chap_summary.hbs +0 -0
  188. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/check_string.hbs +0 -0
  189. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/claude-xml.hbs +0 -0
  190. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/clean-up-code.hbs +0 -0
  191. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/co_validation.hbs +0 -0
  192. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/code_string.hbs +0 -0
  193. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/create_json_obj.hbs +0 -0
  194. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/cryptography-ctf-solver.hbs +0 -0
  195. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/dependencies.hbs +0 -0
  196. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/digest.hbs +0 -0
  197. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/dispatch_task.hbs +0 -0
  198. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/document-the-code.hbs +0 -0
  199. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/draft_rating_criteria.hbs +0 -0
  200. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/draft_rating_manual.hbs +0 -0
  201. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/draft_rating_weights_klee.hbs +0 -0
  202. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/draft_tool_usage_code.hbs +0 -0
  203. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/extract.hbs +0 -0
  204. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/extract_criteria_from_reasons.hbs +0 -0
  205. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/extract_reasons_from_examples.hbs +0 -0
  206. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/find-security-vulnerabilities.hbs +0 -0
  207. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/fix-bugs.hbs +0 -0
  208. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/fix_troubled_obj.hbs +0 -0
  209. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/fix_troubled_string.hbs +0 -0
  210. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/generate_anki_card_back_side.hbs +0 -0
  211. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/generate_anki_card_front_side.hbs +0 -0
  212. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/generate_anki_card_template.hbs +0 -0
  213. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/generate_anki_card_template_generation_requirements.hbs +0 -0
  214. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/generate_anki_deck_metadata.hbs +0 -0
  215. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/generate_anki_model_generation_requirements.hbs +0 -0
  216. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/generate_anki_model_name.hbs +0 -0
  217. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/generic_string.hbs +0 -0
  218. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/improve-performance.hbs +0 -0
  219. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/liststr.hbs +0 -0
  220. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/lyricize.hbs +0 -0
  221. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/make_choice.hbs +0 -0
  222. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/make_judgment.hbs +0 -0
  223. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/mapping.hbs +0 -0
  224. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/pathstr.hbs +0 -0
  225. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/rate_fine_grind.hbs +0 -0
  226. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/refactor.hbs +0 -0
  227. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/refined_query.hbs +0 -0
  228. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/research_content_summary.hbs +0 -0
  229. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/retrieved_display.hbs +0 -0
  230. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/reverse-engineering-ctf-solver.hbs +0 -0
  231. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/review_string.hbs +0 -0
  232. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/rule_requirement.hbs +0 -0
  233. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/ruleset_requirement_breakdown.hbs +0 -0
  234. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/select_genre.hbs +0 -0
  235. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/selection.hbs +0 -0
  236. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/tagging.hbs +0 -0
  237. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/task_briefing.hbs +0 -0
  238. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/web-ctf-solver.hbs +0 -0
  239. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/write-git-commit.hbs +0 -0
  240. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/write-github-pull-request.hbs +0 -0
  241. {fabricatio-0.5.0.dev0 → fabricatio-0.5.1.dev0}/templates/built-in/write-github-readme.hbs +0 -0
@@ -70,7 +70,7 @@ jobs:
70
70
 
71
71
 
72
72
  create-release:
73
- if: needs.determine_changes.outputs.version_changed == 'true'
73
+ if: needs.determine_changes.outputs.version_changed == 'true' && github.event_name != 'pull_request'
74
74
  name: Create Release
75
75
  needs: determine_changes
76
76
  runs-on: ubuntu-latest
@@ -124,7 +124,7 @@ jobs:
124
124
  uv sync --no-install-project --only-dev --index https://pypi.org/simple -p ${{ matrix.python-version }}
125
125
 
126
126
  - name: Upload to PyPI
127
- if: needs.determine_changes.outputs.version_changed == 'true'
127
+ if: needs.determine_changes.outputs.version_changed == 'true' && github.event_name != 'pull_request'
128
128
  run: |
129
129
  make publish PY=${{ matrix.python-version }}
130
130
  env:
@@ -134,6 +134,7 @@ jobs:
134
134
  UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
135
135
 
136
136
  - name: Upload assets
137
+ if: github.event_name != 'pull_request'
137
138
  uses: softprops/action-gh-release@v2
138
139
  with:
139
140
  tag_name: ${{ needs.determine_changes.outputs.current_version }}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fabricatio
3
- Version: 0.5.0.dev0
3
+ Version: 0.5.1.dev0
4
4
  Classifier: License :: OSI Approved :: MIT License
5
5
  Classifier: Programming Language :: Rust
6
6
  Classifier: Programming Language :: Python :: 3.12
@@ -119,35 +119,32 @@ make bdist
119
119
  ### Basic Example
120
120
 
121
121
  ```python
122
- import asyncio
123
- from fabricatio import Action, Role, Task, logger, WorkFlow, Event
122
+ """Example of a simple hello world program using fabricatio."""
123
+
124
124
  from typing import Any
125
125
 
126
+ from fabricatio import Action, Event, Role, Task, WorkFlow, logger
127
+
126
128
 
127
129
  class Hello(Action):
128
- name: str = "hello"
130
+ """Action that says hello."""
131
+
129
132
  output_key: str = "task_output"
130
133
 
131
- async def _execute(self, task_input: Task[str], **_) -> Any:
134
+ async def _execute(self, **_) -> Any:
132
135
  ret = "Hello fabricatio!"
133
136
  logger.info("executing talk action")
134
137
  return ret
135
138
 
139
+ """Main function."""
136
140
 
137
- async def main() -> None:
138
- Role(
139
- name="talker",
140
- description="talker role",
141
- registry={Event.quick_instantiate("talk"): WorkFlow(name="talk", steps=(Hello,))}
142
- )
143
141
 
144
- task = Task(name="say hello", goals=["say hello"], description="say hello to the world")
145
- result = await task.delegate("talk")
146
- logger.success(f"Result: {result}")
142
+ (Role()
143
+ .register_workflow(Event.quick_instantiate("talk"), WorkFlow(name="talk", steps=(Hello,)))
144
+ .dispatch())
147
145
 
146
+ assert Task(name="say hello").delegate_blocking("talk") == "Hello fabricatio!"
148
147
 
149
- if __name__ == "__main__":
150
- asyncio.run(main())
151
148
  ```
152
149
 
153
150
  ### Examples
@@ -67,35 +67,32 @@ make bdist
67
67
  ### Basic Example
68
68
 
69
69
  ```python
70
- import asyncio
71
- from fabricatio import Action, Role, Task, logger, WorkFlow, Event
70
+ """Example of a simple hello world program using fabricatio."""
71
+
72
72
  from typing import Any
73
73
 
74
+ from fabricatio import Action, Event, Role, Task, WorkFlow, logger
75
+
74
76
 
75
77
  class Hello(Action):
76
- name: str = "hello"
78
+ """Action that says hello."""
79
+
77
80
  output_key: str = "task_output"
78
81
 
79
- async def _execute(self, task_input: Task[str], **_) -> Any:
82
+ async def _execute(self, **_) -> Any:
80
83
  ret = "Hello fabricatio!"
81
84
  logger.info("executing talk action")
82
85
  return ret
83
86
 
87
+ """Main function."""
84
88
 
85
- async def main() -> None:
86
- Role(
87
- name="talker",
88
- description="talker role",
89
- registry={Event.quick_instantiate("talk"): WorkFlow(name="talk", steps=(Hello,))}
90
- )
91
89
 
92
- task = Task(name="say hello", goals=["say hello"], description="say hello to the world")
93
- result = await task.delegate("talk")
94
- logger.success(f"Result: {result}")
90
+ (Role()
91
+ .register_workflow(Event.quick_instantiate("talk"), WorkFlow(name="talk", steps=(Hello,)))
92
+ .dispatch())
95
93
 
94
+ assert Task(name="say hello").delegate_blocking("talk") == "Hello fabricatio!"
96
95
 
97
- if __name__ == "__main__":
98
- asyncio.run(main())
99
96
  ```
100
97
 
101
98
  ### Examples
@@ -20,12 +20,6 @@ class Hello(Action):
20
20
  """Main function."""
21
21
 
22
22
 
23
- Role(
24
- name="talker",
25
- description="talker role",
26
- registry={Event.quick_instantiate("talk"): WorkFlow(name="talk", steps=(Hello,))},
27
- )
23
+ (Role().register_workflow(Event.quick_instantiate("talk"), WorkFlow(name="talk", steps=(Hello,))).dispatch())
28
24
 
29
-
30
- if __name__ == "__main__":
31
- task.delegate_blocking("talk")
25
+ logger.success(task.delegate_blocking("talk"))
@@ -0,0 +1,22 @@
1
+ """Example of using the library."""
2
+
3
+ from fabricatio import Event, Role, Task, WorkFlow
4
+ from fabricatio.actions import Compose
5
+ from fabricatio.models import Song
6
+ from fabricatio_core.utils import ok
7
+
8
+ (
9
+ Role()
10
+ .register_workflow(Event.quick_instantiate(ns := "generate_deck"), WorkFlow(steps=(Compose().to_task_output(),)))
11
+ .dispatch()
12
+ )
13
+
14
+ generated_song: Song = ok(
15
+ Task(name="gen deck")
16
+ .update_init_context(
17
+ req="Write a folk-rock song about finding hope in difficult times, with verses about struggle and a uplifting "
18
+ "chorus about perseverance. Include bridge section with introspective lyrics.",
19
+ output="here",
20
+ )
21
+ .delegate_blocking(ns)
22
+ )
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "fabricatio-yue"
3
- version = "0.1.0-dev7"
3
+ version = "0.2.0-dev1"
4
4
  description = "An extension of fabricatio, provide capability to compose lyrics that can be used in music generation with YuE."
5
5
  readme = "README.md"
6
6
  license = { file = "LICENSE" }
@@ -29,6 +29,12 @@ dev = [
29
29
  "pytest",
30
30
  ]
31
31
 
32
+ [project.optional-dependencies]
33
+ cli = [
34
+ "questionary>=2.1.0",
35
+ "typer-slim[standard]>=0.15.2",
36
+ ]
37
+
32
38
 
33
39
  [build-system]
34
40
  requires = ["hatchling"]
@@ -41,16 +47,23 @@ sources = ["python"]
41
47
  url = "https://mirrors.bfsu.edu.cn/pypi/web/simple"
42
48
  default = true
43
49
 
44
- [[tool.uv.index]]
45
- url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple"
46
-
47
- [[tool.uv.index]]
48
- url = "https://mirrors.huaweicloud.com/repository/pypi/simple"
50
+ [tool.uv.sources]
51
+ fabricatio = { workspace = true }
49
52
 
50
53
  [project.urls]
51
54
  Homepage = "https://github.com/Whth/fabricatio"
52
55
  Repository = "https://github.com/Whth/fabricatio"
53
56
  Issues = "https://github.com/Whth/fabricatio/issues"
54
57
 
58
+ [[tool.uv.index]]
59
+ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple"
60
+
61
+ [[tool.uv.index]]
62
+ url = "https://mirrors.huaweicloud.com/repository/pypi/simple"
63
+
55
64
  [[tool.uv.index]]
56
65
  url = "https://mirrors.aliyun.com/pypi/simple/"
66
+
67
+
68
+ [project.scripts]
69
+ yuek = "fabricatio_yue.cli:main"
@@ -0,0 +1,16 @@
1
+ """Compose action for creating songs."""
2
+
3
+ from pathlib import Path
4
+
5
+ from fabricatio import Action
6
+ from fabricatio.capabilities import Lyricize
7
+ from fabricatio_core.utils import ok
8
+
9
+ from fabricatio_yue.models.segment import Song
10
+
11
+
12
+ class Compose(Action, Lyricize):
13
+ """Compose a song."""
14
+
15
+ async def _execute(self, req: str, output: Path, **cxt) -> Song:
16
+ return ok(await self.lyricize(req)).save_to(output)
@@ -3,6 +3,7 @@
3
3
  from typing import List, Unpack, overload
4
4
 
5
5
  from fabricatio_core import TEMPLATE_MANAGER
6
+ from fabricatio_core.journal import logger
6
7
  from fabricatio_core.models.kwargs_types import ValidateKwargs
7
8
  from fabricatio_core.models.usages import LLMUsage
8
9
  from more_itertools import flatten
@@ -79,16 +80,20 @@ class SelectGenre(LLMUsage):
79
80
  For multiple requirements: List where each element is either a list of genres or None.
80
81
  """
81
82
  if isinstance(requirement, str):
82
- return await self.alist_str(
83
+ logger.debug("Processing single requirement")
84
+ result = await self.alist_str(
83
85
  TEMPLATE_MANAGER.render_template(
84
86
  yue_config.select_genre_template,
85
87
  {"requirement": requirement, "genre_classifier": genre_classifier, "genres": genres},
86
88
  ),
87
89
  **kwargs,
88
90
  )
91
+ logger.debug(f"Selected genres for single requirement: {result}")
92
+ return result
89
93
  if isinstance(requirement, list):
94
+ logger.debug(f"Processing {len(requirement)} requirements")
90
95
  # Handle list of requirements
91
- return await self.alist_str(
96
+ result = await self.alist_str(
92
97
  TEMPLATE_MANAGER.render_template(
93
98
  yue_config.select_genre_template,
94
99
  [
@@ -98,7 +103,12 @@ class SelectGenre(LLMUsage):
98
103
  ),
99
104
  **kwargs,
100
105
  )
101
- raise TypeError(f"requirement must be str or List[str], got {type(requirement)}")
106
+ logger.debug(f"Selected genres for multiple requirements: {result}")
107
+ return result
108
+
109
+ error_msg = f"requirement must be str or List[str], got {type(requirement)}"
110
+ logger.error(error_msg)
111
+ raise TypeError(error_msg)
102
112
 
103
113
  @overload
104
114
  async def gather_genres(
@@ -154,6 +164,9 @@ class SelectGenre(LLMUsage):
154
164
  """
155
165
  import asyncio
156
166
 
167
+ logger.debug(f"Gathering genres for requirements: {requirements}")
168
+ logger.debug(f"Available genre categories: {list(yue_config.genre.keys())}")
169
+
157
170
  async def gather_for_single_requirement(req: str) -> List[str] | None:
158
171
  """Gather genres for a single requirement from all categories.
159
172
 
@@ -163,19 +176,37 @@ class SelectGenre(LLMUsage):
163
176
  Returns:
164
177
  List[str] | None: A list of selected genres from all categories, or None if no genres are found.
165
178
  """
179
+ logger.debug(f"Gathering genres for single requirement: {req}")
180
+
166
181
  results = await asyncio.gather(
167
182
  *[
168
183
  self.select_genre(req, genre_classifier, genres, **kwargs)
169
184
  for genre_classifier, genres in yue_config.genre.items()
170
185
  ]
171
186
  )
187
+
188
+ logger.debug(f"Raw results from genre selection: {results}")
189
+
172
190
  # Flatten the results from all genre categories, filtering out any None responses
173
191
  selected_genres = list(flatten(result for result in results if result))
174
- return selected_genres if selected_genres else None
192
+
193
+ logger.debug(f"Flattened selected genres: {selected_genres}")
194
+
195
+ final_result = selected_genres if selected_genres else None
196
+ logger.debug(f"Final result for requirement '{req}': {final_result}")
197
+
198
+ return final_result
175
199
 
176
200
  if isinstance(requirements, str):
201
+ logger.debug("Processing single requirement string")
177
202
  return await gather_for_single_requirement(requirements)
178
203
  if isinstance(requirements, list):
204
+ logger.debug(f"Processing {len(requirements)} requirement strings")
179
205
  tasks = [gather_for_single_requirement(req) for req in requirements]
180
- return await asyncio.gather(*tasks)
181
- raise TypeError(f"requirements must be str or List[str], got {type(requirements)}")
206
+ result = await asyncio.gather(*tasks)
207
+ logger.debug(f"Results for all requirements: {result}")
208
+ return result
209
+
210
+ error_msg = f"requirements must be str or List[str], got {type(requirements)}"
211
+ logger.error(error_msg)
212
+ raise TypeError(error_msg)
@@ -4,6 +4,7 @@ from typing import List, Unpack, overload
4
4
 
5
5
  from fabricatio_core import TEMPLATE_MANAGER
6
6
  from fabricatio_core.capabilities.propose import Propose
7
+ from fabricatio_core.journal import logger
7
8
  from fabricatio_core.models.kwargs_types import ValidateKwargs
8
9
  from fabricatio_core.utils import ok, override_kwargs
9
10
 
@@ -58,6 +59,7 @@ class Lyricize(Propose, SelectGenre):
58
59
  Returns:
59
60
  Song | None | List[Song | None]: Generated lyrics as Song object, list of Song objects, or None based on input type
60
61
  """
62
+ logger.debug(f"Lyricizing requirements: {requirement}")
61
63
  okwargs = override_kwargs(kwargs, default=None)
62
64
 
63
65
  async def lyricize_single(req: str) -> Song | None:
@@ -69,20 +71,29 @@ class Lyricize(Propose, SelectGenre):
69
71
  Returns:
70
72
  Song | None: A Song object containing generated lyrics and metadata, or None if generation fails.
71
73
  """
74
+ logger.debug(f"Processing single lyricize requirement: {req}")
72
75
  genres = ok(await self.gather_genres(req, **okwargs))
76
+ logger.debug(f"Gathered genres for requirement: {genres}")
77
+
73
78
  prompt = TEMPLATE_MANAGER.render_template(
74
79
  yue_config.lyricize_template,
75
80
  {"requirement": req, "genres": genres, "section_types": yue_config.segment_types},
76
81
  )
82
+ logger.debug(f"Generated prompt for lyricize: {prompt}")
83
+
77
84
  return await self.propose(Song, prompt, **kwargs)
78
85
 
79
86
  if isinstance(requirement, str):
87
+ logger.debug("Processing single requirement string")
80
88
  return await lyricize_single(requirement)
81
89
 
82
90
  if isinstance(requirement, list):
91
+ logger.debug(f"Processing {len(requirement)} requirement strings")
83
92
  import asyncio
84
93
 
85
94
  tasks = [lyricize_single(req) for req in requirement]
86
95
  return await asyncio.gather(*tasks)
87
96
 
88
- raise TypeError(f"Invalid requirement type: {type(requirement)}. Expected str or List[str].")
97
+ error_msg = f"Invalid requirement type: {type(requirement)}. Expected str or List[str]."
98
+ logger.error(error_msg)
99
+ raise TypeError(error_msg)
@@ -0,0 +1,60 @@
1
+ """Command-line interface for Fabricatio Yue song composition."""
2
+
3
+ from importlib.util import find_spec
4
+
5
+ from fabricatio_core.decorators import precheck_package
6
+
7
+ if not find_spec("typer"):
8
+ raise ModuleNotFoundError(
9
+ "Please install fabricatio-yue with 'pip install fabricatio-yue[cli]' or 'uv tool install fabricatio-yue[cli]'"
10
+ )
11
+
12
+ from pathlib import Path
13
+
14
+ from typer import Option, Typer
15
+
16
+ app = Typer(
17
+ name="yuek",
18
+ help="Compose lyrics with Fabricatio!",
19
+ epilog="For more information, visit: https://github.com/Whth/fabricatio",
20
+ short_help="Fabricatio Yue CLI for song composition",
21
+ )
22
+
23
+
24
+ @app.command()
25
+ @precheck_package(
26
+ "questionary",
27
+ "Please install fabricatio-yue with 'pip install fabricatio-yue[cli]' or 'uv tool install fabricatio-yue[cli]'",
28
+ )
29
+ def compose(
30
+ requirement: str = Option(None, "-r", "--requirement", help="Song requirement/prompt"),
31
+ output: Path = Option(Path("song"), "-o", "--output", help="Output file folder"),
32
+ ) -> None:
33
+ """Compose a song based on your requirements."""
34
+ from fabricatio import Event, Role, Task, WorkFlow
35
+ from fabricatio_core.utils import ok
36
+ from questionary import text
37
+
38
+ from fabricatio_yue.actions.compose import Compose
39
+
40
+ Role().register_workflow(
41
+ Event.quick_instantiate(ns := "compose"), WorkFlow(steps=(Compose().to_task_output(),))
42
+ ).dispatch()
43
+
44
+ ok(
45
+ Task(name="compose song")
46
+ .update_init_context(
47
+ req=(
48
+ requirement
49
+ or ok(text("What kind of song would you like to compose?").ask(), "No requirement provided!")
50
+ ),
51
+ output=output,
52
+ )
53
+ .delegate_blocking(ns),
54
+ "Failed to compose song!",
55
+ )
56
+
57
+
58
+ def main() -> None:
59
+ """Entry point for the CLI application."""
60
+ app()
@@ -0,0 +1,137 @@
1
+ """Models for representing song segments and complete songs.
2
+
3
+ This module provides the data structures for working with songs and their
4
+ component segments in the Fabricatio YUE system. Songs are composed of
5
+ multiple segments, each with their own properties like duration, genre tags,
6
+ and lyrics.
7
+ """
8
+
9
+ from pathlib import Path
10
+ from typing import List, Self
11
+
12
+ from fabricatio_core import logger
13
+ from fabricatio_core.models.generic import SketchedAble, WithBriefing
14
+ from pydantic import NonNegativeInt, PrivateAttr
15
+
16
+
17
+ class Segment(SketchedAble):
18
+ """Represents a segment of a song with its attributes."""
19
+
20
+ section_type: str
21
+ """Type of section."""
22
+
23
+ duration: NonNegativeInt
24
+ """Duration of the segment in seconds"""
25
+ lyrics: List[str]
26
+ """Lyrics for this segment as a list of lines"""
27
+ _extra_genres: List[str] = PrivateAttr(default_factory=list)
28
+ """Additional genre tags for this segment"""
29
+
30
+ def override_extra_genres(self, genres: List[str]) -> Self:
31
+ """Override the genre tags for this segment.
32
+
33
+ Args:
34
+ genres (List[str]): New list of genre tags
35
+ """
36
+ self._extra_genres = genres
37
+ return self
38
+
39
+ @property
40
+ def extra_genres(self) -> List[str]:
41
+ """Get the additional genre tags for this segment.
42
+
43
+ Returns:
44
+ List[str]: List of genre tags
45
+ """
46
+ return self._extra_genres
47
+
48
+ @property
49
+ def assemble(self) -> str:
50
+ """Assemble the segment into a formatted string representation.
51
+
52
+ Returns:
53
+ str: A formatted string with section type header and lyrics
54
+ """
55
+ return f"[{self.section_type}]\n" + "\n".join(self.lyrics) + "\n"
56
+
57
+
58
+ class Song(SketchedAble, WithBriefing):
59
+ """Represents a complete song with its attributes and segments."""
60
+
61
+ genres: List[str]
62
+ """Primary genre classifications for the entire song"""
63
+ segments: List[Segment]
64
+ """Ordered list of segments that compose the song"""
65
+
66
+ @property
67
+ def duration(self) -> NonNegativeInt:
68
+ """Total duration of the song in seconds.
69
+
70
+ Calculated by summing the durations of all segments in the song.
71
+
72
+ Returns:
73
+ NonNegativeInt: The total duration in seconds
74
+ """
75
+ return sum(segment.duration for segment in self.segments)
76
+
77
+ def override_genres(self, genres: List[str]) -> Self:
78
+ """Override the primary genre tags for the entire song.
79
+
80
+ Args:
81
+ genres (List[str]): New list of genre tags
82
+ """
83
+ self.genres.clear()
84
+ self.genres.extend(genres)
85
+ return self
86
+
87
+ @property
88
+ def briefing(self) -> str:
89
+ """Generate a briefing of the song including its genre tags and duration."""
90
+ return f"# {self.name}\n>{self.description}\n\nDuration: {self.duration} s.\n\n{self.block(' '.join(self.genres), 'genres')} \n\n---\n"
91
+
92
+ def save_to(self, parent_dir: str | Path) -> Self:
93
+ """Save the song to a directory.
94
+
95
+ Args:
96
+ parent_dir (str): The directory to save the song to
97
+ """
98
+ parent_path = Path(parent_dir)
99
+ parent_path.mkdir(parents=True, exist_ok=True)
100
+
101
+ # Create filename from song name or use default
102
+ file_path = parent_path / f"{self.name}.md"
103
+
104
+ logger.info(f"Saving song to {file_path.as_posix()}")
105
+
106
+ out = f"{self.briefing}\n" + "\n".join(
107
+ f"## Section {i}. {seg.section_type.capitalize()}\n\n{self._wrapp(seg)}"
108
+ for i, seg in enumerate(self.segments)
109
+ )
110
+
111
+ file_path.write_text(out, encoding="utf-8")
112
+
113
+ return self
114
+
115
+ def _wrapp(self, segment: Segment) -> str:
116
+ return (
117
+ f"Duration: {segment.duration} s.\n\n"
118
+ + (
119
+ f"Extra Genres: {self.block(' '.join(segment.extra_genres), 'genres')}\n"
120
+ f"Assembled Genres: {self.block(' '.join(self.genres + segment.extra_genres), 'genres')}"
121
+ )
122
+ if segment.extra_genres
123
+ else "" + f"Lyrics:{self.block(segment.assemble, 'lyrics')}"
124
+ )
125
+
126
+ @staticmethod
127
+ def block(content: str, lang: str = "text") -> str:
128
+ """Create a markdown code block with the specified language.
129
+
130
+ Args:
131
+ content (str): The content to wrap in the code block
132
+ lang (str, optional): The language identifier for syntax highlighting. Defaults to 'text'
133
+
134
+ Returns:
135
+ str: A formatted markdown code block
136
+ """
137
+ return f"\n```{lang}\n{content}\n```\n"
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "fabricatio"
3
- version = "0.5.0-dev0"
3
+ version = "0.5.1-dev0"
4
4
  description = "A LLM multi-agent framework."
5
5
  readme = "README.md"
6
6
  license = { file = "LICENSE" }
@@ -67,3 +67,8 @@ if find_spec("fabricatio_actions"):
67
67
  "RetrieveFromLatest",
68
68
  "RetrieveFromPersistent",
69
69
  ]
70
+
71
+ if find_spec("fabricatio_yue"):
72
+ from fabricatio_yue.actions.compose import Compose
73
+
74
+ __all__ += ["Compose"]