fabricatio 0.2.0.dev19__tar.gz → 0.2.1__tar.gz

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.
Files changed (92) hide show
  1. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/.github/workflows/build-package.yaml +1 -1
  2. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/.github/workflows/tests.yaml +12 -5
  3. fabricatio-0.2.1/PKG-INFO +420 -0
  4. fabricatio-0.2.1/README.md +379 -0
  5. fabricatio-0.2.1/examples/llm_usages/llm_usage.py +60 -0
  6. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/examples/propose_task/propose.py +1 -1
  7. fabricatio-0.2.1/examples/task_handle/handle_task.py +88 -0
  8. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/pyproject.toml +4 -1
  9. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/python/fabricatio/_rust.pyi +3 -3
  10. fabricatio-0.2.1/python/fabricatio/actions/communication.py +15 -0
  11. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/python/fabricatio/actions/transmission.py +0 -11
  12. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/python/fabricatio/config.py +18 -3
  13. fabricatio-0.2.1/python/fabricatio/decorators.py +179 -0
  14. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/python/fabricatio/fs/curd.py +21 -7
  15. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/python/fabricatio/journal.py +7 -2
  16. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/python/fabricatio/models/action.py +9 -3
  17. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/python/fabricatio/models/advanced.py +23 -14
  18. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/python/fabricatio/models/generic.py +23 -2
  19. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/python/fabricatio/models/role.py +1 -2
  20. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/python/fabricatio/models/task.py +16 -10
  21. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/python/fabricatio/models/tool.py +25 -9
  22. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/python/fabricatio/models/usages.py +72 -17
  23. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/python/fabricatio/parser.py +8 -4
  24. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/python/fabricatio/toolboxes/fs.py +3 -2
  25. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/templates/built-in/dependencies.hbs +1 -0
  26. fabricatio-0.2.1/templates/built-in/draft_tool_usage_code.hbs +66 -0
  27. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/templates/built-in/make_choice.hbs +1 -0
  28. fabricatio-0.2.1/templates/built-in/task_briefing.hbs +10 -0
  29. fabricatio-0.2.1/templates.tar.gz +0 -0
  30. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/tests/test_config.py +22 -2
  31. fabricatio-0.2.1/tests/test_models/test_action.py +116 -0
  32. fabricatio-0.2.1/tests/test_models/test_role.py +93 -0
  33. fabricatio-0.2.1/tests/test_models/test_task.py +101 -0
  34. fabricatio-0.2.1/tests/test_models/test_tool.py +64 -0
  35. fabricatio-0.2.1/tests/test_models/test_usages.py +199 -0
  36. fabricatio-0.2.1/uv.lock +1868 -0
  37. fabricatio-0.2.0.dev19/PKG-INFO +0 -233
  38. fabricatio-0.2.0.dev19/README.md +0 -193
  39. fabricatio-0.2.0.dev19/examples/llm_usages/llm_usage.py +0 -41
  40. fabricatio-0.2.0.dev19/python/fabricatio/actions/communication.py +0 -15
  41. fabricatio-0.2.0.dev19/python/fabricatio/decorators.py +0 -72
  42. fabricatio-0.2.0.dev19/templates/built-in/draft_tool_usage_code.hbs +0 -52
  43. fabricatio-0.2.0.dev19/templates.tar.gz +0 -0
  44. fabricatio-0.2.0.dev19/tests/test_models/test_action.py +0 -53
  45. fabricatio-0.2.0.dev19/tests/test_models/test_role.py +0 -34
  46. fabricatio-0.2.0.dev19/tests/test_models/test_task.py +0 -32
  47. fabricatio-0.2.0.dev19/tests/test_models/test_tool.py +0 -34
  48. fabricatio-0.2.0.dev19/tests/test_models/test_usages.py +0 -20
  49. fabricatio-0.2.0.dev19/uv.lock +0 -1855
  50. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/.github/workflows/ruff.yaml +0 -0
  51. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/.gitignore +0 -0
  52. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/.python-version +0 -0
  53. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/Cargo.lock +0 -0
  54. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/Cargo.toml +0 -0
  55. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/LICENSE +0 -0
  56. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/Makefile +0 -0
  57. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/examples/minor/hello_fabricatio.py +0 -0
  58. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/examples/simple_chat/chat.py +0 -0
  59. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/python/fabricatio/__init__.py +0 -0
  60. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/python/fabricatio/_rust_instances.py +0 -0
  61. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/python/fabricatio/actions/__init__.py +0 -0
  62. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/python/fabricatio/core.py +0 -0
  63. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/python/fabricatio/fs/__init__.py +0 -0
  64. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/python/fabricatio/fs/readers.py +0 -0
  65. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/python/fabricatio/models/events.py +0 -0
  66. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/python/fabricatio/models/kwargs_types.py +0 -0
  67. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/python/fabricatio/models/utils.py +0 -0
  68. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/python/fabricatio/py.typed +0 -0
  69. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/python/fabricatio/toolboxes/__init__.py +0 -0
  70. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/python/fabricatio/toolboxes/arithmetic.py +0 -0
  71. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/python/fabricatio/toolboxes/task.py +0 -0
  72. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/src/hash.rs +0 -0
  73. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/src/lib.rs +0 -0
  74. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/src/templates.rs +0 -0
  75. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/templates/built-in/binary-exploitation-ctf-solver.hbs +0 -0
  76. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/templates/built-in/claude-xml.hbs +0 -0
  77. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/templates/built-in/clean-up-code.hbs +0 -0
  78. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/templates/built-in/cryptography-ctf-solver.hbs +0 -0
  79. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/templates/built-in/document-the-code.hbs +0 -0
  80. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/templates/built-in/find-security-vulnerabilities.hbs +0 -0
  81. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/templates/built-in/fix-bugs.hbs +0 -0
  82. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/templates/built-in/improve-performance.hbs +0 -0
  83. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/templates/built-in/make_judgment.hbs +0 -0
  84. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/templates/built-in/propose_task.hbs +0 -0
  85. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/templates/built-in/refactor.hbs +0 -0
  86. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/templates/built-in/reverse-engineering-ctf-solver.hbs +0 -0
  87. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/templates/built-in/web-ctf-solver.hbs +0 -0
  88. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/templates/built-in/write-git-commit.hbs +0 -0
  89. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/templates/built-in/write-github-pull-request.hbs +0 -0
  90. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/templates/built-in/write-github-readme.hbs +0 -0
  91. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/tests/test_models/test_advanced.py +0 -0
  92. {fabricatio-0.2.0.dev19 → fabricatio-0.2.1}/tests/test_models/test_generic.py +0 -0
@@ -49,7 +49,7 @@ jobs:
49
49
  rustup default nightly
50
50
  - name: Install deps
51
51
  run: |
52
- uv sync --no-install-project --all-extras
52
+ uv sync --no-install-project --all-extras --index https://pypi.org/simple
53
53
  - name: Build
54
54
  run: |
55
55
  make
@@ -10,7 +10,10 @@ on:
10
10
 
11
11
  jobs:
12
12
  test:
13
- runs-on: windows-latest
13
+ runs-on: ${{ matrix.os }}
14
+ strategy:
15
+ matrix:
16
+ os: [ windows-latest, ubuntu-latest ]
14
17
  steps:
15
18
  - name: Checkout repository
16
19
  uses: actions/checkout@v4
@@ -20,13 +23,17 @@ jobs:
20
23
  with:
21
24
  version: "latest"
22
25
 
23
- - name: Install deps
26
+ - name: Install nightly rust
24
27
  run: |
25
- uv sync
28
+ rustup default nightly
26
29
 
27
- - name: Build
30
+ - name: Install deps
31
+ run: |
32
+ uv sync --no-install-project --all-extras --index https://pypi.org/simple
33
+ make dev
34
+ - name: Test
28
35
  run: |
29
- pytest tests
36
+ uvx --with-editable . pytest tests
30
37
 
31
38
 
32
39
 
@@ -0,0 +1,420 @@
1
+ Metadata-Version: 2.4
2
+ Name: fabricatio
3
+ Version: 0.2.1
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: code2prompt
15
+ Requires-Dist: gitpython>=3.1.44
16
+ Requires-Dist: litellm>=1.60.0
17
+ Requires-Dist: loguru>=0.7.3
18
+ Requires-Dist: magika>=0.5.1
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: faiss-cpu>=1.10.0 ; extra == 'rag'
27
+ Requires-Dist: pymilvus>=2.5.4 ; extra == 'rag'
28
+ Requires-Dist: fabricatio[rag] ; extra == 'full'
29
+ Provides-Extra: rag
30
+ Provides-Extra: full
31
+ License-File: LICENSE
32
+ Summary: A LLM multi-agent framework.
33
+ Keywords: ai,agents,multi-agent,llm,pyo3
34
+ Author-email: Whth <zettainspector@foxmail.com>
35
+ Requires-Python: >=3.12
36
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
37
+ Project-URL: Homepage, https://github.com/Whth/fabricatio
38
+ Project-URL: Repository, https://github.com/Whth/fabricatio
39
+ Project-URL: Issues, https://github.com/Whth/fabricatio/issues
40
+
41
+
42
+ # Fabricatio
43
+
44
+ ![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)
45
+ ![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)
46
+ ![Build Status](https://img.shields.io/badge/build-passing-brightgreen)
47
+
48
+ Fabricatio is a Python library designed for building LLM (Large Language Model) applications using an event-based agent structure. It integrates Rust for performance-critical tasks, utilizes Handlebars for templating, and employs PyO3 for Python bindings.
49
+
50
+ ## Features
51
+
52
+ - **Event-Based Architecture**: Utilizes an EventEmitter pattern for robust task management.
53
+ - **LLM Integration**: Supports interactions with large language models for intelligent task processing.
54
+ - **Templating Engine**: Uses Handlebars for dynamic content generation.
55
+ - **Toolboxes**: Provides predefined toolboxes for common operations like file manipulation and arithmetic.
56
+ - **Async Support**: Fully asynchronous for efficient execution.
57
+ - **Extensible**: Easy to extend with custom actions, workflows, and tools.
58
+
59
+ ## Installation
60
+
61
+ ### Using UV (Recommended)
62
+
63
+ To install Fabricatio using `uv` (a package manager for Python):
64
+
65
+ ```bash
66
+ # Install uv if not already installed
67
+ pip install uv
68
+
69
+ # Clone the repository
70
+ git clone https://github.com/Whth/fabricatio.git
71
+ cd fabricatio
72
+
73
+ # Install the package in development mode with uv
74
+ uv --with-editable . maturin develop --uv -r
75
+ ```
76
+
77
+ ### Building Distribution
78
+
79
+ For production builds:
80
+
81
+ ```bash
82
+ # Build distribution packages
83
+ make bdist
84
+ ```
85
+
86
+ This will generate distribution files in the `dist` directory.
87
+
88
+ ## Usage
89
+
90
+ ### Basic Example
91
+
92
+ Below are some basic examples demonstrating how to use Fabricatio for different purposes.
93
+
94
+ #### Simple Hello World Program
95
+
96
+ ```python
97
+ import asyncio
98
+ from fabricatio import Action, Role, Task, logger
99
+
100
+
101
+ class Hello(Action):
102
+ """Action that says hello."""
103
+
104
+ name: str = "hello"
105
+ output_key: str = "task_output"
106
+
107
+ async def _execute(self, task_input: Task[str], **_) -> Any:
108
+ ret = "Hello fabricatio!"
109
+ logger.info("executing talk action")
110
+ return ret
111
+
112
+
113
+ async def main() -> None:
114
+ """Main function."""
115
+ role = Role(
116
+ name="talker",
117
+ description="talker role",
118
+ registry={Task.pending_label: WorkFlow(name="talk", steps=(Hello,))}
119
+ )
120
+
121
+ task = Task(name="say hello", goal="say hello", description="say hello to the world")
122
+ result = await task.delegate()
123
+ logger.success(f"Result: {result}")
124
+
125
+
126
+ if __name__ == "__main__":
127
+ asyncio.run(main())
128
+ ```
129
+
130
+ #### Writing and Dumping Code
131
+
132
+ ```python
133
+ import asyncio
134
+ from fabricatio import Action, Event, PythonCapture, Role, Task, ToolBox, WorkFlow, fs_toolbox, logger
135
+
136
+
137
+ class WriteCode(Action):
138
+ """Action that writes code based on a prompt."""
139
+
140
+ name: str = "write code"
141
+ output_key: str = "source_code"
142
+
143
+ async def _execute(self, task_input: Task[str], **_) -> str:
144
+ return await self.aask_validate(
145
+ task_input.briefing,
146
+ validator=PythonCapture.capture,
147
+ )
148
+
149
+
150
+ class DumpCode(Action):
151
+ """Action that dumps code to the file system."""
152
+
153
+ name: str = "dump code"
154
+ description: str = "Dump code to file system"
155
+ toolboxes: set[ToolBox] = {fs_toolbox}
156
+ output_key: str = "task_output"
157
+
158
+ async def _execute(self, task_input: Task, source_code: str, **_) -> Any:
159
+ path = await self.handle_fin_grind(task_input, {"source_code": source_code})
160
+ return path[0] if path else None
161
+
162
+
163
+ async def main() -> None:
164
+ """Main function."""
165
+ role = Role(
166
+ name="Coder",
167
+ description="A python coder who can write and document code",
168
+ registry={
169
+ Event.instantiate_from("coding.*").push("pending"): WorkFlow(
170
+ name="write code", steps=(WriteCode, DumpCode)
171
+ ),
172
+ },
173
+ )
174
+
175
+ prompt = "write a Python CLI app which prints 'hello world' n times with detailed Google-style docstring. Write the source code to `cli.py`."
176
+
177
+ proposed_task = await role.propose(prompt)
178
+ path = await proposed_task.move_to("coding").delegate()
179
+ logger.success(f"Code Path: {path}")
180
+
181
+
182
+ if __name__ == "__main__":
183
+ asyncio.run(main())
184
+ ```
185
+
186
+ #### Proposing Tasks
187
+
188
+ ```python
189
+ import asyncio
190
+ from typing import Any
191
+
192
+ from fabricatio import Action, Role, Task, WorkFlow, logger
193
+
194
+
195
+ class WriteDocumentation(Action):
196
+ """Action that generates documentation for the code in markdown format."""
197
+
198
+ name: str = "write documentation"
199
+ description: str = "Write detailed documentation for the provided code."
200
+ output_key: str = "task_output"
201
+
202
+ async def _execute(self, task_input: Task[str], **_) -> str:
203
+ return await self.aask(task_input.briefing)
204
+
205
+
206
+ async def main() -> None:
207
+ """Main function."""
208
+ role = Role(
209
+ name="Documenter",
210
+ description="Role responsible for writing documentation.",
211
+ registry={
212
+ "doc.*": WorkFlow(name="write documentation", steps=(WriteDocumentation,))
213
+ }
214
+ )
215
+
216
+ prompt = "write a Rust clap CLI that downloads an HTML page"
217
+ proposed_task = await role.propose(prompt)
218
+ documentation = await proposed_task.move_to("doc").delegate()
219
+ logger.success(f"Documentation:\n{documentation}")
220
+
221
+
222
+ if __name__ == "__main__":
223
+ asyncio.run(main())
224
+ ```
225
+
226
+ #### Complex Workflow Handling
227
+
228
+ ```python
229
+ import asyncio
230
+ from fabricatio import Action, Event, Role, Task, WorkFlow, logger
231
+
232
+
233
+ class WriteCode(Action):
234
+ """Action that writes code based on a prompt."""
235
+
236
+ name: str = "write code"
237
+ output_key: str = "source_code"
238
+
239
+ async def _execute(self, task_input: Task[str], **_) -> str:
240
+ return await self.aask_validate(
241
+ task_input.briefing,
242
+ validator=PythonCapture.capture,
243
+ )
244
+
245
+
246
+ class WriteDocumentation(Action):
247
+ """Action that generates documentation for the code in markdown format."""
248
+
249
+ name: str = "write documentation"
250
+ description: str = "Write detailed documentation for the provided code."
251
+ output_key: str = "task_output"
252
+
253
+ async def _execute(self, task_input: Task[str], **_) -> str:
254
+ return await self.aask(task_input.briefing)
255
+
256
+
257
+ async def main() -> None:
258
+ """Main function."""
259
+ role = Role(
260
+ name="Developer",
261
+ description="A developer who can write code and documentation.",
262
+ registry={
263
+ Event.instantiate_from("coding.*").push("pending"): WorkFlow(
264
+ name="write code", steps=(WriteCode,)
265
+ ),
266
+ Event.instantiate_from("doc.*").push("pending"): WorkFlow(
267
+ name="write documentation", steps=(WriteDocumentation,)
268
+ ),
269
+ }
270
+ )
271
+
272
+ # Propose a coding task
273
+ code_task_prompt = "write a Python CLI app which adds numbers from a file."
274
+ proposed_task = await role.propose(code_task_prompt)
275
+ code = await proposed_task.move_to("coding").delegate()
276
+ logger.success(f"Code:\n{code}")
277
+
278
+ # Propose a documentation task
279
+ doc_task_prompt = f"{code}\n\nwrite Readme.md file for the above code."
280
+ proposed_doc_task = await role.propose(doc_task_prompt)
281
+ documentation = await proposed_doc_task.move_to("doc").delegate()
282
+ logger.success(f"Documentation:\n{documentation}")
283
+
284
+
285
+ if __name__ == "__main__":
286
+ asyncio.run(main())
287
+ ```
288
+
289
+ ### Advanced Examples
290
+
291
+ #### Template Management and Rendering
292
+
293
+ ```python
294
+ from fabricatio._rust_instances import template_manager
295
+
296
+ template_name = "claude-xml.hbs"
297
+ data = {
298
+ "absolute_code_path": "/path/to/project",
299
+ "source_tree": "source tree content",
300
+ "files": [{"path": "file1.py", "code": "print('Hello')"}],
301
+ }
302
+
303
+ rendered_template = template_manager.render_template(template_name, data)
304
+ print(rendered_template)
305
+ ```
306
+
307
+ #### Handling Security Vulnerabilities
308
+
309
+ ```python
310
+ from fabricatio.models.usages import ToolBoxUsage
311
+ from fabricatio.models.task import Task
312
+
313
+ toolbox_usage = ToolBoxUsage()
314
+
315
+ async def handle_security_vulnerabilities():
316
+ task = Task(
317
+ name="Security Check",
318
+ goal=["Identify security vulnerabilities"],
319
+ description="Perform a thorough security review on the project.",
320
+ dependencies=["./src/main.py"]
321
+ )
322
+
323
+ vulnerabilities = await toolbox_usage.gather_tools_fine_grind(task)
324
+ for vulnerability in vulnerabilities:
325
+ print(f"Found vulnerability: {vulnerability.name}")
326
+ ```
327
+
328
+ #### Managing CTF Challenges
329
+
330
+ ```python
331
+ import asyncio
332
+
333
+ from fabricatio.models.usages import ToolBoxUsage
334
+ from fabricatio.models.task import Task
335
+
336
+ toolbox_usage = ToolBoxUsage()
337
+
338
+ async def solve_ctf_challenge(challenge_name: str, challenge_description: str, files: list[str]):
339
+ task = Task(
340
+ name=challenge_name,
341
+ goal=[f"Solve {challenge_name} challenge"],
342
+ description=challenge_description,
343
+ dependencies=files
344
+ )
345
+
346
+ solution = await toolbox_usage.gather_tools_fine_grind(task)
347
+ print(f"Challenge Solved: {solution}")
348
+
349
+ if __name__ == "__main__":
350
+ asyncio.run(solve_ctf_challenge("Binary Exploitation", "CTF Binary Exploitation Challenge", ["./challenges/binary_exploit"]))
351
+ ```
352
+
353
+ ### Configuration
354
+
355
+ The configuration for Fabricatio is managed via environment variables or TOML files. The default configuration file (`config.toml`) can be overridden by specifying a custom path.
356
+
357
+ Example `config.toml`:
358
+
359
+ ```toml
360
+ [llm]
361
+ api_endpoint = "https://api.openai.com"
362
+ api_key = "your_openai_api_key"
363
+ timeout = 300
364
+ max_retries = 3
365
+ model = "gpt-3.5-turbo"
366
+ temperature = 1.0
367
+ stop_sign = ["\n\n\n", "User:"]
368
+ top_p = 0.35
369
+ generation_count = 1
370
+ stream = false
371
+ max_tokens = 8192
372
+ ```
373
+
374
+ ### Development Setup
375
+
376
+ To set up a development environment for Fabricatio:
377
+
378
+ 1. **Clone the Repository**:
379
+ ```bash
380
+ git clone https://github.com/Whth/fabricatio.git
381
+ cd fabricatio
382
+ ```
383
+
384
+ 2. **Install Dependencies**:
385
+ ```bash
386
+ uv --with-editable . maturin develop --uv -r
387
+ ```
388
+
389
+ 3. **Run Tests**:
390
+ ```bash
391
+ make test
392
+ ```
393
+
394
+ 4. **Build Documentation**:
395
+ ```bash
396
+ make docs
397
+ ```
398
+
399
+ ### Contributing
400
+
401
+ Contributions are welcome! Please follow these guidelines when contributing:
402
+
403
+ 1. Fork the repository.
404
+ 2. Create your feature branch (`git checkout -b feature/new-feature`).
405
+ 3. Commit your changes (`git commit -am 'Add new feature'`).
406
+ 4. Push to the branch (`git push origin feature/new-feature`).
407
+ 5. Create a new Pull Request.
408
+
409
+ ### License
410
+
411
+ Fabricatio is licensed under the MIT License. See [LICENSE](LICENSE) for more details.
412
+
413
+ ### Acknowledgments
414
+
415
+ Special thanks to the contributors and maintainers of:
416
+ - [PyO3](https://github.com/PyO3/pyo3)
417
+ - [Maturin](https://github.com/PyO3/maturin)
418
+ - [Handlebars.rs](https://github.com/sunng87/handlebars-rust)
419
+
420
+