Skip to main content

mellea.stdlib.instruction

Instructions.

Classes

Instruction

The Instruction in an instruct/validate/repair loop. Methods:

parts

parts(self)
Returns all of the constituent parts of an Instruction.

format_for_llm

format_for_llm(self) -> TemplateRepresentation
Formats the instruction for Formatter use.

apply_user_dict_from_jinja

apply_user_dict_from_jinja(user_dict: dict[str, str], s: str) -> str
Treats s as a jinja string and user_dict as the template values dictionary.

requirements

requirements(self) -> list[Requirement]
Returns a list of Requirement instances.

copy_and_repair

copy_and_repair(self, repair_string: str) -> Instruction
Creates a copy of the instruction and adds/overwrites the repair string.
I