Package com.tnsai.refinement
Class BuiltInChecks
java.lang.Object
com.tnsai.refinement.BuiltInChecks
Built-in criteria checks for the refinement loop.
-
Method Summary
Modifier and TypeMethodDescriptionstatic CriteriaCheckCustom predicate check.static CriteriaCheckUse LLM to evaluate quality.static CriteriaCheckmatchesPattern(String regex) Check that output matches a regex pattern.static CriteriaCheckminLines(int min) Check minimum line count.static CriteriaCheckmustContain(String... required) Check that output contains required strings.static CriteriaCheckmustNotContain(String... forbidden) Check that output does not contain forbidden strings.static CriteriaCheckshellCommand(String command) Run a shell command and check exit code.static CriteriaCheckCheck that output is valid JSON.static CriteriaCheckwordCount(int min, int max) Check word count is within range.
-
Method Details
-
mustContain
Check that output contains required strings. -
mustNotContain
Check that output does not contain forbidden strings. -
matchesPattern
Check that output matches a regex pattern. -
wordCount
Check word count is within range. -
shellCommand
Run a shell command and check exit code. -
llmCheck
public static CriteriaCheck llmCheck(com.tnsai.llm.LLMClient llm, String question, double threshold) Use LLM to evaluate quality. -
custom
Custom predicate check. -
validJson
Check that output is valid JSON. -
minLines
Check minimum line count.
-