fabricatio 0.5.0.dev0__tar.gz → 0.5.0.dev1__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 (239) hide show
  1. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/.github/workflows/build-package.yaml +3 -2
  2. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/PKG-INFO +1 -1
  3. fabricatio-0.5.0.dev1/examples/yue/compose.py +32 -0
  4. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-yue/pyproject.toml +1 -1
  5. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-yue/python/fabricatio_yue/capabilities/genre.py +37 -6
  6. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-yue/python/fabricatio_yue/capabilities/lyricize.py +12 -1
  7. fabricatio-0.5.0.dev1/packages/fabricatio-yue/python/fabricatio_yue/models/segment.py +134 -0
  8. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/pyproject.toml +1 -1
  9. fabricatio-0.5.0.dev1/uv.lock +2696 -0
  10. fabricatio-0.5.0.dev0/packages/fabricatio-yue/python/fabricatio_yue/models/segment.py +0 -72
  11. fabricatio-0.5.0.dev0/uv.lock +0 -2696
  12. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/.github/workflows/ruff.yaml +0 -0
  13. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/.github/workflows/tests.yaml +0 -0
  14. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/.gitignore +0 -0
  15. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/.readthedocs.yaml +0 -0
  16. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/Cargo.lock +0 -0
  17. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/Cargo.toml +0 -0
  18. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/LICENSE +0 -0
  19. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/Makefile +0 -0
  20. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/README.md +0 -0
  21. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/assets/band.png +0 -0
  22. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/assets/logo/16.svg +0 -0
  23. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/assets/logo/400.svg +0 -0
  24. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/assets/logo/64.svg +0 -0
  25. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/docs/Makefile +0 -0
  26. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/docs/source/conf.py +0 -0
  27. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/docs/source/configuration.rst +0 -0
  28. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/docs/source/contributing.rst +0 -0
  29. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/docs/source/development.rst +0 -0
  30. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/docs/source/index.rst +0 -0
  31. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/docs/source/installation.rst +0 -0
  32. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/docs/source/usage.rst +0 -0
  33. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/examples/anki_deck/.gitignore +0 -0
  34. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/examples/anki_deck/deck_gen.py +0 -0
  35. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/examples/correct/correct.py +0 -0
  36. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/examples/correct/correct_loop.py +0 -0
  37. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/examples/extract_and_inject/.gitignore +0 -0
  38. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/examples/extract_and_inject/article_rag.py +0 -0
  39. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/examples/extract_and_inject/ask.py +0 -0
  40. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/examples/extract_and_inject/chunk_article.py +0 -0
  41. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/examples/extract_and_inject/extract_and_inject.py +0 -0
  42. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/examples/extract_article/extract.py +0 -0
  43. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/examples/llm_usages/llm_usage.py +0 -0
  44. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/examples/make_a_rating/rating.py +0 -0
  45. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/examples/make_diary/commits.json +0 -0
  46. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/examples/make_diary/diary.py +0 -0
  47. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/examples/minor/hello_fabricatio.py +0 -0
  48. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/examples/minor/write_a_poem.py +0 -0
  49. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/examples/propose_task/.gitignore +0 -0
  50. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/examples/propose_task/propose.py +0 -0
  51. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/examples/reviewer/censor.py +0 -0
  52. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/examples/reviewer/review.py +0 -0
  53. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/examples/rules/.gitignore +0 -0
  54. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/examples/rules/draft_ruleset.py +0 -0
  55. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/examples/search_bibtex/.gitignore +0 -0
  56. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/examples/search_bibtex/search.py +0 -0
  57. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/examples/simple_chat/chat.py +0 -0
  58. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/examples/simple_rag/simple_rag.py +0 -0
  59. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/examples/task_handle/handle_task.py +0 -0
  60. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/examples/write_article/.gitignore +0 -0
  61. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/examples/write_article/article_rag.py +0 -0
  62. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/examples/write_article/post_process.py +0 -0
  63. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/examples/write_article/write_article.py +0 -0
  64. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/examples/write_outline/.gitignore +0 -0
  65. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/examples/write_outline/write_outline.py +0 -0
  66. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/examples/write_outline/write_outline_corrected.py +0 -0
  67. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/extra/scripts/tdown +0 -0
  68. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-actions/LICENSE +0 -0
  69. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-actions/README.md +0 -0
  70. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-actions/pyproject.toml +0 -0
  71. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-actions/python/fabricatio_actions/__init__.py +0 -0
  72. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-actions/python/fabricatio_actions/actions/__init__.py +0 -0
  73. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-actions/python/fabricatio_actions/actions/fs.py +0 -0
  74. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-actions/python/fabricatio_actions/actions/output.py +0 -0
  75. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-actions/python/fabricatio_actions/models/__init__.py +0 -0
  76. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-actions/python/fabricatio_actions/models/generic.py +0 -0
  77. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-actions/python/fabricatio_actions/py.typed +0 -0
  78. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-digest/.gitignore +0 -0
  79. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-digest/LICENSE +0 -0
  80. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-digest/README.md +0 -0
  81. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-digest/pyproject.toml +0 -0
  82. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-digest/python/fabricatio_digest/__init__.py +0 -0
  83. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-digest/python/fabricatio_digest/actions/__init__.py +0 -0
  84. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-digest/python/fabricatio_digest/capabilities/__init__.py +0 -0
  85. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-digest/python/fabricatio_digest/capabilities/digest.py +0 -0
  86. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-digest/python/fabricatio_digest/config.py +0 -0
  87. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-digest/python/fabricatio_digest/models/__init__.py +0 -0
  88. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-digest/python/fabricatio_digest/models/tasklist.py +0 -0
  89. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-digest/python/fabricatio_digest/py.typed +0 -0
  90. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-digest/python/fabricatio_digest/workflows/__init__.py +0 -0
  91. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-digest/python/tests/tests.py +0 -0
  92. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-improve/LICENSE +0 -0
  93. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-improve/README.md +0 -0
  94. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-improve/pyproject.toml +0 -0
  95. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-improve/python/fabricatio_improve/__init__.py +0 -0
  96. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-improve/python/fabricatio_improve/actions/__init__.py +0 -0
  97. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-improve/python/fabricatio_improve/capabilities/__init__.py +0 -0
  98. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-improve/python/fabricatio_improve/capabilities/correct.py +0 -0
  99. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-improve/python/fabricatio_improve/capabilities/review.py +0 -0
  100. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-improve/python/fabricatio_improve/config.py +0 -0
  101. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-improve/python/fabricatio_improve/models/__init__.py +0 -0
  102. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-improve/python/fabricatio_improve/models/improve.py +0 -0
  103. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-improve/python/fabricatio_improve/models/kwargs_types.py +0 -0
  104. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-improve/python/fabricatio_improve/models/problem.py +0 -0
  105. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-improve/python/fabricatio_improve/py.typed +0 -0
  106. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-improve/python/fabricatio_improve/workflows/__init__.py +0 -0
  107. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-judge/LICENSE +0 -0
  108. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-judge/README.md +0 -0
  109. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-judge/pyproject.toml +0 -0
  110. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-judge/python/fabricatio_judge/__init__.py +0 -0
  111. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-judge/python/fabricatio_judge/capabilities/__init__.py +0 -0
  112. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-judge/python/fabricatio_judge/capabilities/advanced_judge.py +0 -0
  113. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-judge/python/fabricatio_judge/models/__init__.py +0 -0
  114. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-judge/python/fabricatio_judge/models/advanced_judge.py +0 -0
  115. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-judge/python/fabricatio_judge/py.typed +0 -0
  116. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-question/.gitignore +0 -0
  117. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-question/LICENSE +0 -0
  118. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-question/README.md +0 -0
  119. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-question/pyproject.toml +0 -0
  120. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-question/python/fabricatio_question/__init__.py +0 -0
  121. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-question/python/fabricatio_question/actions/__init__.py +0 -0
  122. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-question/python/fabricatio_question/capabilities/__init__.py +0 -0
  123. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-question/python/fabricatio_question/capabilities/questioning.py +0 -0
  124. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-question/python/fabricatio_question/config.py +0 -0
  125. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-question/python/fabricatio_question/models/__init__.py +0 -0
  126. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-question/python/fabricatio_question/models/questions.py +0 -0
  127. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-question/python/fabricatio_question/py.typed +0 -0
  128. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-question/python/fabricatio_question/workflows/__init__.py +0 -0
  129. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-question/python/tests/tests.py +0 -0
  130. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-rule/LICENSE +0 -0
  131. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-rule/README.md +0 -0
  132. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-rule/pyproject.toml +0 -0
  133. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-rule/python/fabricatio_rule/__init__.py +0 -0
  134. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-rule/python/fabricatio_rule/actions/__init__.py +0 -0
  135. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-rule/python/fabricatio_rule/actions/rules.py +0 -0
  136. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-rule/python/fabricatio_rule/capabilities/__init__.py +0 -0
  137. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-rule/python/fabricatio_rule/capabilities/censor.py +0 -0
  138. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-rule/python/fabricatio_rule/capabilities/check.py +0 -0
  139. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-rule/python/fabricatio_rule/config.py +0 -0
  140. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-rule/python/fabricatio_rule/models/__init__.py +0 -0
  141. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-rule/python/fabricatio_rule/models/kwargs_types.py +0 -0
  142. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-rule/python/fabricatio_rule/models/patch.py +0 -0
  143. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-rule/python/fabricatio_rule/models/rule.py +0 -0
  144. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-rule/python/fabricatio_rule/py.typed +0 -0
  145. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-tagging/.gitignore +0 -0
  146. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-tagging/LICENSE +0 -0
  147. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-tagging/README.md +0 -0
  148. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-tagging/pyproject.toml +0 -0
  149. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-tagging/python/fabricatio_tagging/__init__.py +0 -0
  150. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-tagging/python/fabricatio_tagging/actions/__init__.py +0 -0
  151. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-tagging/python/fabricatio_tagging/capabilities/__init__.py +0 -0
  152. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-tagging/python/fabricatio_tagging/capabilities/tagging.py +0 -0
  153. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-tagging/python/fabricatio_tagging/config.py +0 -0
  154. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-tagging/python/fabricatio_tagging/models/__init__.py +0 -0
  155. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-tagging/python/fabricatio_tagging/py.typed +0 -0
  156. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-tagging/python/fabricatio_tagging/workflows/__init__.py +0 -0
  157. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-tagging/python/tests/tests.py +0 -0
  158. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-yue/.gitignore +0 -0
  159. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-yue/LICENSE +0 -0
  160. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-yue/README.md +0 -0
  161. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-yue/python/fabricatio_yue/__init__.py +0 -0
  162. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-yue/python/fabricatio_yue/actions/__init__.py +0 -0
  163. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-yue/python/fabricatio_yue/capabilities/__init__.py +0 -0
  164. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-yue/python/fabricatio_yue/config.py +0 -0
  165. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-yue/python/fabricatio_yue/models/__init__.py +0 -0
  166. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-yue/python/fabricatio_yue/py.typed +0 -0
  167. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-yue/python/fabricatio_yue/top_200_tags.json +0 -0
  168. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-yue/python/fabricatio_yue/workflows/__init__.py +0 -0
  169. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/packages/fabricatio-yue/python/tests/tests.py +0 -0
  170. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/python/fabricatio/__init__.py +0 -0
  171. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/python/fabricatio/actions/__init__.py +0 -0
  172. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/python/fabricatio/capabilities/__init__.py +0 -0
  173. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/python/fabricatio/models/__init__.py +0 -0
  174. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/python/fabricatio/py.typed +0 -0
  175. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/python/fabricatio/toolboxes/__init__.py +0 -0
  176. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/python/fabricatio/toolboxes/arithmetic.py +0 -0
  177. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/python/fabricatio/toolboxes/fs.py +0 -0
  178. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/python/fabricatio/workflows/__init__.py +0 -0
  179. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/python/tests/test_minor_integration.py +0 -0
  180. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/src/bin/tdown.rs +0 -0
  181. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/src/lib.rs +0 -0
  182. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/subpackages.py +0 -0
  183. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/as_prompt.hbs +0 -0
  184. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/binary-exploitation-ctf-solver.hbs +0 -0
  185. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/chap_summary.hbs +0 -0
  186. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/check_string.hbs +0 -0
  187. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/claude-xml.hbs +0 -0
  188. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/clean-up-code.hbs +0 -0
  189. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/co_validation.hbs +0 -0
  190. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/code_string.hbs +0 -0
  191. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/create_json_obj.hbs +0 -0
  192. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/cryptography-ctf-solver.hbs +0 -0
  193. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/dependencies.hbs +0 -0
  194. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/digest.hbs +0 -0
  195. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/dispatch_task.hbs +0 -0
  196. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/document-the-code.hbs +0 -0
  197. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/draft_rating_criteria.hbs +0 -0
  198. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/draft_rating_manual.hbs +0 -0
  199. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/draft_rating_weights_klee.hbs +0 -0
  200. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/draft_tool_usage_code.hbs +0 -0
  201. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/extract.hbs +0 -0
  202. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/extract_criteria_from_reasons.hbs +0 -0
  203. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/extract_reasons_from_examples.hbs +0 -0
  204. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/find-security-vulnerabilities.hbs +0 -0
  205. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/fix-bugs.hbs +0 -0
  206. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/fix_troubled_obj.hbs +0 -0
  207. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/fix_troubled_string.hbs +0 -0
  208. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/generate_anki_card_back_side.hbs +0 -0
  209. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/generate_anki_card_front_side.hbs +0 -0
  210. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/generate_anki_card_template.hbs +0 -0
  211. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/generate_anki_card_template_generation_requirements.hbs +0 -0
  212. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/generate_anki_deck_metadata.hbs +0 -0
  213. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/generate_anki_model_generation_requirements.hbs +0 -0
  214. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/generate_anki_model_name.hbs +0 -0
  215. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/generic_string.hbs +0 -0
  216. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/improve-performance.hbs +0 -0
  217. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/liststr.hbs +0 -0
  218. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/lyricize.hbs +0 -0
  219. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/make_choice.hbs +0 -0
  220. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/make_judgment.hbs +0 -0
  221. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/mapping.hbs +0 -0
  222. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/pathstr.hbs +0 -0
  223. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/rate_fine_grind.hbs +0 -0
  224. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/refactor.hbs +0 -0
  225. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/refined_query.hbs +0 -0
  226. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/research_content_summary.hbs +0 -0
  227. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/retrieved_display.hbs +0 -0
  228. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/reverse-engineering-ctf-solver.hbs +0 -0
  229. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/review_string.hbs +0 -0
  230. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/rule_requirement.hbs +0 -0
  231. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/ruleset_requirement_breakdown.hbs +0 -0
  232. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/select_genre.hbs +0 -0
  233. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/selection.hbs +0 -0
  234. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/tagging.hbs +0 -0
  235. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/task_briefing.hbs +0 -0
  236. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/web-ctf-solver.hbs +0 -0
  237. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/write-git-commit.hbs +0 -0
  238. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/templates/built-in/write-github-pull-request.hbs +0 -0
  239. {fabricatio-0.5.0.dev0 → fabricatio-0.5.0.dev1}/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.0.dev1
4
4
  Classifier: License :: OSI Approved :: MIT License
5
5
  Classifier: Programming Language :: Rust
6
6
  Classifier: Programming Language :: Python :: 3.12
@@ -0,0 +1,32 @@
1
+ """Example of using the library."""
2
+
3
+ from pathlib import Path
4
+
5
+ from fabricatio import Action, Event, Role, Task, WorkFlow
6
+ from fabricatio.capabilities import Lyricize
7
+ from fabricatio_core.utils import ok
8
+ from fabricatio_yue.models.segment import Song
9
+
10
+
11
+ class Compose(Action, Lyricize):
12
+ """Compose a song."""
13
+
14
+ async def _execute(self, req: str, output: Path, **cxt) -> Song:
15
+ return ok(await self.lyricize(req)).save_to(output)
16
+
17
+
18
+ (
19
+ Role()
20
+ .register_workflow(Event.quick_instantiate(ns := "generate_deck"), WorkFlow(steps=(Compose().to_task_output(),)))
21
+ .dispatch()
22
+ )
23
+
24
+ generated_song: Song = ok(
25
+ Task(name="gen deck")
26
+ .update_init_context(
27
+ req="Write a folk-rock song about finding hope in difficult times, with verses about struggle and a uplifting "
28
+ "chorus about perseverance. Include bridge section with introspective lyrics.",
29
+ output="here",
30
+ )
31
+ .delegate_blocking(ns)
32
+ )
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "fabricatio-yue"
3
- version = "0.1.0-dev7"
3
+ version = "0.1.0-dev10"
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" }
@@ -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,134 @@
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(f'## Section {i}. {seg.section_type.capitalize()}\n\n{self._wrapp(seg)}' for i,seg in enumerate(self.segments))
107
+
108
+ file_path.write_text(out, encoding="utf-8")
109
+
110
+ return self
111
+
112
+ def _wrapp(self, segment: Segment) -> str:
113
+ return (
114
+ f"Duration: {segment.duration} s.\n\n"
115
+
116
+ +
117
+ (f"Extra Genres: {self.block(' '.join(segment.extra_genres), 'genres')}\n"
118
+ f"Assembled Genres: {self.block(' '.join(self.genres + segment.extra_genres), 'genres')}") if segment.extra_genres else ""
119
+ +
120
+ f"Lyrics:{self.block(segment.assemble, 'lyrics')}"
121
+ )
122
+
123
+ @staticmethod
124
+ def block(content: str, lang: str = "text") -> str:
125
+ """Create a markdown code block with the specified language.
126
+
127
+ Args:
128
+ content (str): The content to wrap in the code block
129
+ lang (str, optional): The language identifier for syntax highlighting. Defaults to 'text'
130
+
131
+ Returns:
132
+ str: A formatted markdown code block
133
+ """
134
+ 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.0-dev1"
4
4
  description = "A LLM multi-agent framework."
5
5
  readme = "README.md"
6
6
  license = { file = "LICENSE" }