fabricatio 0.2.11.dev3__cp312-cp312-win_amd64.whl → 0.2.12__cp312-cp312-win_amd64.whl

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.
fabricatio/models/role.py CHANGED
@@ -2,18 +2,18 @@
2
2
 
3
3
  from typing import Any, Self, Set
4
4
 
5
- from fabricatio.capabilities.correct import Correct
6
- from fabricatio.capabilities.task import HandleTask, ProposeTask
5
+ from fabricatio.capabilities.propose import Propose
7
6
  from fabricatio.core import env
8
7
  from fabricatio.journal import logger
9
8
  from fabricatio.models.action import WorkFlow
10
9
  from fabricatio.models.events import Event
11
10
  from fabricatio.models.generic import WithBriefing
12
11
  from fabricatio.models.tool import ToolBox
12
+ from fabricatio.models.usages import ToolBoxUsage
13
13
  from pydantic import Field
14
14
 
15
15
 
16
- class Role(WithBriefing, ProposeTask, HandleTask, Correct):
16
+ class Role(WithBriefing, Propose, ToolBoxUsage):
17
17
  """Class that represents a role with a registry of events and workflows.
18
18
 
19
19
  A Role serves as a container for workflows, managing their registration to events
@@ -23,7 +23,8 @@ class Role(WithBriefing, ProposeTask, HandleTask, Correct):
23
23
  registry: Mapping of events to workflows that handle them
24
24
  toolboxes: Set of toolboxes available to this role and its workflows
25
25
  """
26
- description:str =""
26
+
27
+ description: str = ""
27
28
  """A brief description of the role's responsibilities and capabilities."""
28
29
 
29
30
  registry: dict[Event | str, WorkFlow] = Field(default_factory=dict)
Binary file
fabricatio/rust.pyi CHANGED
@@ -12,7 +12,9 @@ Key Features:
12
12
  """
13
13
 
14
14
  from pathlib import Path
15
- from typing import Any, Dict, List, Optional, overload
15
+ from typing import Any, Dict, List, Optional, Tuple, overload
16
+
17
+ from pydantic import JsonValue
16
18
 
17
19
  class TemplateManager:
18
20
  """Template rendering engine using Handlebars templates.
@@ -325,6 +327,16 @@ def convert_all_block_tex(string: str) -> str:
325
327
  The converted string with block TeX code replaced.
326
328
  """
327
329
 
330
+ def fix_misplaced_labels(string: str) -> str:
331
+ """A func to fix labels in a string.
332
+
333
+ Args:
334
+ string: The input string containing misplaced labels.
335
+
336
+ Returns:
337
+ The fixed string with labels properly placed.
338
+ """
339
+
328
340
  def comment(string: str) -> str:
329
341
  """Add comment to the string.
330
342
 
@@ -344,3 +356,24 @@ def uncomment(string: str) -> str:
344
356
  Returns:
345
357
  The string with comments (lines starting with '// ' or '//') removed.
346
358
  """
359
+
360
+ def split_out_metadata(string: str) -> Tuple[Optional[JsonValue], str]:
361
+ """Split out metadata from a string.
362
+
363
+ Args:
364
+ string: The input string containing metadata.
365
+
366
+ Returns:
367
+ A tuple containing the metadata as a Python object (if parseable) and the remaining string.
368
+ """
369
+
370
+ def to_metadata(data: JsonValue) -> str:
371
+ """Convert a Python object to a YAML string.
372
+
373
+ Args:
374
+ data: The Python object to be converted to YAML.
375
+
376
+ Returns:
377
+ The YAML string representation of the input data.
378
+ """
379
+
fabricatio/utils.py CHANGED
@@ -47,7 +47,7 @@ async def ask_retain[V](candidates: List[str], value_mapping: Optional[List[V]]
47
47
  "Please choose those that should be retained.",
48
48
  choices=[Choice(p, value=p, checked=True) for p in candidates]
49
49
  if value_mapping is None
50
- else [Choice(p, value=v) for p, v in zip(candidates, value_mapping, strict=True)],
50
+ else [Choice(p, value=v, checked=True) for p, v in zip(candidates, value_mapping, strict=True)],
51
51
  ).ask_async()
52
52
 
53
53
 
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fabricatio
3
- Version: 0.2.11.dev3
3
+ Version: 0.2.12
4
4
  Classifier: License :: OSI Approved :: MIT License
5
5
  Classifier: Programming Language :: Rust
6
6
  Classifier: Programming Language :: Python :: 3.12
@@ -1,65 +1,66 @@
1
- fabricatio-0.2.11.dev3.dist-info/METADATA,sha256=alou2beIqeg3_FeS2dp-VQx15_Ep-0bf-tbGrUSxGmw,5263
2
- fabricatio-0.2.11.dev3.dist-info/WHEEL,sha256=jABKVkLC9kJr8mi_er5jOqpiQUjARSLXDUIIxDqsS50,96
3
- fabricatio-0.2.11.dev3.dist-info/licenses/LICENSE,sha256=do7J7EiCGbq0QPbMAL_FqLYufXpHnCnXBOuqVPwSV8Y,1088
1
+ fabricatio-0.2.12.dist-info/METADATA,sha256=JaFXM9UFAfoqCv7Q_9hM6ADhzGYsuL6uQDbo3KVC8w8,5258
2
+ fabricatio-0.2.12.dist-info/WHEEL,sha256=jABKVkLC9kJr8mi_er5jOqpiQUjARSLXDUIIxDqsS50,96
3
+ fabricatio-0.2.12.dist-info/licenses/LICENSE,sha256=do7J7EiCGbq0QPbMAL_FqLYufXpHnCnXBOuqVPwSV8Y,1088
4
4
  fabricatio/actions/article.py,sha256=SFl1zc0hz9vW2sW4VJm9-w8E7kLEty-2LzXi9wgWMmE,10905
5
- fabricatio/actions/article_rag.py,sha256=P1Bgvk6w8HogEMOw15-_cn2lzKpIcmfe_Ku2mlkdkYk,14318
5
+ fabricatio/actions/article_rag.py,sha256=i_aH0cERwAk5sgZaKfvx9Zs8NZ8ZBFqUzQhlYMkt6EE,18776
6
6
  fabricatio/actions/fs.py,sha256=gJR14U4ln35nt8Z7OWLVAZpqGaLnED-r1Yi-lX22tkI,959
7
- fabricatio/actions/output.py,sha256=ttXLC2wZmtVN9Ik8zsA7g45rwBO656LyRjOGRdVSyJA,6977
7
+ fabricatio/actions/output.py,sha256=lX0HkDse3ypCzZgeF-8Dr-EnNFdBiE-WQ1iLPFlGM1g,8302
8
8
  fabricatio/actions/rag.py,sha256=KN-OWgcQjGmNgSZ-s5B8m4LpYKSGFJR8eq72mo2CP9k,3592
9
9
  fabricatio/actions/rules.py,sha256=dkvCgNDjt2KSO1VgPRsxT4YBmIIMeetZb5tiz-slYkU,3640
10
10
  fabricatio/actions/__init__.py,sha256=wVENCFtpVb1rLFxoOFJt9-8smLWXuJV7IwA8P3EfFz4,48
11
11
  fabricatio/capabilities/advanced_judge.py,sha256=selB0Gwf1F4gGJlwBiRo6gI4KOUROgh3WnzO3mZFEls,706
12
+ fabricatio/capabilities/advanced_rag.py,sha256=gt4ccqyMSVwQLwsEyJrjPc-RXMZZBwObIjsh8A8ILbM,2386
12
13
  fabricatio/capabilities/censor.py,sha256=bBT5qy-kp7fh8g4Lz3labSwxwJ60gGd_vrkc6k1cZ1U,4719
13
14
  fabricatio/capabilities/check.py,sha256=kYqzohhv2bZfl1aKSUt7a8snT8YEl2zgha_ZdAdMMfQ,8622
14
15
  fabricatio/capabilities/correct.py,sha256=W_cInqlciNEhyMK0YI53jk4EvW9uAdge90IO9OElUmA,10420
15
16
  fabricatio/capabilities/extract.py,sha256=PMjkWvbsv57IYT7zzd_xbIu4eQqQjpcmBtJzqlWZhHY,2495
16
17
  fabricatio/capabilities/propose.py,sha256=hkBeSlmcTdfYWT-ph6nlbtHXBozi_JXqXlWcnBy3W78,2007
17
- fabricatio/capabilities/rag.py,sha256=kqcunWBC6oA4P1rzIG2Xu9zqSg73H3uKPF41JJQ1HVI,9595
18
+ fabricatio/capabilities/rag.py,sha256=a48dEaWE-sniwLhNtGz4xlSmRi_-PdOgDzNaDwnam_g,9619
18
19
  fabricatio/capabilities/rating.py,sha256=iMtQs3H6vCjuEjiuuz4SRKMVaX7yff7MHWz-slYvi5g,17835
19
20
  fabricatio/capabilities/review.py,sha256=-EMZe0ADFPT6fPGmra16UPjJC1M3rAs6dPFdTZ88Fgg,5060
20
21
  fabricatio/capabilities/task.py,sha256=uks1U-4LNCUdwdRxAbJJjMc31hOw6jlrcYriuQQfb04,4475
21
22
  fabricatio/capabilities/__init__.py,sha256=v1cHRHIJ2gxyqMLNCs6ERVcCakSasZNYzmMI4lqAcls,57
22
- fabricatio/config.py,sha256=okqrVoLhvmAjmfQXlLY3js4nC_qW4v7mxoYaGO2dMQ8,17984
23
+ fabricatio/config.py,sha256=ckm55Oq0IhG1ztwHbKOG-7Mg7uWE1fb_-DxeKZyc8DQ,17951
23
24
  fabricatio/constants.py,sha256=thfDuF6JEtJ5CHOnAJLfqvn5834n8ep6DH2jc6XGzQM,577
24
25
  fabricatio/core.py,sha256=VQ_JKgUGIy2gZ8xsTBZCdr_IP7wC5aPg0_bsOmjQ588,6458
25
26
  fabricatio/decorators.py,sha256=RFMYUlQPf561-BIHetpMd7fPig5bZ2brzWiQTgoLOlY,8966
26
- fabricatio/fs/curd.py,sha256=p8y0LGKgVDk-CWOlm37E6wg7RK6RCD6denKo-VsW28c,4763
27
+ fabricatio/fs/curd.py,sha256=652nHulbJ3gwt0Z3nywtPMmjhEyglDvEfc3p7ieJNNA,4777
27
28
  fabricatio/fs/readers.py,sha256=UXvcJO3UCsxHu9PPkg34Yh55Zi-miv61jD_wZQJgKRs,1751
28
29
  fabricatio/fs/__init__.py,sha256=FydmlEY_3QY74r1BpGDc5lFLhE6g6gkwOAtE30Fo-aI,786
29
30
  fabricatio/journal.py,sha256=stnEP88aUBA_GmU9gfTF2EZI8FS2OyMLGaMSTgK4QgA,476
30
- fabricatio/models/action.py,sha256=SnL8FAZsUCi9xM9BZT-CSjSRuI-4YBC5By8-ZHEBrW8,10109
31
+ fabricatio/models/action.py,sha256=X7xbun7SyIEpC3-kbJgAagquJGkOBlxhBxbC_sHZX2w,10120
31
32
  fabricatio/models/adv_kwargs_types.py,sha256=kUO-SiZtFuz5cZCmMLnJJ9tjQ4-Zd_foo6R8HQMlM5A,1950
32
33
  fabricatio/models/events.py,sha256=wiirk_ASg3iXDOZU_gIimci1VZVzWE1nDmxy-hQVJ9M,4150
33
34
  fabricatio/models/extra/advanced_judge.py,sha256=INUl_41C8jkausDekkjnEmTwNfLCJ23TwFjq2cM23Cw,1092
34
- fabricatio/models/extra/aricle_rag.py,sha256=bJ9qNa9DkTVvja8GVue5wMnJCwnr6TEO7_fQbQK7fv4,9780
35
- fabricatio/models/extra/article_base.py,sha256=CeYs0D6XghxgpSnQ-rhtWuuFhcouy_vc6E5oUCPck_w,12840
35
+ fabricatio/models/extra/aricle_rag.py,sha256=p91JI8FmFSrHVg5KbhJq4w8vQdx4VUW75SrtQUi9ju4,10987
36
+ fabricatio/models/extra/article_base.py,sha256=R8EOlQBs7hadjP9cxG_uc24DJDpiVpJW9Wb9DA6XmXE,14516
36
37
  fabricatio/models/extra/article_essence.py,sha256=mlIkkRMR3I1RtqiiOnmIE3Vy623L4eECumkRzryE1pw,2749
37
- fabricatio/models/extra/article_main.py,sha256=4rjev0wpI2jf52NLNatRbqFQmN6rtKaMB9iy30hSEXM,9818
38
- fabricatio/models/extra/article_outline.py,sha256=w7O0SHgC7exbptWVbR62FMHAueMgBpyWKVYMGGl_oj8,1427
38
+ fabricatio/models/extra/article_main.py,sha256=pwY2bTYlnz8nh8y3nb_8nnYcYCmoed7ejK-ZSD8ocYc,11584
39
+ fabricatio/models/extra/article_outline.py,sha256=C9WNZNSz6gyuw9lDp29qidPvHBTENaeqcHfCoE_Y7F4,2793
39
40
  fabricatio/models/extra/article_proposal.py,sha256=NbyjW-7UiFPtnVD9nte75re4xL2pD4qL29PpNV4Cg_M,1870
40
41
  fabricatio/models/extra/patches.py,sha256=_WNCxtYzzsVfUxI16vu4IqsLahLYRHdbQN9er9tqhC0,997
41
42
  fabricatio/models/extra/problem.py,sha256=8tTU-3giFHOi5j7NJsvH__JJyYcaGrcfsRnkzQNm0Ew,7216
42
43
  fabricatio/models/extra/rag.py,sha256=RMi8vhEPB0I5mVmjRLRLxYHUnm9pFhvVwysaIwmW2s0,3955
43
44
  fabricatio/models/extra/rule.py,sha256=KQQELVhCLUXhEZ35jU3WGYqKHuCYEAkn0p6pxAE-hOU,2625
44
45
  fabricatio/models/extra/__init__.py,sha256=XlYnS_2B9nhLhtQkjE7rvvfPmAAtXVdNi9bSDAR-Ge8,54
45
- fabricatio/models/generic.py,sha256=7wcG01DN9g4q1DJGZsTUxSTMixQgwXX0xlX4HbbLc6U,31185
46
- fabricatio/models/kwargs_types.py,sha256=GEw75ZiiDEFx_ImhCBENnPF7K0BcdTQ1ocH5jSPwMRs,4774
47
- fabricatio/models/role.py,sha256=-CRcj5_M3_ciLPzwiNn92grBmwoSLQ-n4koVZiCNTBM,2953
46
+ fabricatio/models/generic.py,sha256=yXaVyUd3MK0lFUgsT0diMWtgD9s5rM9yKTH44eE58jM,31314
47
+ fabricatio/models/kwargs_types.py,sha256=BPqZUgxz4WJaB7hmvrhNxHXp-O7O4SiAdn6UguBRij8,4784
48
+ fabricatio/models/role.py,sha256=b8FDRF4VjMMt93Uh5yiAufFbsoH7RcUaaFJAjVmq2l0,2931
48
49
  fabricatio/models/task.py,sha256=bLYSKjlRAlb4jMYyF12RTnm_8pVXysSmX8CYLrEmbQ8,11096
49
50
  fabricatio/models/tool.py,sha256=jQ51g4lwTPfsMF1nbreDJtBczbxIHoXcPuLSOqHliq8,12506
50
51
  fabricatio/models/usages.py,sha256=0bzITf0vug9ZaN6qnjNfFB7T8BAvpXE0bvx0otFYLLA,33356
51
52
  fabricatio/parser.py,sha256=-RbW2yzfJiu2ARq-lZw4tfgsjY2rIZWtJpoUmaE6gJQ,6637
52
53
  fabricatio/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
53
- fabricatio/rust.pyi,sha256=GJRLeeQ1UIaf5kOgJWX2GkwIacoTBk3yBKuD5cKW8i4,10489
54
+ fabricatio/rust.pyi,sha256=kU-I0PD-tG0RGTy5xUobneXY-E06Qopjp4v1awpYmGw,11339
54
55
  fabricatio/rust_instances.py,sha256=Byeo8KHW_dJiXujJq7YPGDLBX5bHNDYbBc4sY3uubVY,313
55
56
  fabricatio/toolboxes/arithmetic.py,sha256=WLqhY-Pikv11Y_0SGajwZx3WhsLNpHKf9drzAqOf_nY,1369
56
57
  fabricatio/toolboxes/fs.py,sha256=l4L1CVxJmjw9Ld2XUpIlWfV0_Fu_2Og6d3E13I-S4aE,736
57
58
  fabricatio/toolboxes/__init__.py,sha256=KBJi5OG_pExscdlM7Bnt_UF43j4I3Lv6G71kPVu4KQU,395
58
- fabricatio/utils.py,sha256=sLD6L_BHXusJjCu3gsUpxOFbmEOnT577xU1kaZQ04SE,3084
59
+ fabricatio/utils.py,sha256=4aK6bNHCCGEbSkLRKrDBzabuVAow9PrJ6SVGUX1Rt-U,3098
59
60
  fabricatio/workflows/articles.py,sha256=ObYTFUqLUk_CzdmmnX6S7APfxcGmPFqnFr9pdjU7Z4Y,969
60
61
  fabricatio/workflows/rag.py,sha256=-YYp2tlE9Vtfgpg6ROpu6QVO8j8yVSPa6yDzlN3qVxs,520
61
62
  fabricatio/workflows/__init__.py,sha256=5ScFSTA-bvhCesj3U9Mnmi6Law6N1fmh5UKyh58L3u8,51
62
63
  fabricatio/__init__.py,sha256=Rmvq2VgdS2u68vnOi2i5RbeWbAwrJDbk8D8D883PJWE,1022
63
- fabricatio/rust.cp312-win_amd64.pyd,sha256=Z3wuzfa_m81nq1W6MVF66ne-gQ0-gkNFdknay_wVskY,4150272
64
- fabricatio-0.2.11.dev3.data/scripts/tdown.exe,sha256=nHWlrICGMzmDpo1bZA-l1tqyCZhSreyrc5S1J3E7KgU,3350016
65
- fabricatio-0.2.11.dev3.dist-info/RECORD,,
64
+ fabricatio/rust.cp312-win_amd64.pyd,sha256=9fwCiSGJP6jMgEcXaapRP2c52hVH1fabWB-f-BdQkoA,4435456
65
+ fabricatio-0.2.12.data/scripts/tdown.exe,sha256=TP6KyXotHgQrs43Xwev02s__JPcU499AN44ZDUfuciU,3350016
66
+ fabricatio-0.2.12.dist-info/RECORD,,