mellea.stdlib.instruction
class mellea.stdlib.instruction.Instruction(description: str | CBlock | None = None, requirements: list[Requirement | str] | None = None, icl_examples: list[str | CBlock] | None = None, grounding_context: dict[str, str | CBlock | Component] | None = None, user_variables: dict[str, str] | None = None, prefix: str | CBlock | None = None, output_prefix: str | CBlock | None = None)
description
: str
: The description of the instruction.requirements
: List[Requirement | str]
: A list of requirements that the instruction can be validated against.icl_examples
: List[str | CBlock]
: A list of in-context-learning examples that the instruction can be validated against.grounding_context
: Dict[str, str | CBlock | Component]
: A list of grounding contexts that the instruction can use. They can bind as variables using a (key: str, value: str | ContentBlock) tuple.user_variables
: Dict[str, str]
: A dict of user-defined variables used to fill in Jinja placeholders in other parameters. This requires that all other provided parameters are provided as strings.prefix
: Optional[str | CBlock]
: A prefix string or ContentBlock to use when generating the instruction.output_prefix
: Optional[str | CBlock]
: A string or ContentBlock that defines a prefix for the output generation. Usually you do not need this.mellea.stdlib.instruction.Instruction.parts()
mellea.stdlib.instruction.Instruction.format_for_llm()
mellea.stdlib.instruction.Instruction.apply_user_dict_from_jinja(user_dict: dict[str, str], s: str)
mellea.stdlib.instruction.Instruction.requirements()