Skip to main content

A extension for fabricatio, providing capabilities to handle raw requirment, digesting it into a task list

Project description

fabricatio-digest

MIT Python Versions PyPI Version PyPI Downloads PyPI Downloads Build Tool: uv

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, and Propose/Task base classes.

License

MIT — see LICENSE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fabricatio_digest-0.3.2-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

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

Hashes for fabricatio_digest-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 082853880bd57ae8ced495477649b0d986755f363894ac99acd5eb8f25ca0798
MD5 947a68475e117e956b8c26b0c2199b84
BLAKE2b-256 04f5f00843a96a91ab6f72bdc021f5968ccdb56dc38ea157d87afd3bb0d98279

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page