fabricatio 0.2.5.dev0__tar.gz → 0.2.5.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 (106) hide show
  1. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/Cargo.lock +130 -0
  2. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/Cargo.toml +2 -0
  3. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/PKG-INFO +1 -1
  4. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/pyproject.toml +1 -1
  5. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/python/fabricatio/__init__.py +2 -0
  6. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/python/fabricatio/_rust.pyi +8 -0
  7. fabricatio-0.2.5.dev1/src/bib_tools.rs +45 -0
  8. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/src/lib.rs +2 -1
  9. fabricatio-0.2.5.dev1/templates.tar.gz +0 -0
  10. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/uv.lock +1 -1
  11. fabricatio-0.2.5.dev0/templates.tar.gz +0 -0
  12. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/.github/workflows/build-package.yaml +0 -0
  13. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/.github/workflows/ruff.yaml +0 -0
  14. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/.github/workflows/tests.yaml +0 -0
  15. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/.gitignore +0 -0
  16. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/.python-version +0 -0
  17. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/LICENSE +0 -0
  18. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/Makefile +0 -0
  19. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/README.md +0 -0
  20. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/examples/extract_article/extract.py +0 -0
  21. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/examples/llm_usages/llm_usage.py +0 -0
  22. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/examples/make_a_rating/rating.py +0 -0
  23. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/examples/make_diary/commits.json +0 -0
  24. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/examples/make_diary/diary.py +0 -0
  25. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/examples/minor/hello_fabricatio.py +0 -0
  26. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/examples/propose_task/propose.py +0 -0
  27. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/examples/simple_chat/chat.py +0 -0
  28. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/examples/simple_rag/simple_rag.py +0 -0
  29. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/examples/task_handle/handle_task.py +0 -0
  30. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/examples/write_outline/.gitignore +0 -0
  31. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/examples/write_outline/write_outline.py +0 -0
  32. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/python/fabricatio/_rust_instances.py +0 -0
  33. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/python/fabricatio/actions/article.py +0 -0
  34. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/python/fabricatio/actions/output.py +0 -0
  35. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/python/fabricatio/actions/rag.py +0 -0
  36. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/python/fabricatio/capabilities/propose.py +0 -0
  37. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/python/fabricatio/capabilities/rag.py +0 -0
  38. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/python/fabricatio/capabilities/rating.py +0 -0
  39. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/python/fabricatio/capabilities/review.py +0 -0
  40. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/python/fabricatio/capabilities/task.py +0 -0
  41. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/python/fabricatio/config.py +0 -0
  42. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/python/fabricatio/core.py +0 -0
  43. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/python/fabricatio/decorators.py +0 -0
  44. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/python/fabricatio/fs/__init__.py +0 -0
  45. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/python/fabricatio/fs/curd.py +0 -0
  46. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/python/fabricatio/fs/readers.py +0 -0
  47. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/python/fabricatio/journal.py +0 -0
  48. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/python/fabricatio/models/action.py +0 -0
  49. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/python/fabricatio/models/events.py +0 -0
  50. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/python/fabricatio/models/extra.py +0 -0
  51. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/python/fabricatio/models/generic.py +0 -0
  52. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/python/fabricatio/models/kwargs_types.py +0 -0
  53. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/python/fabricatio/models/role.py +0 -0
  54. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/python/fabricatio/models/task.py +0 -0
  55. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/python/fabricatio/models/tool.py +0 -0
  56. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/python/fabricatio/models/usages.py +0 -0
  57. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/python/fabricatio/models/utils.py +0 -0
  58. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/python/fabricatio/parser.py +0 -0
  59. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/python/fabricatio/py.typed +0 -0
  60. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/python/fabricatio/toolboxes/__init__.py +0 -0
  61. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/python/fabricatio/toolboxes/arithmetic.py +0 -0
  62. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/python/fabricatio/toolboxes/fs.py +0 -0
  63. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/python/fabricatio/workflows/articles.py +0 -0
  64. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/python/fabricatio/workflows/rag.py +0 -0
  65. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/src/hash.rs +0 -0
  66. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/src/hbs_helpers.rs +0 -0
  67. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/src/templates.rs +0 -0
  68. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/templates/built-in/binary-exploitation-ctf-solver.hbs +0 -0
  69. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/templates/built-in/claude-xml.hbs +0 -0
  70. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/templates/built-in/clean-up-code.hbs +0 -0
  71. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/templates/built-in/create_json_obj.hbs +0 -0
  72. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/templates/built-in/cryptography-ctf-solver.hbs +0 -0
  73. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/templates/built-in/dependencies.hbs +0 -0
  74. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/templates/built-in/document-the-code.hbs +0 -0
  75. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/templates/built-in/draft_rating_criteria.hbs +0 -0
  76. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/templates/built-in/draft_rating_manual.hbs +0 -0
  77. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/templates/built-in/draft_rating_weights_klee.hbs +0 -0
  78. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/templates/built-in/draft_tool_usage_code.hbs +0 -0
  79. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/templates/built-in/extract_criteria_from_reasons.hbs +0 -0
  80. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/templates/built-in/extract_reasons_from_examples.hbs +0 -0
  81. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/templates/built-in/find-security-vulnerabilities.hbs +0 -0
  82. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/templates/built-in/fix-bugs.hbs +0 -0
  83. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/templates/built-in/improve-performance.hbs +0 -0
  84. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/templates/built-in/liststr.hbs +0 -0
  85. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/templates/built-in/make_choice.hbs +0 -0
  86. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/templates/built-in/make_judgment.hbs +0 -0
  87. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/templates/built-in/pathstr.hbs +0 -0
  88. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/templates/built-in/rate_fine_grind.hbs +0 -0
  89. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/templates/built-in/refactor.hbs +0 -0
  90. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/templates/built-in/refined_query.hbs +0 -0
  91. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/templates/built-in/retrieved_display.hbs +0 -0
  92. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/templates/built-in/reverse-engineering-ctf-solver.hbs +0 -0
  93. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/templates/built-in/review_string.hbs +0 -0
  94. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/templates/built-in/task_briefing.hbs +0 -0
  95. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/templates/built-in/web-ctf-solver.hbs +0 -0
  96. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/templates/built-in/write-git-commit.hbs +0 -0
  97. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/templates/built-in/write-github-pull-request.hbs +0 -0
  98. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/templates/built-in/write-github-readme.hbs +0 -0
  99. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/tests/test_config.py +0 -0
  100. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/tests/test_models/test_action.py +0 -0
  101. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/tests/test_models/test_advanced.py +0 -0
  102. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/tests/test_models/test_generic.py +0 -0
  103. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/tests/test_models/test_role.py +0 -0
  104. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/tests/test_models/test_task.py +0 -0
  105. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/tests/test_models/test_tool.py +0 -0
  106. {fabricatio-0.2.5.dev0 → fabricatio-0.2.5.dev1}/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,12 @@ dependencies = [
401
445
  name = "fabricatio"
402
446
  version = "0.0.0"
403
447
  dependencies = [
448
+ "biblatex",
404
449
  "blake3",
405
450
  "handlebars",
406
451
  "pyo3",
407
452
  "pythonize",
453
+ "rayon",
408
454
  "serde_json",
409
455
  "walkdir",
410
456
  ]
@@ -1021,6 +1067,12 @@ dependencies = [
1021
1067
  "num-modular",
1022
1068
  ]
1023
1069
 
1070
+ [[package]]
1071
+ name = "numerals"
1072
+ version = "0.1.4"
1073
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1074
+ checksum = "e25be21376a772d15f97ae789845340a9651d3c4246ff5ebb6a2b35f9c37bd31"
1075
+
1024
1076
  [[package]]
1025
1077
  name = "object"
1026
1078
  version = "0.36.7"
@@ -1086,6 +1138,12 @@ version = "0.2.0"
1086
1138
  source = "registry+https://github.com/rust-lang/crates.io-index"
1087
1139
  checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"
1088
1140
 
1141
+ [[package]]
1142
+ name = "paste"
1143
+ version = "1.0.15"
1144
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1145
+ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
1146
+
1089
1147
  [[package]]
1090
1148
  name = "percent-encoding"
1091
1149
  version = "2.3.1"
@@ -1252,6 +1310,26 @@ dependencies = [
1252
1310
  "proc-macro2",
1253
1311
  ]
1254
1312
 
1313
+ [[package]]
1314
+ name = "rayon"
1315
+ version = "1.10.0"
1316
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1317
+ checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa"
1318
+ dependencies = [
1319
+ "either",
1320
+ "rayon-core",
1321
+ ]
1322
+
1323
+ [[package]]
1324
+ name = "rayon-core"
1325
+ version = "1.12.1"
1326
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1327
+ checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2"
1328
+ dependencies = [
1329
+ "crossbeam-deque",
1330
+ "crossbeam-utils",
1331
+ ]
1332
+
1255
1333
  [[package]]
1256
1334
  name = "redox_syscall"
1257
1335
  version = "0.5.8"
@@ -1540,6 +1618,28 @@ version = "0.11.1"
1540
1618
  source = "registry+https://github.com/rust-lang/crates.io-index"
1541
1619
  checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
1542
1620
 
1621
+ [[package]]
1622
+ name = "strum"
1623
+ version = "0.26.3"
1624
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1625
+ checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06"
1626
+ dependencies = [
1627
+ "strum_macros",
1628
+ ]
1629
+
1630
+ [[package]]
1631
+ name = "strum_macros"
1632
+ version = "0.26.4"
1633
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1634
+ checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be"
1635
+ dependencies = [
1636
+ "heck",
1637
+ "proc-macro2",
1638
+ "quote",
1639
+ "rustversion",
1640
+ "syn",
1641
+ ]
1642
+
1543
1643
  [[package]]
1544
1644
  name = "subtle"
1545
1645
  version = "2.6.1"
@@ -1659,6 +1759,21 @@ dependencies = [
1659
1759
  "zerovec",
1660
1760
  ]
1661
1761
 
1762
+ [[package]]
1763
+ name = "tinyvec"
1764
+ version = "1.9.0"
1765
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1766
+ checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71"
1767
+ dependencies = [
1768
+ "tinyvec_macros",
1769
+ ]
1770
+
1771
+ [[package]]
1772
+ name = "tinyvec_macros"
1773
+ version = "0.1.1"
1774
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1775
+ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
1776
+
1662
1777
  [[package]]
1663
1778
  name = "tokio"
1664
1779
  version = "1.43.0"
@@ -1789,12 +1904,27 @@ version = "1.0.16"
1789
1904
  source = "registry+https://github.com/rust-lang/crates.io-index"
1790
1905
  checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034"
1791
1906
 
1907
+ [[package]]
1908
+ name = "unicode-normalization"
1909
+ version = "0.1.24"
1910
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1911
+ checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956"
1912
+ dependencies = [
1913
+ "tinyvec",
1914
+ ]
1915
+
1792
1916
  [[package]]
1793
1917
  name = "unindent"
1794
1918
  version = "0.2.3"
1795
1919
  source = "registry+https://github.com/rust-lang/crates.io-index"
1796
1920
  checksum = "c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce"
1797
1921
 
1922
+ [[package]]
1923
+ name = "unscanny"
1924
+ version = "0.1.0"
1925
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1926
+ checksum = "e9df2af067a7953e9c3831320f35c1cc0600c30d44d9f7a12b01db1cd88d6b47"
1927
+
1798
1928
  [[package]]
1799
1929
  name = "untrusted"
1800
1930
  version = "0.9.0"
@@ -6,10 +6,12 @@ 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"
11
12
  pyo3 = { version = "0.23.4", features = ["extension-module"] }
12
13
  pythonize = "0.23.0"
14
+ rayon = "1.10.0"
13
15
  serde_json = "1.0.138"
14
16
  walkdir = "2.5.0"
15
17
 
@@ -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.dev1
4
4
  Classifier: License :: OSI Approved :: MIT License
5
5
  Classifier: Programming Language :: Rust
6
6
  Classifier: Programming Language :: Python :: 3.12
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "fabricatio"
3
- version = "0.2.5-dev0"
3
+ version = "0.2.5-dev1"
4
4
  description = "A LLM multi-agent framework."
5
5
  readme = "README.md"
6
6
  license = { file = "LICENSE" }
@@ -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",
@@ -51,3 +51,11 @@ def blake3_hash(content: bytes) -> str:
51
51
  Returns:
52
52
  str: The BLAKE3 hash of the data.
53
53
  """
54
+
55
+ class BibManager:
56
+ """BibManager class for managing BibTeX files."""
57
+ def __init__(self, path: str) -> None:
58
+ """Initialize the BibManager with the given path."""
59
+
60
+ def get_cite_key(self, title: str) -> str:
61
+ """Get the cite key for the given title."""
@@ -0,0 +1,45 @@
1
+ use biblatex::{Bibliography, ChunksExt};
2
+ use pyo3::exceptions::PyRuntimeError;
3
+ use pyo3::prelude::*;
4
+ use rayon::prelude::*;
5
+ use std::fs::File;
6
+ use std::io::Read;
7
+
8
+ #[pyclass]
9
+ pub struct BibManager {
10
+ source:Bibliography,
11
+ }
12
+
13
+
14
+ #[pymethods]
15
+ impl BibManager {
16
+ /// Create a new BibManager instance.
17
+ #[new]
18
+ fn new(path:String) -> PyResult<Self> {
19
+ let mut bib=String::new();
20
+
21
+ File::open(path)?.read_to_string(&mut bib).map_err(|e| PyErr::new::<PyRuntimeError,_>(format!("{}", e)))?;
22
+ Ok(BibManager {
23
+ source: Bibliography::parse(bib.as_str()).map_err(|e| PyErr::new::<PyRuntimeError,_>(format!("{}", e)))?,
24
+ })
25
+ }
26
+
27
+
28
+
29
+ /// find the cite key of an article with given title
30
+ fn get_cite_key(&self,title:String)->Option<String>{
31
+ self.source.iter().par_bridge()
32
+ .find_map_any(|entry|{
33
+ if entry.title().map_err(|e| PyErr::new::<PyRuntimeError,_>(format!("{}", e))).ok()?.to_biblatex_string(false).to_lowercase()==title.to_lowercase(){
34
+ return Some(entry.key.clone())
35
+ }
36
+ None
37
+ })
38
+ }
39
+ }
40
+
41
+
42
+ pub(crate) fn register(_: Python, m: &Bound<'_, PyModule>) -> PyResult<()> {
43
+ m.add_class::<BibManager>()?;
44
+ Ok(())
45
+ }
@@ -1,6 +1,7 @@
1
1
  mod templates;
2
2
  mod hash;
3
3
  mod hbs_helpers;
4
+ mod bib_tools;
4
5
 
5
6
  use pyo3::prelude::*;
6
7
 
@@ -14,7 +15,7 @@ fn _rust(python: Python, m: &Bound<'_, PyModule>) -> PyResult<()> {
14
15
  // Add the TemplateManager class to the Python module
15
16
  templates::register(python, m)?;
16
17
  hash::register(python, m)?;
17
-
18
+ bib_tools::register(python, m)?;
18
19
  Ok(())
19
20
  }
20
21
 
Binary file
@@ -222,7 +222,7 @@ wheels = [
222
222
 
223
223
  [[package]]
224
224
  name = "fabricatio"
225
- version = "0.2.5.dev0"
225
+ version = "0.2.5.dev1"
226
226
  source = { editable = "." }
227
227
  dependencies = [
228
228
  { name = "appdirs" },
Binary file
File without changes