Package com.tnsai.refinement
Class CompletionCriteria.Builder
java.lang.Object
com.tnsai.refinement.CompletionCriteria.Builder
- Enclosing class:
CompletionCriteria
Builder for CompletionCriteria.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the CompletionCriteria.check(CriteriaCheck check) Adds a custom CriteriaCheck.compilerCheck(String command) Adds a shell command check (e.g., compiler, linter).customCheck(String name, Predicate<String> predicate) Adds a custom check with a predicate.customCheck(String name, Predicate<String> predicate, String failMessage) Adds a custom check with a predicate and fail message.Adds a lint check.Adds an LLM-based check.matchesPattern(String regex) Adds a regex pattern check.minLines(int min) Adds a minimum line count check.mustContain(String... required) Adds required content checks.mustNotContain(String... forbidden) Adds forbidden content checks.testCommand(String command) Adds a test command check.Adds a valid JSON check.withLLM(com.tnsai.llm.LLMClient llm) Sets the LLM client for LLM-based checks.wordCount(int min, int max) Adds a word count check.
-
Method Details
-
withLLM
Sets the LLM client for LLM-based checks. -
compilerCheck
Adds a shell command check (e.g., compiler, linter). -
testCommand
Adds a test command check. -
lintCheck
Adds a lint check. -
mustContain
Adds required content checks. -
mustNotContain
Adds forbidden content checks. -
matchesPattern
Adds a regex pattern check. -
wordCount
Adds a word count check. -
minLines
Adds a minimum line count check. -
validJson
Adds a valid JSON check. -
customCheck
Adds a custom check with a predicate. -
customCheck
public CompletionCriteria.Builder customCheck(String name, Predicate<String> predicate, String failMessage) Adds a custom check with a predicate and fail message. -
llmCheck
Adds an LLM-based check. -
check
Adds a custom CriteriaCheck. -
build
Builds the CompletionCriteria.
-