A extension for fabricatio, providing capabilities to handle raw requirment, digesting it into a task list
Project description
fabricatio-digest
Converts a natural-language requirement into a validated, executable TaskList with role awareness and dependency sequencing.
Installation
pip install fabricatio[digest]
Overview
fabricatio-digest takes a raw requirement string together with a set of registered roles and uses an LLM-backed proposal pipeline to generate a structured TaskList. The resulting task list is executable — each task carries the context and description injected during generation, and hook callbacks can be attached for pre/post-execution behavior.
Key Classes
Digest (mixin capability)
Extends Propose. Inherit this to add requirement-to-tasklist generation to a role.
from fabricatio_digest.capabilities.digest import Digest
class PlannerRole(SomeBaseRole, Digest):
"""A role that can break down requirements into task lists."""
pass
task_list = await planner.digest(
requirement="Summarize all PRs from the last week and post to Slack.",
receptions={RoleName("reviewer"), RoleName("notifier")},
)
| Method | Description |
|---|---|
digest(requirement, receptions, **kwargs) |
Renders a template with the requirement and role metadata, then calls propose(TaskList, ...). Returns Optional[TaskList]. |
TaskList
Pydantic model representing a sequence of tasks that aim to satisfy an ultimate_target.
| Field / Method | Description |
|---|---|
ultimate_target: str |
The overarching goal of the task list. |
tasks: List[Task] |
Ordered list of Task objects from fabricatio-core. |
parallel: bool |
If True, tasks are executed concurrently. |
add_before_exec_hook(hook) |
Register a callback to run before each task. |
add_after_exec_hook(hook) |
Register a callback to run after each task. |
inject_context(**kwargs) |
Merge keyword arguments into every task's initial context. |
inject_description(desc: str) |
Append extra text to every task's description. |
execute(parallel=None) |
Run the task sequence, respecting hooks and the parallel flag. |
explain() |
Render a human-readable explanation via template. |
DigestConfig
Dataclass loaded from fabricatio-core configuration under the digest namespace.
| Field | Default | Description |
|---|---|---|
digest_template |
"built-in/digest" |
Template used to build the proposal prompt. |
task_list_explain_template |
"built-in/task_list_explain" |
Template used by TaskList.explain(). |
Access the global instance:
from fabricatio_digest.config import digest_config
Dependencies
fabricatio-core— core interfaces, template manager, andPropose/Taskbase classes.
License
MIT — see LICENSE
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fabricatio_digest-0.3.2-py3-none-any.whl.
File metadata
- Download URL: fabricatio_digest-0.3.2-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
082853880bd57ae8ced495477649b0d986755f363894ac99acd5eb8f25ca0798
|
|
| MD5 |
947a68475e117e956b8c26b0c2199b84
|
|
| BLAKE2b-256 |
04f5f00843a96a91ab6f72bdc021f5968ccdb56dc38ea157d87afd3bb0d98279
|