fabricatio_rule.actions.rules

A module containing the DraftRuleSet action.

Classes

DraftRuleSet

Action to draft a ruleset based on a given requirement description.

GatherRuleset

Action to gather a ruleset from a given requirement description.

Module Contents

class fabricatio_rule.actions.rules.DraftRuleSet(/, **data: Any)

Bases: fabricatio_core.models.action.Action, fabricatio_rule.capabilities.check.Check, fabricatio_actions.models.generic.FromMapping

Action to draft a ruleset based on a given requirement description.

output_key: str = 'drafted_ruleset'

The key used to store the drafted ruleset in the context dictionary.

ruleset_requirement: str | None = None

The natural language description of the desired ruleset characteristics.

rule_count: int = 0

The number of rules to generate in the ruleset (0 for no restriction).

classmethod from_mapping(mapping: Mapping[str, Tuple[int, str]], **kwargs) List[Self]

Create a list of DraftRuleSet actions from a mapping of output keys to tuples of rule counts and requirements.

class fabricatio_rule.actions.rules.GatherRuleset(/, **data: Any)

Bases: fabricatio_core.models.action.Action, fabricatio_actions.models.generic.FromMapping

Action to gather a ruleset from a given requirement description.

output_key: str = 'gathered_ruleset'

The key used to store the drafted ruleset in the context dictionary.

to_gather: List[str]

the cxt name of RuleSet to gather

classmethod from_mapping(mapping: Mapping[str, List[str]], **kwargs: Any) List[Self]

Create a list of GatherRuleset actions from a mapping of output keys to tuples of rule counts and requirements.