Class LabelEstimator
java.lang.Object
io.github.jbastgen.stemma.app.label.LabelEstimator
Guesses the labels of commits with the AI, one commit at a time: for each commit the prompt names the configured
labels and shows the commit's message and changes, the answer is read strictly (only configured labels count), and
the labels found are applied. Commits for which the AI names no label are left alone.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceSends a prompt.static final classOne run over some commits.static interfaceReads message and changes of one commit; blocking.static final recordWhat a run did.static final recordA request that is under way: its answer, and a way to stop it.static interfaceCalled before each commit: how many are done, how many there are.static interfaceApplies the labels (by id) to a commit. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StringbuildPrompt(String template, String repo, String branch, CommitData commit, List<LabelIndex.LabelDef> labels, AiConfig config) Fills the template for one commit:{labels}with the configured labels, and (as for the description of a commit){repo},{branch},{commits}and{diff}.static List<LabelIndex.LabelDef> parse(String answer, List<LabelIndex.LabelDef> labels) Reads the answer: the names of labels, separated by commas, semicolons or line breaks.
-
Field Details
-
TEMPLATE_NAME
The name of the editable prompt template.- See Also:
-
-
Method Details
-
buildPrompt
public static String buildPrompt(String template, String repo, String branch, CommitData commit, List<LabelIndex.LabelDef> labels, AiConfig config) Fills the template for one commit:{labels}with the configured labels, and (as for the description of a commit){repo},{branch},{commits}and{diff}. Files that match the privacy patterns never appear, not even by name. -
parse
Reads the answer: the names of labels, separated by commas, semicolons or line breaks. Only configured labels count (by name or id, without regard to case); anything else, andNONE, is ignored. At most 3.
-