SemanticCacheBuilder
Builds a SemanticCache with a DSL instead of a long positional constructor call.
The constructor has grown a parameter per capability — resilience, observability, write-behind — and a call that sets three of them ends up threading past the ten it does not. This reads them by name, one per line, and leaves the rest at their defaults:
val cache = semanticCache(embedder) {
threshold = 0.9
store = InMemoryStore(maxEntries = 50_000)
negativeCacheSize = 10_000
listeners = listOf(metrics)
}Content copied to clipboard
Every property mirrors the SemanticCache constructor parameter of the same name and carries the same default and the same meaning — see SemanticCache for what each one does. build validates exactly as the constructor does.
Properties
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
What a model call costs, per scope. A mutable map so a builder block can fill it in place: prices["gpt-4o"] = TokenPrices(...).
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Functions
Link copied to clipboard
Constructs the SemanticCache from the current settings.