fabricatio 0.2.7.dev2__cp312-cp312-win_amd64.whl → 0.2.7.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.
- fabricatio/_rust.cp312-win_amd64.pyd +0 -0
- fabricatio/actions/article.py +4 -1
- fabricatio/actions/article_rag.py +35 -0
- fabricatio/models/extra/article_base.py +192 -0
- fabricatio/models/extra/article_essence.py +226 -0
- fabricatio/models/extra/article_main.py +293 -0
- fabricatio/models/extra/article_outline.py +181 -0
- fabricatio/models/extra/article_proposal.py +35 -0
- fabricatio/models/generic.py +55 -2
- fabricatio/models/utils.py +6 -4
- fabricatio-0.2.7.dev4.data/scripts/tdown.exe +0 -0
- fabricatio-0.2.7.dev4.dist-info/METADATA +181 -0
- {fabricatio-0.2.7.dev2.dist-info → fabricatio-0.2.7.dev4.dist-info}/RECORD +15 -10
- fabricatio/models/extra.py +0 -811
- fabricatio-0.2.7.dev2.data/scripts/tdown.exe +0 -0
- fabricatio-0.2.7.dev2.dist-info/METADATA +0 -436
- {fabricatio-0.2.7.dev2.dist-info → fabricatio-0.2.7.dev4.dist-info}/WHEEL +0 -0
- {fabricatio-0.2.7.dev2.dist-info → fabricatio-0.2.7.dev4.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,181 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: fabricatio
|
3
|
+
Version: 0.2.7.dev4
|
4
|
+
Classifier: License :: OSI Approved :: MIT License
|
5
|
+
Classifier: Programming Language :: Rust
|
6
|
+
Classifier: Programming Language :: Python :: 3.12
|
7
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
8
|
+
Classifier: Framework :: AsyncIO
|
9
|
+
Classifier: Framework :: Pydantic :: 2
|
10
|
+
Classifier: Typing :: Typed
|
11
|
+
Requires-Dist: appdirs>=1.4.4
|
12
|
+
Requires-Dist: asyncio>=3.4.3
|
13
|
+
Requires-Dist: asyncstdlib>=3.13.0
|
14
|
+
Requires-Dist: json-repair>=0.39.1
|
15
|
+
Requires-Dist: litellm>=1.60.0
|
16
|
+
Requires-Dist: loguru>=0.7.3
|
17
|
+
Requires-Dist: magika>=0.5.1
|
18
|
+
Requires-Dist: more-itertools>=10.6.0
|
19
|
+
Requires-Dist: orjson>=3.10.15
|
20
|
+
Requires-Dist: pydantic>=2.10.6
|
21
|
+
Requires-Dist: pydantic-settings>=2.7.1
|
22
|
+
Requires-Dist: pymitter>=1.0.0
|
23
|
+
Requires-Dist: questionary>=2.1.0
|
24
|
+
Requires-Dist: regex>=2024.11.6
|
25
|
+
Requires-Dist: rich>=13.9.4
|
26
|
+
Requires-Dist: pymilvus>=2.5.4 ; extra == 'rag'
|
27
|
+
Requires-Dist: fabricatio[calc,plot,rag] ; extra == 'full'
|
28
|
+
Requires-Dist: sympy>=1.13.3 ; extra == 'calc'
|
29
|
+
Requires-Dist: matplotlib>=3.10.1 ; extra == 'plot'
|
30
|
+
Provides-Extra: rag
|
31
|
+
Provides-Extra: full
|
32
|
+
Provides-Extra: calc
|
33
|
+
Provides-Extra: plot
|
34
|
+
License-File: LICENSE
|
35
|
+
Summary: A LLM multi-agent framework.
|
36
|
+
Keywords: ai,agents,multi-agent,llm,pyo3
|
37
|
+
Author-email: Whth <zettainspector@foxmail.com>
|
38
|
+
Requires-Python: >=3.12, <3.13
|
39
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
40
|
+
Project-URL: Homepage, https://github.com/Whth/fabricatio
|
41
|
+
Project-URL: Repository, https://github.com/Whth/fabricatio
|
42
|
+
Project-URL: Issues, https://github.com/Whth/fabricatio/issues
|
43
|
+
|
44
|
+
# Fabricatio
|
45
|
+
|
46
|
+

|
47
|
+

|
48
|
+

|
49
|
+
|
50
|
+
## Overview
|
51
|
+
|
52
|
+
Fabricatio is a streamlined Python library for building LLM applications using an event-based agent structure. It leverages Rust for performance-critical tasks, Handlebars for templating, and PyO3 for Python bindings.
|
53
|
+
|
54
|
+
## Features
|
55
|
+
|
56
|
+
- **Event-Driven Architecture**: Robust task management through an EventEmitter pattern.
|
57
|
+
- **LLM Integration & Templating**: Seamlessly interact with large language models and dynamic content generation.
|
58
|
+
- **Async & Extensible**: Fully asynchronous execution with easy extension via custom actions and workflows.
|
59
|
+
|
60
|
+
## Installation
|
61
|
+
|
62
|
+
### Using UV (Recommended)
|
63
|
+
|
64
|
+
```bash
|
65
|
+
# Install uv if not already installed
|
66
|
+
pip install uv
|
67
|
+
|
68
|
+
# Clone the repository
|
69
|
+
git clone https://github.com/Whth/fabricatio.git
|
70
|
+
cd fabricatio
|
71
|
+
|
72
|
+
# Install the package in development mode with uv
|
73
|
+
uv --with-editable . maturin develop --uv -r
|
74
|
+
```
|
75
|
+
|
76
|
+
### Building Distribution
|
77
|
+
|
78
|
+
```bash
|
79
|
+
# Build distribution packages
|
80
|
+
make bdist
|
81
|
+
```
|
82
|
+
|
83
|
+
## Usage
|
84
|
+
|
85
|
+
### Basic Example
|
86
|
+
|
87
|
+
```python
|
88
|
+
import asyncio
|
89
|
+
from fabricatio import Action, Role, Task, logger, WorkFlow
|
90
|
+
from typing import Any
|
91
|
+
|
92
|
+
class Hello(Action):
|
93
|
+
name: str = "hello"
|
94
|
+
output_key: str = "task_output"
|
95
|
+
|
96
|
+
async def _execute(self, task_input: Task[str], **_) -> Any:
|
97
|
+
ret = "Hello fabricatio!"
|
98
|
+
logger.info("executing talk action")
|
99
|
+
return ret
|
100
|
+
|
101
|
+
async def main() -> None:
|
102
|
+
role = Role(
|
103
|
+
name="talker",
|
104
|
+
description="talker role",
|
105
|
+
registry={Task.pending_label: WorkFlow(name="talk", steps=(Hello,))}
|
106
|
+
)
|
107
|
+
|
108
|
+
task = Task(name="say hello", goals="say hello", description="say hello to the world")
|
109
|
+
result = await task.delegate()
|
110
|
+
logger.success(f"Result: {result}")
|
111
|
+
|
112
|
+
if __name__ == "__main__":
|
113
|
+
asyncio.run(main())
|
114
|
+
```
|
115
|
+
|
116
|
+
### Examples
|
117
|
+
|
118
|
+
For various usage scenarios, refer to the following examples:
|
119
|
+
- Simple Chat
|
120
|
+
- Retrieval-Augmented Generation (RAG)
|
121
|
+
- Article Extraction
|
122
|
+
- Propose Task
|
123
|
+
- Code Review
|
124
|
+
- Write Outline
|
125
|
+
|
126
|
+
_(For full example details, please check our detailed documentation, see [Examples](./examples))_
|
127
|
+
|
128
|
+
## Configuration
|
129
|
+
|
130
|
+
The configuration for Fabricatio is managed via environment variables or TOML files. For example:
|
131
|
+
|
132
|
+
```toml
|
133
|
+
[llm]
|
134
|
+
api_endpoint = "https://api.openai.com"
|
135
|
+
api_key = "your_openai_api_key"
|
136
|
+
timeout = 300
|
137
|
+
max_retries = 3
|
138
|
+
model = "gpt-3.5-turbo"
|
139
|
+
temperature = 1.0
|
140
|
+
stop_sign = ["\n\n\n", "User:"]
|
141
|
+
top_p = 0.35
|
142
|
+
generation_count = 1
|
143
|
+
stream = false
|
144
|
+
max_tokens = 8192
|
145
|
+
```
|
146
|
+
|
147
|
+
## Development Setup
|
148
|
+
|
149
|
+
1. **Clone the Repository**:
|
150
|
+
```bash
|
151
|
+
git clone https://github.com/Whth/fabricatio.git
|
152
|
+
cd fabricatio
|
153
|
+
```
|
154
|
+
2. **Install Dependencies**:
|
155
|
+
```bash
|
156
|
+
uv --with-editable . maturin develop --uv -r
|
157
|
+
```
|
158
|
+
3. **Run Tests**:
|
159
|
+
```bash
|
160
|
+
make test
|
161
|
+
```
|
162
|
+
|
163
|
+
## Contributing
|
164
|
+
|
165
|
+
Contributions are welcome! Follow these steps:
|
166
|
+
1. Fork the repository.
|
167
|
+
2. Create your feature branch (`git checkout -b feature/new-feature`).
|
168
|
+
3. Commit your changes (`git commit -am 'Add new feature'`).
|
169
|
+
4. Push to the branch (`git push origin feature/new-feature`).
|
170
|
+
5. Create a new Pull Request.
|
171
|
+
|
172
|
+
## License
|
173
|
+
|
174
|
+
Fabricatio is licensed under the MIT License. See [LICENSE](LICENSE) for details.
|
175
|
+
|
176
|
+
## Acknowledgments
|
177
|
+
|
178
|
+
Special thanks to the contributors and maintainers of:
|
179
|
+
- [PyO3](https://github.com/PyO3/pyo3)
|
180
|
+
- [Maturin](https://github.com/PyO3/maturin)
|
181
|
+
- [Handlebars.rs](https://github.com/sunng87/handlebars-rust)
|
@@ -1,7 +1,8 @@
|
|
1
|
-
fabricatio-0.2.7.
|
2
|
-
fabricatio-0.2.7.
|
3
|
-
fabricatio-0.2.7.
|
4
|
-
fabricatio/actions/article.py,sha256=
|
1
|
+
fabricatio-0.2.7.dev4.dist-info/METADATA,sha256=DshHoi8eegFUNjltQNJgm0SkKSGCLPYJj-oaBBlth9o,5259
|
2
|
+
fabricatio-0.2.7.dev4.dist-info/WHEEL,sha256=jABKVkLC9kJr8mi_er5jOqpiQUjARSLXDUIIxDqsS50,96
|
3
|
+
fabricatio-0.2.7.dev4.dist-info/licenses/LICENSE,sha256=do7J7EiCGbq0QPbMAL_FqLYufXpHnCnXBOuqVPwSV8Y,1088
|
4
|
+
fabricatio/actions/article.py,sha256=AgxNKIRLXF9T-TdrhLPE8NWmT8QZXz1QvFnouvuoRBc,7684
|
5
|
+
fabricatio/actions/article_rag.py,sha256=PiOFxI6VTmLXm3BK-01g_KH1mTE9uOtnA-CwUjt16AU,1456
|
5
6
|
fabricatio/actions/output.py,sha256=K7xsBH8MjXRH6JOy3ZO94KCQzX2jNrwPPK_rRXVkS0E,1161
|
6
7
|
fabricatio/actions/rag.py,sha256=QBdzEM8MloM_ahx5pTBZAETm9_631lTe_0ih_he_Iuo,2759
|
7
8
|
fabricatio/capabilities/correct.py,sha256=8GOU2VBPUakjG-r59SqsCgCD0QHX-l__IynCLO-ib8Q,6482
|
@@ -19,14 +20,18 @@ fabricatio/fs/__init__.py,sha256=PCf0s_9KDjVfNw7AfPoJzGt3jMq4gJOfbcT4pb0D0ZY,588
|
|
19
20
|
fabricatio/journal.py,sha256=stnEP88aUBA_GmU9gfTF2EZI8FS2OyMLGaMSTgK4QgA,476
|
20
21
|
fabricatio/models/action.py,sha256=UlflniS__MMrUXglu_U3PDFAtKEjVsKEix17AT9oP3M,8769
|
21
22
|
fabricatio/models/events.py,sha256=QvlnS8FEELg6KNabcJMeh2GV_y0ZBzKOPphcteKYWYU,4183
|
22
|
-
fabricatio/models/extra.py,sha256=
|
23
|
-
fabricatio/models/
|
23
|
+
fabricatio/models/extra/article_base.py,sha256=9zkS89G3L9moc0iYNq9D7DCcv0K52jRQWjM1MUK__dg,8449
|
24
|
+
fabricatio/models/extra/article_essence.py,sha256=DUESuK4CGgkRvIMoJCv4l8MNp5MawRYoNOtLCrFRPXY,9229
|
25
|
+
fabricatio/models/extra/article_main.py,sha256=yhgZvHWAgL-BJ-eolaXTqBzyWq340GfJucoTY_2CPzs,11342
|
26
|
+
fabricatio/models/extra/article_outline.py,sha256=83hFbCaUDuXn9K_0qcCXQOQ1NBmK-7305ChfKvhNXns,7404
|
27
|
+
fabricatio/models/extra/article_proposal.py,sha256=p0NPzqg9x6t65DZqdF52Z1P0JwP6kwo2_eP-NsXgifU,1720
|
28
|
+
fabricatio/models/generic.py,sha256=GVjcDnzwjKElCZoEVciS7X8SSPjqEp_6M2fLiyAkwNo,17644
|
24
29
|
fabricatio/models/kwargs_types.py,sha256=chJ-rHaeBVRUPuORHuGR3DdNxxTUrotz0eflPEh4l4w,5474
|
25
30
|
fabricatio/models/role.py,sha256=mmQbJ6GKr2Gx3wtjEz8d-vYoXs09ffcEkT_eCXaDd3E,2782
|
26
31
|
fabricatio/models/task.py,sha256=8NaR7ojQWyM740EDTqt9stwHKdrD6axCRpLKo0QzS-I,10492
|
27
32
|
fabricatio/models/tool.py,sha256=kD0eB7OxO9geZOxO6JIKvCBeG-KOpRAkfRZqK_WGfW4,7105
|
28
33
|
fabricatio/models/usages.py,sha256=BSqTENSva8Flga3bPBfwuc1nHo5Z_29oYzar99NbjLM,31566
|
29
|
-
fabricatio/models/utils.py,sha256=
|
34
|
+
fabricatio/models/utils.py,sha256=yjxPZ6N7QGpGwkI_Vb28Ud3EhkdlB-tyfGRHAZMcGxs,5872
|
30
35
|
fabricatio/parser.py,sha256=9Jzw-yV6uKbFvf6sPna-XHdziVGVBZWvPctgX_6ODL8,6251
|
31
36
|
fabricatio/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
32
37
|
fabricatio/toolboxes/arithmetic.py,sha256=WLqhY-Pikv11Y_0SGajwZx3WhsLNpHKf9drzAqOf_nY,1369
|
@@ -37,6 +42,6 @@ fabricatio/workflows/rag.py,sha256=-YYp2tlE9Vtfgpg6ROpu6QVO8j8yVSPa6yDzlN3qVxs,5
|
|
37
42
|
fabricatio/_rust.pyi,sha256=dGTGV7viu3YAGl1cRKIWrdHPc1hlwk3_hbaDaswxdVo,3831
|
38
43
|
fabricatio/_rust_instances.py,sha256=2GwF8aVfYNemRI2feBzH1CZfBGno-XJJE5imJokGEYw,314
|
39
44
|
fabricatio/__init__.py,sha256=SzBYsRhZeL77jLtfJEjmoHOSwHwUGyvMATX6xfndLDM,1135
|
40
|
-
fabricatio/_rust.cp312-win_amd64.pyd,sha256=
|
41
|
-
fabricatio-0.2.7.
|
42
|
-
fabricatio-0.2.7.
|
45
|
+
fabricatio/_rust.cp312-win_amd64.pyd,sha256=opsv_4PpUw06LsJqoKuuTr8aQ3NdAMxB1Ep2RrQqaLc,1835520
|
46
|
+
fabricatio-0.2.7.dev4.data/scripts/tdown.exe,sha256=eEr8wBSNDWdntRBBly7YQr1DnA0ru8NAgAmfMPw7SdU,3402240
|
47
|
+
fabricatio-0.2.7.dev4.dist-info/RECORD,,
|