fabricatio 0.2.0.dev10__cp312-cp312-win_amd64.whl → 0.2.0.dev11__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/__init__.py CHANGED
@@ -1,7 +1,6 @@
1
1
  """Fabricatio is a Python library for building llm app using event-based agent structure."""
2
2
 
3
- from fabricatio._rust import TemplateManager
4
- from fabricatio.config import configs
3
+ from fabricatio._rust_instances import template_manager
5
4
  from fabricatio.core import env
6
5
  from fabricatio.fs import magika
7
6
  from fabricatio.journal import logger
@@ -13,8 +12,6 @@ from fabricatio.models.tool import ToolBox
13
12
  from fabricatio.models.utils import Message, Messages
14
13
  from fabricatio.parser import Capture, CodeBlockCapture, JsonCapture, PythonCapture
15
14
 
16
- template_manager = TemplateManager(configs.code2prompt.template_dir)
17
-
18
15
  __all__ = [
19
16
  "Action",
20
17
  "Capture",
Binary file
@@ -0,0 +1,4 @@
1
+ from fabricatio._rust import TemplateManager
2
+ from fabricatio.config import configs
3
+
4
+ template_manager = TemplateManager(configs.code2prompt.template_dir)
fabricatio/models/task.py CHANGED
@@ -7,6 +7,7 @@ from asyncio import Queue
7
7
  from enum import Enum
8
8
  from typing import Any, List, Optional, Self
9
9
 
10
+ from fabricatio._rust_instances import template_manager
10
11
  from fabricatio.core import env
11
12
  from fabricatio.journal import logger
12
13
  from fabricatio.models.events import Event, EventLike
@@ -273,11 +274,12 @@ class ProposeTask(LLMUsage, WithBriefing):
273
274
  logger.error(f"Failed to parse task from JSON: {e}")
274
275
  return None
275
276
 
277
+ template_data = {
278
+ "prompt": prompt,
279
+ "json_example": Task.json_example()
280
+ }
276
281
  return await self.aask_validate(
277
- f"{prompt} \n\nBased on requirement above, "
278
- f"you need to construct a task to satisfy that requirement in JSON format "
279
- f"written like this: \n\n```json\n{Task.json_example()}\n```\n\n"
280
- f"No extra explanation needed. ",
282
+ template_manager.render_template("propose_task", template_data),
281
283
  _validate_json,
282
284
  system_message=f"# your personal briefing: \n{self.briefing}",
283
285
  )
@@ -1,7 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fabricatio
3
- Version: 0.2.0.dev10
3
+ Version: 0.2.0.dev11
4
4
  Classifier: License :: OSI Approved :: MIT License
5
+ Classifier: Programming Language :: Rust
5
6
  Classifier: Programming Language :: Python :: 3.12
6
7
  Classifier: Programming Language :: Python :: Implementation :: CPython
7
8
  Classifier: Framework :: AsyncIO
@@ -23,7 +24,7 @@ Requires-Dist: regex>=2024.11.6
23
24
  Requires-Dist: rich>=13.9.4
24
25
  License-File: LICENSE
25
26
  Summary: A LLM multi-agent framework.
26
- Keywords: ai,agents,multi-agent,llm
27
+ Keywords: ai,agents,multi-agent,llm,pyo3
27
28
  Author-email: Whth <zettainspector@foxmail.com>
28
29
  Requires-Python: >=3.12
29
30
  Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
@@ -1,6 +1,6 @@
1
- fabricatio-0.2.0.dev10.dist-info/METADATA,sha256=dNWLPv66ZRGHyczv0HrHrih837C8eg8MrWnZa6aPKSk,5971
2
- fabricatio-0.2.0.dev10.dist-info/WHEEL,sha256=tpW5AN9B-9qsM9WW2FXG2r193YXiqexDadpKp0A2daI,96
3
- fabricatio-0.2.0.dev10.dist-info/licenses/LICENSE,sha256=do7J7EiCGbq0QPbMAL_FqLYufXpHnCnXBOuqVPwSV8Y,1088
1
+ fabricatio-0.2.0.dev11.dist-info/METADATA,sha256=YbNXgr1d-MFCEAUePsKUxcv4vsfok3Q_wIcqbgYn0TA,6017
2
+ fabricatio-0.2.0.dev11.dist-info/WHEEL,sha256=tpW5AN9B-9qsM9WW2FXG2r193YXiqexDadpKp0A2daI,96
3
+ fabricatio-0.2.0.dev11.dist-info/licenses/LICENSE,sha256=do7J7EiCGbq0QPbMAL_FqLYufXpHnCnXBOuqVPwSV8Y,1088
4
4
  fabricatio/actions/communication.py,sha256=tmsr3H_w-V-b2WxLEyWByGuwSCLgHIHTdHYAgHrdUxc,425
5
5
  fabricatio/actions/transmission.py,sha256=PedZ6XsflKdT5ikzaqWr_6h8jci0kekAHfwygzKBUns,1188
6
6
  fabricatio/actions/__init__.py,sha256=eFmFVPQvtNgFynIXBVr3eP-vWQDWCPng60YY5LXvZgg,115
@@ -14,7 +14,7 @@ fabricatio/models/action.py,sha256=-kTWzUGIkZygy3tqcrEBQvboEJx2-PGAQR0C0ZqERRE,5
14
14
  fabricatio/models/events.py,sha256=DDdcexweKV7jmPLHx51PIQ6eIByRrFyAMyx2VMhl9JY,2650
15
15
  fabricatio/models/generic.py,sha256=CtC6xzSbZr1oQUwswlHVeEbf3pXuS0Q7Qo-e0S_2Zp4,16086
16
16
  fabricatio/models/role.py,sha256=sgsympwkp6HIbWkaAt4gMU2WdVO-bHwX0Gy6DNyhoLA,1016
17
- fabricatio/models/task.py,sha256=6OwCqvtQvwAnF5Dv0fwbmp8Jv7zNuHb15ySIL15VqFs,9429
17
+ fabricatio/models/task.py,sha256=Gw1dAeeSPyNdlbcWnrKHDPs7owoOqLTnm5sxBFsBYvk,9409
18
18
  fabricatio/models/tool.py,sha256=3htDwksf4k6JfYRY3RYirjvcpZUqwj5BNB7DO0nGBN0,3399
19
19
  fabricatio/models/utils.py,sha256=i_kpcQpct04mQFk1nbcVGV-pl1YThWu4Qk3wbewzKkc,2535
20
20
  fabricatio/parser.py,sha256=eIdpGBUKHAAWaWEu3NP_7zwgsxHoXIMVaHUAlSjQ6ko,2424
@@ -22,7 +22,8 @@ fabricatio/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
22
  fabricatio/toolboxes/task.py,sha256=xgyPetm2R_HlQwpzE8YPnBN7QOYLd0-T8E6QPZG1PPQ,204
23
23
  fabricatio/toolboxes/__init__.py,sha256=bjefmPd7wBaWhbZzdMPXvrjMTeRzlUh_Dev2PUAc124,158
24
24
  fabricatio/_rust.pyi,sha256=IHNv9SHdjve24PBWhdRGCqWYdo2tSAkxYR9CddHhzX8,1540
25
- fabricatio/__init__.py,sha256=fop9UtHY_FGoqjtiHHREXFqO5vUrbc9vnm0wgLgZC8I,1012
26
- fabricatio/_rust.cp312-win_amd64.pyd,sha256=-TbjfckvcCu7xmWpbgRQGpr8Y6vModoVFOjWWX6s5x8,1123840
27
- fabricatio-0.2.0.dev10.data/scripts/tdown.exe,sha256=5pJQDhralWahKr5r84HeLW02DyG2K2kXidUQFzw9h38,3387904
28
- fabricatio-0.2.0.dev10.dist-info/RECORD,,
25
+ fabricatio/_rust_instances.py,sha256=PJC8TAkcH9f1Ak-0CKxSom_HTFHQEXZ8-aSDrYw7dwI,157
26
+ fabricatio/__init__.py,sha256=PDDcg-2xRcPrUI1PwlO-jp2ZE0Cb-JAjm2bJX4k_v8g,912
27
+ fabricatio/_rust.cp312-win_amd64.pyd,sha256=-NNhrNKOPQwAi-Np1vTMiw0W07JsSIuxbOrEFknpzeU,1123840
28
+ fabricatio-0.2.0.dev11.data/scripts/tdown.exe,sha256=5rX8rGz1cWDMbPlBWbcarlCKlLty7_bgRtDL5iTvv8I,3387904
29
+ fabricatio-0.2.0.dev11.dist-info/RECORD,,