fabricatio 0.2.5.dev0__tar.gz → 0.2.5.dev2__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 (111) hide show
  1. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/Cargo.lock +147 -0
  2. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/Cargo.toml +3 -0
  3. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/PKG-INFO +1 -2
  4. fabricatio-0.2.5.dev2/examples/reviewer/review.py +27 -0
  5. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/pyproject.toml +1 -2
  6. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/python/fabricatio/__init__.py +2 -0
  7. fabricatio-0.2.5.dev2/python/fabricatio/_rust.pyi +102 -0
  8. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/python/fabricatio/_rust_instances.py +3 -0
  9. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/python/fabricatio/capabilities/rating.py +0 -2
  10. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/python/fabricatio/capabilities/review.py +92 -17
  11. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/python/fabricatio/config.py +19 -0
  12. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/python/fabricatio/models/kwargs_types.py +40 -1
  13. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/python/fabricatio/models/role.py +1 -1
  14. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/python/fabricatio/models/usages.py +21 -26
  15. fabricatio-0.2.5.dev2/src/bib_tools.rs +73 -0
  16. fabricatio-0.2.5.dev2/src/hbs_helpers.rs +9 -0
  17. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/src/lib.rs +2 -1
  18. fabricatio-0.2.5.dev2/src/templates.rs +104 -0
  19. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/templates/built-in/create_json_obj.hbs +16 -2
  20. fabricatio-0.2.5.dev2/templates/built-in/review_string.hbs +22 -0
  21. fabricatio-0.2.5.dev2/templates.tar.gz +0 -0
  22. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/uv.lock +1 -9
  23. fabricatio-0.2.5.dev0/python/fabricatio/_rust.pyi +0 -53
  24. fabricatio-0.2.5.dev0/src/hbs_helpers.rs +0 -15
  25. fabricatio-0.2.5.dev0/src/templates.rs +0 -105
  26. fabricatio-0.2.5.dev0/templates/built-in/review_string.hbs +0 -14
  27. fabricatio-0.2.5.dev0/templates.tar.gz +0 -0
  28. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/.github/workflows/build-package.yaml +0 -0
  29. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/.github/workflows/ruff.yaml +0 -0
  30. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/.github/workflows/tests.yaml +0 -0
  31. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/.gitignore +0 -0
  32. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/.python-version +0 -0
  33. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/LICENSE +0 -0
  34. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/Makefile +0 -0
  35. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/README.md +0 -0
  36. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/examples/extract_article/extract.py +0 -0
  37. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/examples/llm_usages/llm_usage.py +0 -0
  38. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/examples/make_a_rating/rating.py +0 -0
  39. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/examples/make_diary/commits.json +0 -0
  40. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/examples/make_diary/diary.py +0 -0
  41. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/examples/minor/hello_fabricatio.py +0 -0
  42. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/examples/propose_task/propose.py +0 -0
  43. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/examples/simple_chat/chat.py +0 -0
  44. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/examples/simple_rag/simple_rag.py +0 -0
  45. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/examples/task_handle/handle_task.py +0 -0
  46. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/examples/write_outline/.gitignore +0 -0
  47. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/examples/write_outline/write_outline.py +0 -0
  48. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/python/fabricatio/actions/article.py +0 -0
  49. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/python/fabricatio/actions/output.py +0 -0
  50. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/python/fabricatio/actions/rag.py +0 -0
  51. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/python/fabricatio/capabilities/propose.py +0 -0
  52. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/python/fabricatio/capabilities/rag.py +0 -0
  53. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/python/fabricatio/capabilities/task.py +0 -0
  54. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/python/fabricatio/core.py +0 -0
  55. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/python/fabricatio/decorators.py +0 -0
  56. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/python/fabricatio/fs/__init__.py +0 -0
  57. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/python/fabricatio/fs/curd.py +0 -0
  58. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/python/fabricatio/fs/readers.py +0 -0
  59. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/python/fabricatio/journal.py +0 -0
  60. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/python/fabricatio/models/action.py +0 -0
  61. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/python/fabricatio/models/events.py +0 -0
  62. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/python/fabricatio/models/extra.py +0 -0
  63. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/python/fabricatio/models/generic.py +0 -0
  64. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/python/fabricatio/models/task.py +0 -0
  65. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/python/fabricatio/models/tool.py +0 -0
  66. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/python/fabricatio/models/utils.py +0 -0
  67. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/python/fabricatio/parser.py +0 -0
  68. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/python/fabricatio/py.typed +0 -0
  69. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/python/fabricatio/toolboxes/__init__.py +0 -0
  70. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/python/fabricatio/toolboxes/arithmetic.py +0 -0
  71. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/python/fabricatio/toolboxes/fs.py +0 -0
  72. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/python/fabricatio/workflows/articles.py +0 -0
  73. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/python/fabricatio/workflows/rag.py +0 -0
  74. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/src/hash.rs +0 -0
  75. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/templates/built-in/binary-exploitation-ctf-solver.hbs +0 -0
  76. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/templates/built-in/claude-xml.hbs +0 -0
  77. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/templates/built-in/clean-up-code.hbs +0 -0
  78. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/templates/built-in/cryptography-ctf-solver.hbs +0 -0
  79. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/templates/built-in/dependencies.hbs +0 -0
  80. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/templates/built-in/document-the-code.hbs +0 -0
  81. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/templates/built-in/draft_rating_criteria.hbs +0 -0
  82. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/templates/built-in/draft_rating_manual.hbs +0 -0
  83. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/templates/built-in/draft_rating_weights_klee.hbs +0 -0
  84. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/templates/built-in/draft_tool_usage_code.hbs +0 -0
  85. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/templates/built-in/extract_criteria_from_reasons.hbs +0 -0
  86. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/templates/built-in/extract_reasons_from_examples.hbs +0 -0
  87. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/templates/built-in/find-security-vulnerabilities.hbs +0 -0
  88. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/templates/built-in/fix-bugs.hbs +0 -0
  89. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/templates/built-in/improve-performance.hbs +0 -0
  90. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/templates/built-in/liststr.hbs +0 -0
  91. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/templates/built-in/make_choice.hbs +0 -0
  92. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/templates/built-in/make_judgment.hbs +0 -0
  93. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/templates/built-in/pathstr.hbs +0 -0
  94. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/templates/built-in/rate_fine_grind.hbs +0 -0
  95. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/templates/built-in/refactor.hbs +0 -0
  96. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/templates/built-in/refined_query.hbs +0 -0
  97. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/templates/built-in/retrieved_display.hbs +0 -0
  98. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/templates/built-in/reverse-engineering-ctf-solver.hbs +0 -0
  99. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/templates/built-in/task_briefing.hbs +0 -0
  100. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/templates/built-in/web-ctf-solver.hbs +0 -0
  101. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/templates/built-in/write-git-commit.hbs +0 -0
  102. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/templates/built-in/write-github-pull-request.hbs +0 -0
  103. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/templates/built-in/write-github-readme.hbs +0 -0
  104. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/tests/test_config.py +0 -0
  105. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/tests/test_models/test_action.py +0 -0
  106. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/tests/test_models/test_advanced.py +0 -0
  107. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/tests/test_models/test_generic.py +0 -0
  108. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/tests/test_models/test_role.py +0 -0
  109. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/tests/test_models/test_task.py +0 -0
  110. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/tests/test_models/test_tool.py +0 -0
  111. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev2}/tests/test_models/test_usages.py +0 -0
@@ -112,6 +112,19 @@ version = "0.22.1"
112
112
  source = "registry+https://github.com/rust-lang/crates.io-index"
113
113
  checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
114
114
 
115
+ [[package]]
116
+ name = "biblatex"
117
+ version = "0.10.0"
118
+ source = "registry+https://github.com/rust-lang/crates.io-index"
119
+ checksum = "a35a7317fcbdbef94b60d0dd0a658711a936accfce4a631fea4bf8e527eff3c2"
120
+ dependencies = [
121
+ "numerals",
122
+ "paste",
123
+ "strum",
124
+ "unicode-normalization",
125
+ "unscanny",
126
+ ]
127
+
115
128
  [[package]]
116
129
  name = "bitflags"
117
130
  version = "2.8.0"
@@ -254,6 +267,31 @@ dependencies = [
254
267
  "cfg-if",
255
268
  ]
256
269
 
270
+ [[package]]
271
+ name = "crossbeam-deque"
272
+ version = "0.8.6"
273
+ source = "registry+https://github.com/rust-lang/crates.io-index"
274
+ checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51"
275
+ dependencies = [
276
+ "crossbeam-epoch",
277
+ "crossbeam-utils",
278
+ ]
279
+
280
+ [[package]]
281
+ name = "crossbeam-epoch"
282
+ version = "0.9.18"
283
+ source = "registry+https://github.com/rust-lang/crates.io-index"
284
+ checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e"
285
+ dependencies = [
286
+ "crossbeam-utils",
287
+ ]
288
+
289
+ [[package]]
290
+ name = "crossbeam-utils"
291
+ version = "0.8.21"
292
+ source = "registry+https://github.com/rust-lang/crates.io-index"
293
+ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
294
+
257
295
  [[package]]
258
296
  name = "crypto-common"
259
297
  version = "0.1.6"
@@ -372,6 +410,12 @@ dependencies = [
372
410
  "syn",
373
411
  ]
374
412
 
413
+ [[package]]
414
+ name = "either"
415
+ version = "1.15.0"
416
+ source = "registry+https://github.com/rust-lang/crates.io-index"
417
+ checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719"
418
+
375
419
  [[package]]
376
420
  name = "encoding_rs"
377
421
  version = "0.8.35"
@@ -401,10 +445,13 @@ dependencies = [
401
445
  name = "fabricatio"
402
446
  version = "0.0.0"
403
447
  dependencies = [
448
+ "biblatex",
404
449
  "blake3",
405
450
  "handlebars",
451
+ "nucleo-matcher",
406
452
  "pyo3",
407
453
  "pythonize",
454
+ "rayon",
408
455
  "serde_json",
409
456
  "walkdir",
410
457
  ]
@@ -1006,6 +1053,16 @@ dependencies = [
1006
1053
  "tempfile",
1007
1054
  ]
1008
1055
 
1056
+ [[package]]
1057
+ name = "nucleo-matcher"
1058
+ version = "0.3.1"
1059
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1060
+ checksum = "bf33f538733d1a5a3494b836ba913207f14d9d4a1d3cd67030c5061bdd2cac85"
1061
+ dependencies = [
1062
+ "memchr",
1063
+ "unicode-segmentation",
1064
+ ]
1065
+
1009
1066
  [[package]]
1010
1067
  name = "num-modular"
1011
1068
  version = "0.6.1"
@@ -1021,6 +1078,12 @@ dependencies = [
1021
1078
  "num-modular",
1022
1079
  ]
1023
1080
 
1081
+ [[package]]
1082
+ name = "numerals"
1083
+ version = "0.1.4"
1084
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1085
+ checksum = "e25be21376a772d15f97ae789845340a9651d3c4246ff5ebb6a2b35f9c37bd31"
1086
+
1024
1087
  [[package]]
1025
1088
  name = "object"
1026
1089
  version = "0.36.7"
@@ -1086,6 +1149,12 @@ version = "0.2.0"
1086
1149
  source = "registry+https://github.com/rust-lang/crates.io-index"
1087
1150
  checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"
1088
1151
 
1152
+ [[package]]
1153
+ name = "paste"
1154
+ version = "1.0.15"
1155
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1156
+ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
1157
+
1089
1158
  [[package]]
1090
1159
  name = "percent-encoding"
1091
1160
  version = "2.3.1"
@@ -1252,6 +1321,26 @@ dependencies = [
1252
1321
  "proc-macro2",
1253
1322
  ]
1254
1323
 
1324
+ [[package]]
1325
+ name = "rayon"
1326
+ version = "1.10.0"
1327
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1328
+ checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa"
1329
+ dependencies = [
1330
+ "either",
1331
+ "rayon-core",
1332
+ ]
1333
+
1334
+ [[package]]
1335
+ name = "rayon-core"
1336
+ version = "1.12.1"
1337
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1338
+ checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2"
1339
+ dependencies = [
1340
+ "crossbeam-deque",
1341
+ "crossbeam-utils",
1342
+ ]
1343
+
1255
1344
  [[package]]
1256
1345
  name = "redox_syscall"
1257
1346
  version = "0.5.8"
@@ -1540,6 +1629,28 @@ version = "0.11.1"
1540
1629
  source = "registry+https://github.com/rust-lang/crates.io-index"
1541
1630
  checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
1542
1631
 
1632
+ [[package]]
1633
+ name = "strum"
1634
+ version = "0.26.3"
1635
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1636
+ checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06"
1637
+ dependencies = [
1638
+ "strum_macros",
1639
+ ]
1640
+
1641
+ [[package]]
1642
+ name = "strum_macros"
1643
+ version = "0.26.4"
1644
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1645
+ checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be"
1646
+ dependencies = [
1647
+ "heck",
1648
+ "proc-macro2",
1649
+ "quote",
1650
+ "rustversion",
1651
+ "syn",
1652
+ ]
1653
+
1543
1654
  [[package]]
1544
1655
  name = "subtle"
1545
1656
  version = "2.6.1"
@@ -1659,6 +1770,21 @@ dependencies = [
1659
1770
  "zerovec",
1660
1771
  ]
1661
1772
 
1773
+ [[package]]
1774
+ name = "tinyvec"
1775
+ version = "1.9.0"
1776
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1777
+ checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71"
1778
+ dependencies = [
1779
+ "tinyvec_macros",
1780
+ ]
1781
+
1782
+ [[package]]
1783
+ name = "tinyvec_macros"
1784
+ version = "0.1.1"
1785
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1786
+ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
1787
+
1662
1788
  [[package]]
1663
1789
  name = "tokio"
1664
1790
  version = "1.43.0"
@@ -1789,12 +1915,33 @@ version = "1.0.16"
1789
1915
  source = "registry+https://github.com/rust-lang/crates.io-index"
1790
1916
  checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034"
1791
1917
 
1918
+ [[package]]
1919
+ name = "unicode-normalization"
1920
+ version = "0.1.24"
1921
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1922
+ checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956"
1923
+ dependencies = [
1924
+ "tinyvec",
1925
+ ]
1926
+
1927
+ [[package]]
1928
+ name = "unicode-segmentation"
1929
+ version = "1.12.0"
1930
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1931
+ checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493"
1932
+
1792
1933
  [[package]]
1793
1934
  name = "unindent"
1794
1935
  version = "0.2.3"
1795
1936
  source = "registry+https://github.com/rust-lang/crates.io-index"
1796
1937
  checksum = "c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce"
1797
1938
 
1939
+ [[package]]
1940
+ name = "unscanny"
1941
+ version = "0.1.0"
1942
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1943
+ checksum = "e9df2af067a7953e9c3831320f35c1cc0600c30d44d9f7a12b01db1cd88d6b47"
1944
+
1798
1945
  [[package]]
1799
1946
  name = "untrusted"
1800
1947
  version = "0.9.0"
@@ -6,10 +6,13 @@ edition = "2024"
6
6
  crate-type = ["cdylib"]
7
7
 
8
8
  [dependencies]
9
+ biblatex = "0.10.0"
9
10
  blake3 = "1.6.0"
10
11
  handlebars = "6.3.1"
12
+ nucleo-matcher = "0.3.1"
11
13
  pyo3 = { version = "0.23.4", features = ["extension-module"] }
12
14
  pythonize = "0.23.0"
15
+ rayon = "1.10.0"
13
16
  serde_json = "1.0.138"
14
17
  walkdir = "2.5.0"
15
18
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fabricatio
3
- Version: 0.2.5.dev0
3
+ Version: 0.2.5.dev2
4
4
  Classifier: License :: OSI Approved :: MIT License
5
5
  Classifier: Programming Language :: Rust
6
6
  Classifier: Programming Language :: Python :: 3.12
@@ -9,7 +9,6 @@ Classifier: Framework :: AsyncIO
9
9
  Classifier: Framework :: Pydantic :: 2
10
10
  Classifier: Typing :: Typed
11
11
  Requires-Dist: appdirs>=1.4.4
12
- Requires-Dist: async-cache>=1.1.1
13
12
  Requires-Dist: asyncio>=3.4.3
14
13
  Requires-Dist: asyncstdlib>=3.13.0
15
14
  Requires-Dist: litellm>=1.60.0
@@ -0,0 +1,27 @@
1
+ """Example of review usage."""
2
+
3
+ import asyncio
4
+
5
+ from fabricatio import Role, logger
6
+
7
+
8
+ async def main() -> None:
9
+ """Main function."""
10
+ role = Role(
11
+ name="Reviewer",
12
+ description="A role that reviews the code.",
13
+ )
14
+
15
+ code = await role.aask(
16
+ "write a cli app using rust with clap which can generate a basic manifest of a standard rust project, output code only,no extra explanation"
17
+ )
18
+
19
+ logger.success(f"Code: \n{code}")
20
+ res = await role.review_string(code, "If the cli app is of good design")
21
+ logger.success(f"Review: \n{res.display()}")
22
+ await res.supervisor_check(True)
23
+ logger.success(f"Review: \n{res.display()}")
24
+
25
+
26
+ if __name__ == "__main__":
27
+ asyncio.run(main())
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "fabricatio"
3
- version = "0.2.5-dev0"
3
+ version = "0.2.5-dev2"
4
4
  description = "A LLM multi-agent framework."
5
5
  readme = "README.md"
6
6
  license = { file = "LICENSE" }
@@ -28,7 +28,6 @@ keywords = [
28
28
  requires-python = ">=3.12,<3.13"
29
29
  dependencies = [
30
30
  "appdirs>=1.4.4",
31
- "async-cache>=1.1.1",
32
31
  "asyncio>=3.4.3",
33
32
  "asyncstdlib>=3.13.0",
34
33
  "litellm>=1.60.0",
@@ -2,6 +2,7 @@
2
2
 
3
3
  from importlib.util import find_spec
4
4
 
5
+ from fabricatio._rust import BibManager
5
6
  from fabricatio._rust_instances import template_manager
6
7
  from fabricatio.actions.article import ExtractArticleEssence, GenerateArticleProposal, GenerateOutline
7
8
  from fabricatio.actions.output import DumpFinalizedOutput
@@ -22,6 +23,7 @@ from fabricatio.workflows.articles import WriteOutlineWorkFlow
22
23
  __all__ = [
23
24
  "Action",
24
25
  "ArticleEssence",
26
+ "BibManager",
25
27
  "Capture",
26
28
  "CodeBlockCapture",
27
29
  "DumpFinalizedOutput",
@@ -0,0 +1,102 @@
1
+ from pathlib import Path
2
+ from typing import Any, Dict, List, Optional
3
+
4
+ class TemplateManager:
5
+ """Template rendering engine using Handlebars templates.
6
+
7
+ This manager handles template discovery, loading, and rendering
8
+ through a wrapper around the handlebars-rust engine.
9
+
10
+ See: https://crates.io/crates/handlebars
11
+ """
12
+ def __init__(
13
+ self, template_dirs: List[Path], suffix: Optional[str] = None, active_loading: Optional[bool] = None
14
+ ) -> None:
15
+ """Initialize the template manager.
16
+
17
+ Args:
18
+ template_dirs: List of directories containing template files
19
+ suffix: File extension for templates (defaults to 'hbs')
20
+ active_loading: Whether to enable dev mode for reloading templates on change
21
+ """
22
+
23
+ @property
24
+ def template_count(self) -> int:
25
+ """Returns the number of currently loaded templates."""
26
+
27
+ def get_template_source(self, name: str) -> Optional[str]:
28
+ """Get the filesystem path for a template.
29
+
30
+ Args:
31
+ name: Template name (without extension)
32
+
33
+ Returns:
34
+ Path to the template file if found, None otherwise
35
+ """
36
+
37
+ def discover_templates(self) -> None:
38
+ """Scan template directories and load available templates.
39
+
40
+ This refreshes the template cache, finding any new or modified templates.
41
+ """
42
+
43
+ def render_template(self, name: str, data: Dict[str, Any]) -> str:
44
+ """Render a template with context data.
45
+
46
+ Args:
47
+ name: Template name (without extension)
48
+ data: Context dictionary to provide variables to the template
49
+
50
+ Returns:
51
+ Rendered template content as string
52
+
53
+ Raises:
54
+ RuntimeError: If template rendering fails
55
+ """
56
+
57
+ def blake3_hash(content: bytes) -> str:
58
+ """Calculate the BLAKE3 cryptographic hash of data.
59
+
60
+ Args:
61
+ content: Bytes to be hashed
62
+
63
+ Returns:
64
+ Hex-encoded BLAKE3 hash string
65
+ """
66
+
67
+ class BibManager:
68
+ """BibTeX bibliography manager for parsing and querying citation data."""
69
+
70
+ def __init__(self, path: str) -> None:
71
+ """Initialize the bibliography manager.
72
+
73
+ Args:
74
+ path: Path to BibTeX (.bib) file to load
75
+
76
+ Raises:
77
+ RuntimeError: If file cannot be read or parsed
78
+ """
79
+
80
+ def get_cite_key(self, title: str) -> Optional[str]:
81
+ """Find citation key by exact title match.
82
+
83
+ Args:
84
+ title: Full title to search for (case-insensitive)
85
+
86
+ Returns:
87
+ Citation key if exact match found, None otherwise
88
+ """
89
+
90
+ def get_cite_key_fuzzy(self, query: str) -> Optional[str]:
91
+ """Find best matching citation using fuzzy text search.
92
+
93
+ Args:
94
+ query: Search term to find in bibliography entries
95
+
96
+ Returns:
97
+ Citation key of best matching entry, or None if no good match
98
+
99
+ Notes:
100
+ Uses nucleo_matcher for high-quality fuzzy text searching
101
+ See: https://crates.io/crates/nucleo-matcher
102
+ """
@@ -1,4 +1,7 @@
1
+ """Some necessary instances."""
2
+
1
3
  from fabricatio._rust import TemplateManager
4
+
2
5
  from fabricatio.config import configs
3
6
 
4
7
  template_manager = TemplateManager(
@@ -4,7 +4,6 @@ from asyncio import gather
4
4
  from itertools import permutations
5
5
  from typing import Dict, List, Set, Tuple, Union, Unpack, overload
6
6
 
7
- from cache import AsyncLRU
8
7
  from fabricatio._rust_instances import template_manager
9
8
  from fabricatio.config import configs
10
9
  from fabricatio.journal import logger
@@ -113,7 +112,6 @@ class GiveRating(WithBriefing, LLMUsage):
113
112
  return await gather(*[self.rate_fine_grind(item, manual, score_range, **kwargs) for item in to_rate])
114
113
  raise ValueError("to_rate must be a string or a list of strings")
115
114
 
116
- @AsyncLRU(maxsize=32)
117
115
  async def draft_rating_manual(
118
116
  self, topic: str, criteria: Set[str], **kwargs: Unpack[ValidateKwargs]
119
117
  ) -> Dict[str, str]:
@@ -1,60 +1,135 @@
1
1
  """A module that provides functionality to rate tasks based on a rating manual and score range."""
2
2
 
3
- from typing import List, Optional, Set, Unpack
3
+ from typing import List, Optional, Self, Set, Unpack
4
4
 
5
5
  from fabricatio import template_manager
6
6
  from fabricatio.capabilities.propose import Propose
7
7
  from fabricatio.capabilities.rating import GiveRating
8
8
  from fabricatio.config import configs
9
- from fabricatio.models.generic import Display, ProposedAble, WithBriefing
9
+ from fabricatio.models.generic import Base, Display, ProposedAble, WithBriefing
10
10
  from fabricatio.models.kwargs_types import GenerateKwargs, ReviewKwargs
11
11
  from fabricatio.models.task import Task
12
12
  from pydantic import PrivateAttr
13
+ from questionary import Choice, checkbox
14
+
15
+
16
+ class ProblemSolutions(Base):
17
+ """Represents a problem-solution pair identified during a review process.
18
+
19
+ This class encapsulates a single problem with its corresponding potential solutions,
20
+ providing a structured way to manage review findings.
21
+
22
+ Attributes:
23
+ problem (str): The problem statement identified during review.
24
+ solutions (List[str]): A collection of potential solutions to address the problem.
25
+ """
26
+
27
+ problem: str
28
+ """The problem identified in the review."""
29
+ solutions: List[str]
30
+ """A collection of potential solutions to address the problem."""
31
+
32
+ def update_problem(self, problem: str) -> Self:
33
+ """Update the problem description.
34
+
35
+ Args:
36
+ problem (str): The new problem description to replace the current one.
37
+
38
+ Returns:
39
+ Self: The current instance with updated problem description.
40
+ """
41
+ self.problem = problem
42
+ return self
43
+
44
+ def update_solutions(self, solutions: List[str]) -> Self:
45
+ """Update the list of potential solutions.
46
+
47
+ Args:
48
+ solutions (List[str]): The new collection of solutions to replace the current ones.
49
+
50
+ Returns:
51
+ Self: The current instance with updated solutions.
52
+ """
53
+ self.solutions = solutions
54
+ return self
13
55
 
14
56
 
15
57
  class ReviewResult[T](ProposedAble, Display):
16
- """Class that represents the result of a review.
58
+ """Represents the outcome of a review process with identified problems and solutions.
17
59
 
18
- This class holds the problems identified in a review and their proposed solutions,
19
- along with a reference to the reviewed object.
60
+ This class maintains a structured collection of problems found during a review,
61
+ their proposed solutions, and a reference to the original reviewed object.
20
62
 
21
63
  Attributes:
22
- existing_problems (List[str]): List of problems identified in the review.
23
- proposed_solutions (List[str]): List of proposed solutions to the problems identified in the review.
64
+ review_topic (str): The subject or focus area of the review.
65
+ problem_solutions (List[ProblemSolutions]): Collection of problems identified
66
+ during review along with their potential solutions.
24
67
 
25
68
  Type Parameters:
26
69
  T: The type of the object being reviewed.
27
70
  """
28
71
 
29
- existing_problems: List[str]
30
- """List of problems identified in the review."""
72
+ review_topic: str
73
+ """The subject or focus area of the review."""
31
74
 
32
- proposed_solutions: List[str]
33
- """List of proposed solutions to the problems identified in the review."""
75
+ problem_solutions: List[ProblemSolutions]
76
+ """Collection of problems identified during review along with their potential solutions."""
34
77
 
35
78
  _ref: T = PrivateAttr(None)
36
- """Reference to the object being reviewed."""
79
+ """Reference to the original object that was reviewed."""
37
80
 
38
81
  def update_ref[K](self, ref: K) -> "ReviewResult[K]":
39
- """Update the reference to the object being reviewed.
82
+ """Update the reference to the reviewed object.
40
83
 
41
84
  Args:
42
- ref (K): The new reference to the object being reviewed.
85
+ ref (K): The new reference object to be associated with this review.
43
86
 
44
87
  Returns:
45
- ReviewResult[K]: The updated instance of the ReviewResult class with the new reference type.
88
+ ReviewResult[K]: The current instance with updated reference type.
46
89
  """
47
90
  self._ref = ref
48
91
  return self
49
92
 
50
93
  def deref(self) -> T:
51
- """Dereference the object being reviewed.
94
+ """Retrieve the referenced object that was reviewed.
52
95
 
53
96
  Returns:
54
- T: The object being reviewed.
97
+ T: The original object that was reviewed.
55
98
  """
56
99
  return self._ref
57
100
 
101
+ async def supervisor_check(self, check_solutions: bool = False) -> Self:
102
+ """Perform an interactive review session to filter problems and solutions.
103
+
104
+ Presents an interactive prompt allowing a supervisor to select which
105
+ problems (and optionally solutions) should be retained in the final review.
106
+
107
+ Args:
108
+ check_solutions (bool, optional): When True, also prompts for filtering
109
+ individual solutions for each retained problem. Defaults to False.
110
+
111
+ Returns:
112
+ Self: The current instance with filtered problems and solutions.
113
+ """
114
+ # Choose the problems to retain
115
+ chosen_ones: List[ProblemSolutions] = await checkbox(
116
+ f"Please choose the problems you want to retain, under the topic of `{self.review_topic}`.(Default: retain all)",
117
+ choices=[Choice(p.problem, p, checked=True) for p in self.problem_solutions],
118
+ ).ask_async()
119
+ if not check_solutions:
120
+ self.problem_solutions = chosen_ones
121
+ return self
122
+
123
+ # Choose the solutions to retain
124
+ for to_exam in chosen_ones:
125
+ to_exam.update_solutions(
126
+ await checkbox(
127
+ f"Please choose the solutions you want to retain, under the problem of `{to_exam.problem}`.(Default: retain all)",
128
+ choices=[Choice(s, s, checked=True) for s in to_exam.solutions],
129
+ ).ask_async()
130
+ )
131
+ return self
132
+
58
133
 
59
134
  class Review(GiveRating, Propose):
60
135
  """Class that provides functionality to review tasks and strings using a language model.
@@ -3,6 +3,7 @@
3
3
  from typing import List, Literal, Optional
4
4
 
5
5
  from appdirs import user_config_dir
6
+ from litellm.types.caching import LiteLLMCacheType
6
7
  from pydantic import (
7
8
  BaseModel,
8
9
  ConfigDict,
@@ -25,6 +26,8 @@ from pydantic_settings import (
25
26
  TomlConfigSettingsSource,
26
27
  )
27
28
 
29
+ from fabricatio.models.kwargs_types import CacheKwargs
30
+
28
31
  ROAMING_DIR = user_config_dir("fabricatio", "", roaming=True)
29
32
 
30
33
 
@@ -265,6 +268,19 @@ class RagConfig(BaseModel):
265
268
  """The dimensions of the Milvus server."""
266
269
 
267
270
 
271
+ class CacheConfig(BaseModel):
272
+ """cache configuration class, uses litellm as cache backend. more info see https://docs.litellm.ai/docs/caching/all_caches."""
273
+
274
+ model_config = ConfigDict(use_attribute_docstrings=True)
275
+
276
+ type: Optional[LiteLLMCacheType] = None
277
+ """The type of cache to use. If None, the default cache type will be used."""
278
+ params: CacheKwargs = Field(default_factory=CacheKwargs)
279
+ """The parameters for the cache. If type is None, the default parameters will be used."""
280
+ enabled: bool = Field(default=False)
281
+ """Whether to enable cache."""
282
+
283
+
268
284
  class Settings(BaseSettings):
269
285
  """Application settings class.
270
286
 
@@ -314,6 +330,9 @@ class Settings(BaseSettings):
314
330
  rag: RagConfig = Field(default_factory=RagConfig)
315
331
  """RAG Configuration"""
316
332
 
333
+ cache: CacheConfig = Field(default_factory=CacheConfig)
334
+ """Cache Configuration"""
335
+
317
336
  @classmethod
318
337
  def settings_customise_sources(
319
338
  cls,