fabricatio 0.9.5.dev3__cp312-cp312-manylinux_2_34_aarch64.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 ADDED
@@ -0,0 +1,22 @@
1
+ """Fabricatio is a Python library for building llm app using event-based agent structure."""
2
+
3
+ from fabricatio_core import fs, parser, utils
4
+ from fabricatio_core.journal import logger
5
+ from fabricatio_core.models.action import Action, WorkFlow
6
+ from fabricatio_core.models.role import Role
7
+ from fabricatio_core.models.task import Task
8
+ from fabricatio_core.rust import CONFIG, TEMPLATE_MANAGER, Event
9
+
10
+ __all__ = [
11
+ "CONFIG",
12
+ "TEMPLATE_MANAGER",
13
+ "Action",
14
+ "Event",
15
+ "Role",
16
+ "Task",
17
+ "WorkFlow",
18
+ "fs",
19
+ "logger",
20
+ "parser",
21
+ "utils",
22
+ ]
@@ -0,0 +1,74 @@
1
+ """This is the initialization file for the 'fabricatio.actions' package.
2
+
3
+ It imports various action classes from different modules based on the availability of certain packages.
4
+ The imported classes are then added to the '__all__' list, making them accessible when the package is imported.
5
+ """
6
+
7
+ from importlib.util import find_spec
8
+
9
+ __all__ = []
10
+
11
+ if find_spec("fabricatio_typst"):
12
+ from fabricatio_typst.actions.article import (
13
+ ExtractArticleEssence,
14
+ ExtractOutlineFromRaw,
15
+ FixArticleEssence,
16
+ GenerateArticle,
17
+ GenerateArticleProposal,
18
+ GenerateInitialOutline,
19
+ WriteChapterSummary,
20
+ WriteResearchContentSummary,
21
+ )
22
+
23
+ __all__ += [
24
+ "ExtractArticleEssence",
25
+ "ExtractOutlineFromRaw",
26
+ "FixArticleEssence",
27
+ "GenerateArticle",
28
+ "GenerateArticleProposal",
29
+ "GenerateInitialOutline",
30
+ "WriteChapterSummary",
31
+ "WriteResearchContentSummary",
32
+ ]
33
+
34
+ if find_spec("fabricatio_rag"):
35
+ from fabricatio_typst.actions.article_rag import (
36
+ ArticleConsultRAG,
37
+ ChunkArticle,
38
+ TweakArticleRAG,
39
+ WriteArticleContentRAG,
40
+ )
41
+
42
+ __all__ += ["ArticleConsultRAG", "ChunkArticle", "TweakArticleRAG", "WriteArticleContentRAG"]
43
+ if find_spec("fabricatio_rag"):
44
+ from fabricatio_rag.actions.rag import InjectToDB, RAGTalk
45
+
46
+ __all__ += ["InjectToDB", "RAGTalk"]
47
+
48
+ if find_spec("fabricatio_actions"):
49
+ from fabricatio_actions.actions.fs import ReadText
50
+ from fabricatio_actions.actions.output import (
51
+ DumpFinalizedOutput,
52
+ Forward,
53
+ GatherAsList,
54
+ PersistentAll,
55
+ RenderedDump,
56
+ RetrieveFromLatest,
57
+ RetrieveFromPersistent,
58
+ )
59
+
60
+ __all__ += [
61
+ "DumpFinalizedOutput",
62
+ "Forward",
63
+ "GatherAsList",
64
+ "PersistentAll",
65
+ "ReadText",
66
+ "RenderedDump",
67
+ "RetrieveFromLatest",
68
+ "RetrieveFromPersistent",
69
+ ]
70
+
71
+ if find_spec("fabricatio_yue"):
72
+ from fabricatio_yue.actions.compose import Compose
73
+
74
+ __all__ += ["Compose"]
@@ -0,0 +1,78 @@
1
+ """A module containing all the capabilities of the Fabricatio framework."""
2
+
3
+ from importlib.util import find_spec
4
+
5
+ from fabricatio_core.capabilities.usages import UseEmbedding, UseLLM
6
+
7
+ __all__ = ["UseEmbedding", "UseLLM"]
8
+
9
+ if find_spec("fabricatio_tool"):
10
+ from fabricatio_tool.capabilities.handle import Handle
11
+ from fabricatio_tool.capabilities.handle_task import HandleTask
12
+ from fabricatio_tool.capabilities.use_tool import UseTool
13
+
14
+ __all__ += ["Handle", "HandleTask", "UseTool"]
15
+
16
+
17
+ if find_spec("fabricatio_capabilities"):
18
+ from fabricatio_capabilities.capabilities.extract import Extract
19
+ from fabricatio_capabilities.capabilities.rating import Rating
20
+ from fabricatio_capabilities.capabilities.task import DispatchTask, ProposeTask
21
+ from fabricatio_core.capabilities.propose import Propose
22
+
23
+ __all__ += ["DispatchTask", "Extract", "HandleTask", "Propose", "ProposeTask", "Rating"]
24
+
25
+ if find_spec("fabricatio_rag"):
26
+ from fabricatio_rag.capabilities.rag import RAG
27
+
28
+ __all__ += ["RAG"]
29
+ if find_spec("fabricatio_write"):
30
+ from fabricatio_typst.capabilities.citation_rag import CitationRAG
31
+
32
+ __all__ += ["CitationRAG"]
33
+
34
+ if find_spec("fabricatio_rule"):
35
+ from fabricatio_rule.capabilities.censor import Censor
36
+ from fabricatio_rule.capabilities.check import Check
37
+
38
+ __all__ += ["Censor", "Check"]
39
+
40
+ if find_spec("fabricatio_improve"):
41
+ from fabricatio_improve.capabilities.correct import Correct
42
+ from fabricatio_improve.capabilities.review import Review
43
+
44
+ __all__ += ["Correct", "Review"]
45
+
46
+ if find_spec("fabricatio_judge"):
47
+ from fabricatio_judge.capabilities.advanced_judge import AdvancedJudge
48
+
49
+ __all__ += ["AdvancedJudge"]
50
+
51
+ if find_spec("fabricatio_digest"):
52
+ from fabricatio_digest.capabilities.digest import Digest
53
+
54
+ __all__ += ["Digest"]
55
+
56
+ if find_spec("fabricatio_anki"):
57
+ from fabricatio_anki.capabilities.generate_deck import GenerateDeck
58
+
59
+ __all__ += ["GenerateDeck"]
60
+
61
+ if find_spec("fabricatio_tagging"):
62
+ from fabricatio_tagging.capabilities.tagging import Tagging
63
+
64
+ __all__ += ["Tagging"]
65
+ if find_spec("fabricatio_question"):
66
+ from fabricatio_question.capabilities.questioning import Questioning
67
+
68
+ __all__ += ["Questioning"]
69
+
70
+ if find_spec("fabricatio_yue"):
71
+ from fabricatio_yue.capabilities.genre import SelectGenre
72
+ from fabricatio_yue.capabilities.lyricize import Lyricize
73
+
74
+ __all__ += ["Lyricize", "SelectGenre"]
75
+ if find_spec("fabricatio_memory"):
76
+ from fabricatio_memory.capabilities.memory import Remember
77
+
78
+ __all__ += ["Remember"]
@@ -0,0 +1,56 @@
1
+ """A module for the usage of the fabricatio package."""
2
+
3
+ from importlib.util import find_spec
4
+
5
+ __all__ = []
6
+
7
+ if find_spec("fabricatio_typst"):
8
+ from fabricatio_typst.models.article_essence import ArticleEssence
9
+ from fabricatio_typst.models.article_main import Article
10
+ from fabricatio_typst.models.article_outline import ArticleOutline
11
+ from fabricatio_typst.models.article_proposal import ArticleProposal
12
+
13
+ __all__ += [
14
+ "Article",
15
+ "ArticleEssence",
16
+ "ArticleOutline",
17
+ "ArticleProposal",
18
+ ]
19
+
20
+ if find_spec("fabricatio_typst"):
21
+ from fabricatio_typst.models.aricle_rag import ArticleChunk
22
+
23
+ __all__ += ["ArticleChunk"]
24
+
25
+ if find_spec("fabricatio_judge"):
26
+ from fabricatio_judge.models.judgement import JudgeMent
27
+
28
+ __all__ += ["JudgeMent"]
29
+
30
+ if find_spec("fabricatio_digest"):
31
+ from fabricatio_digest.models.tasklist import TaskList
32
+
33
+ __all__ += ["TaskList"]
34
+
35
+
36
+ if find_spec("fabricatio_anki"):
37
+ from fabricatio_anki.models.deck import Deck, Model
38
+ from fabricatio_anki.models.template import Template
39
+
40
+ __all__ += ["Deck", "Model", "Template"]
41
+
42
+ if find_spec("fabricatio_question"):
43
+ from fabricatio_question.models.questions import SelectionQuestion
44
+
45
+ __all__ += ["SelectionQuestion"]
46
+
47
+
48
+ if find_spec("fabricatio_yue"):
49
+ from fabricatio_yue.models.segment import Segment, Song
50
+
51
+ __all__ += ["Segment", "Song"]
52
+
53
+ if find_spec("fabricatio_memory"):
54
+ from fabricatio_memory.models.note import Note
55
+
56
+ __all__ += ["Note"]
fabricatio/py.typed ADDED
File without changes
@@ -0,0 +1,10 @@
1
+ """A module containing some builtin workflows."""
2
+
3
+ __all__ = []
4
+
5
+ from importlib.util import find_spec
6
+
7
+ if find_spec("fabricatio_typst") and find_spec("fabricatio_actions"):
8
+ from fabricatio_typst.workflows.articles import WriteOutlineCorrectedWorkFlow
9
+
10
+ __all__ += ["WriteOutlineCorrectedWorkFlow"]
Binary file
@@ -0,0 +1,223 @@
1
+ Metadata-Version: 2.4
2
+ Name: fabricatio
3
+ Version: 0.9.5.dev3
4
+ Classifier: License :: OSI Approved :: MIT License
5
+ Classifier: Programming Language :: Rust
6
+ Classifier: Programming Language :: Python :: 3.12
7
+ Classifier: Programming Language :: Python :: 3.13
8
+ Classifier: Programming Language :: Python :: Implementation :: CPython
9
+ Classifier: Framework :: AsyncIO
10
+ Classifier: Framework :: Pydantic :: 2
11
+ Classifier: Typing :: Typed
12
+ Requires-Dist: fabricatio-core
13
+ Requires-Dist: fabricatio[rag,cli,typst,rule,judge,capabilities,actions,improve,digest,memory,anki,question,tagging,improve,rag,yue,tool] ; extra == 'full'
14
+ Requires-Dist: fabricatio-anki ; extra == 'anki'
15
+ Requires-Dist: fabricatio-memory ; extra == 'memory'
16
+ Requires-Dist: fabricatio-digest ; extra == 'digest'
17
+ Requires-Dist: fabricatio-rag ; extra == 'rag'
18
+ Requires-Dist: fabricatio-judge ; extra == 'judge'
19
+ Requires-Dist: fabricatio-rule ; extra == 'rule'
20
+ Requires-Dist: typer-slim[standard]>=0.15.2 ; extra == 'cli'
21
+ Requires-Dist: fabricatio-typst ; extra == 'typst'
22
+ Requires-Dist: fabricatio-improve ; extra == 'improve'
23
+ Requires-Dist: fabricatio-capabilities ; extra == 'capabilities'
24
+ Requires-Dist: fabricatio-actions ; extra == 'actions'
25
+ Requires-Dist: fabricatio-question ; extra == 'question'
26
+ Requires-Dist: fabricatio-tagging ; extra == 'tagging'
27
+ Requires-Dist: fabricatio-yue ; extra == 'yue'
28
+ Requires-Dist: fabricatio-tool ; extra == 'tool'
29
+ Provides-Extra: full
30
+ Provides-Extra: anki
31
+ Provides-Extra: memory
32
+ Provides-Extra: digest
33
+ Provides-Extra: rag
34
+ Provides-Extra: judge
35
+ Provides-Extra: rule
36
+ Provides-Extra: cli
37
+ Provides-Extra: typst
38
+ Provides-Extra: improve
39
+ Provides-Extra: capabilities
40
+ Provides-Extra: actions
41
+ Provides-Extra: question
42
+ Provides-Extra: tagging
43
+ Provides-Extra: yue
44
+ Provides-Extra: tool
45
+ License-File: LICENSE
46
+ Summary: A LLM multi-agent framework.
47
+ Keywords: ai,agents,multi-agent,llm,pyo3
48
+ Author-email: Whth <zettainspector@foxmail.com>
49
+ Requires-Python: >=3.12, <3.14
50
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
51
+ Project-URL: Homepage, https://github.com/Whth/fabricatio
52
+ Project-URL: Repository, https://github.com/Whth/fabricatio
53
+ Project-URL: Issues, https://github.com/Whth/fabricatio/issues
54
+
55
+ <p align="center">
56
+ <picture>
57
+ <img src="./assets/band.png" width="80%" alt="Fabricatio Logo" loading="lazy">
58
+ </picture>
59
+ </p>
60
+
61
+
62
+
63
+
64
+ [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
65
+ [![Python Versions](https://img.shields.io/pypi/pyversions/fabricatio)](https://pypi.org/project/fabricatio/)
66
+ [![PyPI Version](https://img.shields.io/pypi/v/fabricatio)](https://pypi.org/project/fabricatio/)
67
+ [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/Whth/fabricatio)
68
+ [![PyPI Downloads](https://static.pepy.tech/badge/fabricatio/week)](https://pepy.tech/projects/fabricatio)
69
+ [![PyPI Downloads](https://static.pepy.tech/badge/fabricatio)](https://pepy.tech/projects/fabricatio)
70
+ [![Bindings: PyO3](https://img.shields.io/badge/bindings-pyo3-green)](https://github.com/PyO3/pyo3)
71
+ [![Powered by LiteLLM](https://img.shields.io/badge/Powered%20by-LiteLLM-blue)](https://github.com/BerriAI/litellm)
72
+ [![Build Tool: uv + maturin](https://img.shields.io/badge/built%20with-uv%20%2B%20maturin-orange)](https://github.com/astral-sh/uv)
73
+ [![Documentation Status](https://readthedocs.org/projects/fabricatio/badge/?version=latest)](https://fabricatio.readthedocs.io/en/latest/?badge=fabricatio)
74
+ [![Build Package](https://github.com/Whth/fabricatio/actions/workflows/build-package.yaml/badge.svg)](https://github.com/Whth/fabricatio/actions/workflows/build-package.yaml)
75
+ [![Ruff Lint](https://github.com/Whth/fabricatio/actions/workflows/ruff.yaml/badge.svg)](https://github.com/Whth/fabricatio/actions/workflows/ruff.yaml)
76
+ [![Tests](https://github.com/Whth/fabricatio/actions/workflows/tests.yaml/badge.svg)](https://github.com/Whth/fabricatio/actions/workflows/tests.yaml)
77
+ [![Coverage Status](https://coveralls.io/repos/github/Whth/fabricatio/badge.svg?branch=master)](https://coveralls.io/github/Whth/fabricatio?branch=master)
78
+ ![GitHub Issues](https://img.shields.io/github/issues/Whth/fabricatio)
79
+ ![GitHub Pull Requests](https://img.shields.io/github/issues-pr/Whth/fabricatio)
80
+ ![GitHub Stars](https://img.shields.io/github/stars/Whth/fabricatio)
81
+ ---
82
+
83
+ ## Overview
84
+
85
+ Fabricatio is a streamlined Python library for building LLM applications using an event-based agent structure. It
86
+ leverages Rust for performance-critical tasks, Handlebars for templating, and PyO3 for Python bindings.
87
+
88
+ ## Features
89
+
90
+ - **Event-Driven Architecture**: Robust task management through an EventEmitter pattern.
91
+ - **LLM Integration & Templating**: Seamlessly interact with large language models and dynamic content generation.
92
+ - **Async & Extensible**: Fully asynchronous execution with easy extension via custom actions and workflows.
93
+
94
+ ## Installation
95
+
96
+ ### Using UV (Recommended)
97
+
98
+ ```bash
99
+ # Install uv if not already installed
100
+ pip install uv
101
+
102
+ # Clone the repository
103
+ git clone https://github.com/Whth/fabricatio.git
104
+ cd fabricatio
105
+
106
+ # Install the package in development mode with uvx
107
+ uvx --with-editable . maturin develop --uv -r
108
+
109
+ # Or, with make
110
+ make dev
111
+ ```
112
+
113
+ ### Building Distribution
114
+
115
+ ```bash
116
+ # Build distribution packages
117
+ make bdist
118
+ ```
119
+
120
+ ## Usage
121
+
122
+ ### Basic Example
123
+
124
+ ```python
125
+ """Example of a simple hello world program using fabricatio."""
126
+
127
+ from typing import Any
128
+
129
+ from fabricatio import Action, Event, Role, Task, WorkFlow, logger
130
+
131
+
132
+ class Hello(Action):
133
+ """Action that says hello."""
134
+
135
+ output_key: str = "task_output"
136
+
137
+ async def _execute(self, **_) -> Any:
138
+ ret = "Hello fabricatio!"
139
+ logger.info("executing talk action")
140
+ return ret
141
+
142
+ """Main function."""
143
+
144
+
145
+ (Role()
146
+ .register_workflow(Event.quick_instantiate("talk"), WorkFlow(name="talk", steps=(Hello,)))
147
+ .dispatch())
148
+
149
+ assert Task(name="say hello").delegate_blocking("talk") == "Hello fabricatio!"
150
+
151
+ ```
152
+
153
+ ### Examples
154
+
155
+ For various usage scenarios, refer to the following examples:
156
+
157
+ - Simple Chat
158
+ - Retrieval-Augmented Generation (RAG)
159
+ - Article Extraction
160
+ - Propose Task
161
+ - Code Review
162
+ - Write Outline
163
+
164
+ _(For full example details, please check our detailed documentation, see [Examples](./examples))_
165
+
166
+ ## Configuration
167
+
168
+ The configuration for Fabricatio is managed via environment variables or TOML files. For example:
169
+
170
+ ```toml
171
+ [llm]
172
+ api_endpoint = "https://api.openai.com"
173
+ api_key = "your_openai_api_key"
174
+ timeout = 300
175
+ max_retries = 3
176
+ model = "gpt-3.5-turbo"
177
+ temperature = 1.0
178
+ stop_sign = ["\n\n\n", "User:"]
179
+ top_p = 0.35
180
+ generation_count = 1
181
+ stream = false
182
+ max_tokens = 8192
183
+ ```
184
+
185
+ ## Development Setup
186
+
187
+ 1. **Clone the Repository**:
188
+ ```bash
189
+ git clone https://github.com/Whth/fabricatio.git
190
+ cd fabricatio
191
+ ```
192
+ 2. **Install Dependencies**:
193
+ ```bash
194
+ make dev
195
+ ```
196
+ 3. **Run Tests**:
197
+ ```bash
198
+ make test
199
+ ```
200
+
201
+ ## Contributing
202
+
203
+ Contributions are welcome! Follow these steps:
204
+
205
+ 1. Fork the repository.
206
+ 2. Create your feature branch (`git checkout -b feature/new-feature`).
207
+ 3. Commit your changes (`git commit -am 'Add new feature'`).
208
+ 4. Push to the branch (`git push origin feature/new-feature`).
209
+ 5. Create a new Pull Request.
210
+
211
+ ## License
212
+
213
+ Fabricatio is licensed under the MIT License. See [LICENSE](LICENSE) for details.
214
+
215
+ ## Acknowledgments
216
+
217
+ Special thanks to the contributors and maintainers of:
218
+
219
+ - [PyO3](https://github.com/PyO3/pyo3)
220
+ - [Maturin](https://github.com/PyO3/maturin)
221
+ - [Handlebars.rs](https://github.com/sunng87/handlebars-rust)
222
+ - [LiteLLM](https://github.com/BerriAI/litellm)
223
+
@@ -0,0 +1,12 @@
1
+ fabricatio-0.9.5.dev3.data/scripts/tdown,sha256=QJMe609e037L2vWuXXTMNmwBEqv4kQ8ysGvp6_CPh4w,5120424
2
+ fabricatio-0.9.5.dev3.dist-info/METADATA,sha256=N5RjbQJk32YfGflNdc71s10GKidipP84h8UPRqhqtoE,7517
3
+ fabricatio-0.9.5.dev3.dist-info/WHEEL,sha256=xRzGYIeYILqfqV388yrHfSOoS4CnDHmnQuDLYAjrqlw,109
4
+ fabricatio-0.9.5.dev3.dist-info/licenses/LICENSE,sha256=yDZaTLnOi03bi3Dk6f5IjhLUc5old2yOsihHWU0z-i0,1067
5
+ fabricatio/__init__.py,sha256=4a_7gabZhl9dzonBxcF-8peCGTLNxYJSDfInf1VhRsY,568
6
+ fabricatio/actions/__init__.py,sha256=4xR1wiPq2HPnVABXy6R3wOxcg9LZKD7g-h9IdTcNKvY,2106
7
+ fabricatio/capabilities/__init__.py,sha256=_OA0cO2z1B2U_4Y7vSETf8_o1WJH5W-zy4yzUpGonMk,2562
8
+ fabricatio/models/__init__.py,sha256=-T9QeEjg-Qyz-BofvLdpCDvd0ut9k6H0r25sIHMqDCI,1517
9
+ fabricatio/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
+ fabricatio/rust.cpython-312-aarch64-linux-gnu.so,sha256=SyMMdWSIxA0lGKQdQVh4ar_byaXZORWHzpXWd8ibqGA,463632
11
+ fabricatio/workflows/__init__.py,sha256=sr-0tgpNPdN5t2pDQa-gp-KUE7K0QDtjP9QGvWYLZ9A,305
12
+ fabricatio-0.9.5.dev3.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: maturin (1.8.7)
3
+ Root-Is-Purelib: false
4
+ Tag: cp312-cp312-manylinux_2_34_aarch64
@@ -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.