Functions
FUNC requirement_check_to_bool
True.
By default, the requirement check alora outputs: {"requirement_likelihood": 0.0}.
True if >.5
FUNC reqify
FUNC req
FUNC check
FUNC simple_validate
Requirement("Answer 'yes' or 'no'", simple_validate(lambda x: x == 'yes' or x == 'no')
Validation functions operate over Context. Often you do not care about the entire context, and just want to consider the most recent output from the model.
Args:
fn: the simple validation function that takes a string and returns either a bool or (bool, str)reason: only used if the provided function returns a bool; if the validation function fails, a static reason for that failure to give to the llm when repairing
Classes
CLASS LLMaJRequirement
A requirement that always uses LLM-as-a-Judge. Any available constraint ALoRA will be ignored.
CLASS ALoraRequirement
A requirement that always uses an (possibly specified) ALora. If an exception is thrown during the ALora execution path, mellea will fall back to LLMaJ. But that is the only case where LLMaJ will be used.