fabricatio 0.2.0.dev4__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.
@@ -0,0 +1,224 @@
1
+ Metadata-Version: 2.4
2
+ Name: fabricatio
3
+ Version: 0.2.0.dev4
4
+ Classifier: License :: OSI Approved :: MIT License
5
+ Classifier: Programming Language :: Python :: 3.12
6
+ Classifier: Programming Language :: Python :: Implementation :: CPython
7
+ Classifier: Framework :: AsyncIO
8
+ Classifier: Framework :: Pydantic :: 2
9
+ Classifier: Typing :: Typed
10
+ Requires-Dist: appdirs>=1.4.4
11
+ Requires-Dist: asyncio>=3.4.3
12
+ Requires-Dist: code2prompt
13
+ Requires-Dist: gitpython>=3.1.44
14
+ Requires-Dist: litellm>=1.60.0
15
+ Requires-Dist: loguru>=0.7.3
16
+ Requires-Dist: magika>=0.5.1
17
+ Requires-Dist: orjson>=3.10.15
18
+ Requires-Dist: pydantic>=2.10.6
19
+ Requires-Dist: pydantic-settings>=2.7.1
20
+ Requires-Dist: pymitter>=1.0.0
21
+ Requires-Dist: questionary>=2.1.0
22
+ Requires-Dist: regex>=2024.11.6
23
+ Requires-Dist: rich>=13.9.4
24
+ License-File: LICENSE
25
+ Summary: A LLM multi-agent framework.
26
+ Keywords: ai,agents,multi-agent,llm
27
+ Author-email: Whth <zettainspector@foxmail.com>
28
+ Requires-Python: >=3.12
29
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
30
+
31
+ # Fabricatio
32
+
33
+ ---
34
+
35
+ Fabricatio is a powerful framework designed to facilitate the creation and management of tasks, actions, and workflows. It leverages modern Python features and libraries to provide a robust and flexible environment for building applications that require task automation and orchestration.
36
+
37
+ ## Table of Contents
38
+
39
+ - [Installation](#installation)
40
+ - [Usage](#usage)
41
+ - [Defining a Task](#defining-a-task)
42
+ - [Creating an Action](#creating-an-action)
43
+ - [Assigning a Role](#assigning-a-role)
44
+ - [Logging](#logging)
45
+ - [Configuration](#configuration)
46
+ - [LLM Configuration](#llm-configuration)
47
+ - [Debug Configuration](#debug-configuration)
48
+ - [Examples](#examples)
49
+ - [Simple Task Example](#simple-task-example)
50
+ - [Complex Workflow Example](#complex-workflow-example)
51
+ - [Contributing](#contributing)
52
+ - [License](#license)
53
+
54
+ ## Installation
55
+ To install Fabricatio, you can use pip:
56
+
57
+ ```bash
58
+ pip install fabricatio
59
+ ```
60
+
61
+ Alternatively, you can clone the repository and install it manually:
62
+
63
+ ```bash
64
+ git clone https://github.com/your-repo/fabricatio.git
65
+ cd fabricatio
66
+ pip install .
67
+ ```
68
+
69
+
70
+ ## Usage
71
+
72
+ ### Defining a Task
73
+
74
+ A task in Fabricatio is defined using the `Task` class. You can specify the name, goal, and description of the task.
75
+
76
+ ```python
77
+ from fabricatio.models.task import Task
78
+
79
+ task = Task(name="say hello", goal="say hello", description="say hello to the world")
80
+ ```
81
+
82
+
83
+ ### Creating an Action
84
+
85
+ Actions are the building blocks of workflows. They perform specific tasks and can be asynchronous.
86
+
87
+ ```python
88
+ from fabricatio import Action, logger
89
+ from fabricatio.models.task import Task
90
+
91
+ class Talk(Action):
92
+ async def _execute(self, task_input: Task[str], **_) -> str:
93
+ ret = "Hello fabricatio!"
94
+ logger.info("executing talk action")
95
+ return ret
96
+ ```
97
+
98
+
99
+ ### Assigning a Role
100
+
101
+ Roles in Fabricatio are responsible for executing workflows. You can define a role with a set of actions.
102
+
103
+ ```python
104
+ from fabricatio.models.role import Role
105
+ from fabricatio.models.action import WorkFlow
106
+
107
+ class TestWorkflow(WorkFlow):
108
+ pass
109
+
110
+ role = Role(name="Test Role", actions=[TestWorkflow()])
111
+ ```
112
+
113
+
114
+ ### Logging
115
+
116
+ Fabricatio uses Loguru for logging. You can configure the log level and file in the `config.py` file.
117
+
118
+ ```python
119
+ from fabricatio.config import DebugConfig
120
+
121
+ debug_config = DebugConfig(log_level="DEBUG", log_file="fabricatio.log")
122
+ ```
123
+
124
+
125
+ ## Configuration
126
+
127
+ Fabricatio uses Pydantic for configuration management. You can define your settings in the `config.py` file.
128
+
129
+ ### LLM Configuration
130
+
131
+ The Large Language Model (LLM) configuration is managed by the `LLMConfig` class.
132
+
133
+ ```python
134
+ from fabricatio.config import LLMConfig
135
+
136
+ llm_config = LLMConfig(api_endpoint="https://api.example.com")
137
+ ```
138
+
139
+
140
+ ### Debug Configuration
141
+
142
+ The debug configuration is managed by the `DebugConfig` class.
143
+
144
+ ```python
145
+ from fabricatio.config import DebugConfig
146
+
147
+ debug_config = DebugConfig(log_level="DEBUG", log_file="fabricatio.log")
148
+ ```
149
+
150
+
151
+ ## Examples
152
+
153
+ ### Simple Task Example
154
+
155
+ Here is a simple example of a task that prints "Hello fabricatio!".
156
+
157
+ ```python
158
+ import asyncio
159
+ from fabricatio import Action, Role, Task, WorkFlow, logger
160
+
161
+ task = Task(name="say hello", goal="say hello", description="say hello to the world")
162
+
163
+ class Talk(Action):
164
+ async def _execute(self, task_input: Task[str], **_) -> Any:
165
+ ret = "Hello fabricatio!"
166
+ logger.info("executing talk action")
167
+ return ret
168
+
169
+ class TestWorkflow(WorkFlow):
170
+ pass
171
+
172
+ role = Role(name="Test Role", actions=[TestWorkflow()])
173
+
174
+ async def main() -> None:
175
+ await role.act(task)
176
+
177
+ if __name__ == "__main__":
178
+ asyncio.run(main())
179
+ ```
180
+
181
+
182
+ ### Complex Workflow Example
183
+
184
+ Here is a more complex example that demonstrates how to create a workflow with multiple actions.
185
+
186
+ ```python
187
+ import asyncio
188
+ from fabricatio import Action, Role, Task, WorkFlow, logger
189
+
190
+ task = Task(name="complex task", goal="perform complex operations", description="a task with multiple actions")
191
+
192
+ class ActionOne(Action):
193
+ async def _execute(self, task_input: Task[str], **_) -> Any:
194
+ ret = "Action One executed"
195
+ logger.info(ret)
196
+ return ret
197
+
198
+ class ActionTwo(Action):
199
+ async def _execute(self, task_input: Task[str], **_) -> Any:
200
+ ret = "Action Two executed"
201
+ logger.info(ret)
202
+ return ret
203
+
204
+ class ComplexWorkflow(WorkFlow):
205
+ actions = [ActionOne(), ActionTwo()]
206
+
207
+ role = Role(name="Complex Role", actions=[ComplexWorkflow()])
208
+
209
+ async def main() -> None:
210
+ await role.act(task)
211
+
212
+ if __name__ == "__main__":
213
+ asyncio.run(main())
214
+ ```
215
+
216
+
217
+ ## Contributing
218
+
219
+ Contributions to Fabricatio are welcome! Please submit a pull request with your changes.
220
+
221
+ ## License
222
+
223
+ Fabricatio is licensed under the MIT License. See the [LICENSE](LICENSE) file for more information.
224
+
@@ -0,0 +1,29 @@
1
+ fabricatio-0.2.0.dev4.dist-info/METADATA,sha256=9PMKRvdGtcJpLzPeu7ifRDPDkWlcRu2zWCHPXSrMi-8,5777
2
+ fabricatio-0.2.0.dev4.dist-info/WHEEL,sha256=tpW5AN9B-9qsM9WW2FXG2r193YXiqexDadpKp0A2daI,96
3
+ fabricatio-0.2.0.dev4.dist-info/licenses/LICENSE,sha256=do7J7EiCGbq0QPbMAL_FqLYufXpHnCnXBOuqVPwSV8Y,1088
4
+ fabricatio/actions/communication.py,sha256=tmsr3H_w-V-b2WxLEyWByGuwSCLgHIHTdHYAgHrdUxc,425
5
+ fabricatio/actions/transmission.py,sha256=PedZ6XsflKdT5ikzaqWr_6h8jci0kekAHfwygzKBUns,1188
6
+ fabricatio/actions/__init__.py,sha256=eFmFVPQvtNgFynIXBVr3eP-vWQDWCPng60YY5LXvZgg,115
7
+ fabricatio/config.py,sha256=FspRwp_gpms_b1rnTgGm5TBkBmG1avEapcxO4Jq6gdc,8041
8
+ fabricatio/core.py,sha256=aaQDGz7spEeJtI2SVSXox4jnMrkLfzEfQDh7mIgoQmQ,5866
9
+ fabricatio/decorators.py,sha256=Qsyb-_cDwtXY5yhyLrYZEAlrHh5ZuEooQ8vEOUAxj8k,1855
10
+ fabricatio/fs/readers.py,sha256=mw0VUH3P7Wk0SMlcQm2yOfjEz5C3mQ_kjduAjecaxgY,123
11
+ fabricatio/fs/__init__.py,sha256=lWcKYg0v3mv2LnnSegOQaTtlVDODU0vtw_s6iKU5IqQ,122
12
+ fabricatio/journal.py,sha256=z5K5waad9xmGr1hGrqSgFDRH3wiDQ5Oqfe0o98DaM-k,707
13
+ fabricatio/models/action.py,sha256=-kTWzUGIkZygy3tqcrEBQvboEJx2-PGAQR0C0ZqERRE,5044
14
+ fabricatio/models/events.py,sha256=DDdcexweKV7jmPLHx51PIQ6eIByRrFyAMyx2VMhl9JY,2650
15
+ fabricatio/models/generic.py,sha256=CtC6xzSbZr1oQUwswlHVeEbf3pXuS0Q7Qo-e0S_2Zp4,16086
16
+ fabricatio/models/role.py,sha256=sgsympwkp6HIbWkaAt4gMU2WdVO-bHwX0Gy6DNyhoLA,1016
17
+ fabricatio/models/task.py,sha256=6OwCqvtQvwAnF5Dv0fwbmp8Jv7zNuHb15ySIL15VqFs,9429
18
+ fabricatio/models/tool.py,sha256=3htDwksf4k6JfYRY3RYirjvcpZUqwj5BNB7DO0nGBN0,3399
19
+ fabricatio/models/utils.py,sha256=i_kpcQpct04mQFk1nbcVGV-pl1YThWu4Qk3wbewzKkc,2535
20
+ fabricatio/parser.py,sha256=eIdpGBUKHAAWaWEu3NP_7zwgsxHoXIMVaHUAlSjQ6ko,2424
21
+ fabricatio/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
+ fabricatio/templates.py,sha256=rmt1cf66wDTjK_LSeATv60eWX2jYO97uAX2yB_Zwtxw,1615
23
+ fabricatio/toolboxes/task.py,sha256=xgyPetm2R_HlQwpzE8YPnBN7QOYLd0-T8E6QPZG1PPQ,204
24
+ fabricatio/toolboxes/__init__.py,sha256=bjefmPd7wBaWhbZzdMPXvrjMTeRzlUh_Dev2PUAc124,158
25
+ fabricatio/_rust.pyi,sha256=FZ9noKJQrdhxq0S9LJYy7BvZnShnDrupDeOv-PpliI4,39
26
+ fabricatio/__init__.py,sha256=eznZiLDVe3pw0NwX36Rari-DK0zxDTpa_wwAmWGnto8,909
27
+ fabricatio/_rust.cp312-win_amd64.pyd,sha256=X8yeIUyLJXrXm1BoijCB86EiXHXZmeM4oY6ww-fuJtM,175104
28
+ fabricatio-0.2.0.dev4.data/scripts/tdown.exe,sha256=H6tRWDe_DJEXAGjf3xbKvxAPq8dHHm1O4Nt5lXuM-cQ,3395584
29
+ fabricatio-0.2.0.dev4.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: maturin (1.8.2)
3
+ Root-Is-Purelib: false
4
+ Tag: cp312-cp312-win_amd64
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Whth Yotta
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.