Package io.github.jbastgen.stemma.app.ai
Class SummaryCache
java.lang.Object
io.github.jbastgen.stemma.app.ai.SummaryCache
Descriptions that were already asked for, one small file each in the configuration folder, so asking again is free.
The key covers the commits, the model and the prompt template: changing the model or editing the template asks again.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintclear()Removes every cached description.The stored summary, if there is one and it can be read.static StringThe key of a summary: a hash of provider, model, template and commits, so a change of any of them asks again.voidput(String key, CommitSummary.Summary s) Stores a summary and removes the oldest ones when there are too many.intsize()How many summaries are stored.
-
Constructor Details
-
SummaryCache
- Parameters:
dir- the folder of the cache; created when the first summary is stored
-
-
Method Details
-
key
The key of a summary: a hash of provider, model, template and commits, so a change of any of them asks again. -
get
The stored summary, if there is one and it can be read. -
put
Stores a summary and removes the oldest ones when there are too many. -
clear
public int clear()Removes every cached description. @return how many -
size
public int size()How many summaries are stored.
-