Package com.tnsai.llm.cache
Class CachedLLMClient.Builder
java.lang.Object
com.tnsai.llm.cache.CachedLLMClient.Builder
- Enclosing class:
CachedLLMClient
Builder for CachedLLMClient.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()cacheStreaming(boolean cache) Whether to cache streaming responses.highThreshold(double threshold) Sets the high similarity threshold for direct cache hits.lowThreshold(double threshold) Sets the low similarity threshold.withCache(SemanticCache cache) Sets the semantic cache to use.
-
Method Details
-
withCache
Sets the semantic cache to use. -
highThreshold
Sets the high similarity threshold for direct cache hits. Default: 0.95 -
lowThreshold
Sets the low similarity threshold. Similarities below this skip the cache entirely. Default: 0.70 -
cacheStreaming
Whether to cache streaming responses. Default: true -
build
-