Package-level declarations
Types
Link copied to clipboard
class KmemoConfig
Configuration for the Kmemo plugin.
Properties
Link copied to clipboard
A Ktor server plugin that makes a SemanticCache available to every route handler.
Link copied to clipboard
The SemanticCache installed by the Kmemo plugin. Throws if the plugin was not installed.
Functions
Link copied to clipboard
suspend fun ApplicationCall.getOrPut(prompt: String, scope: String = SemanticCache.DEFAULT_SCOPE, metadata: Map<String, String> = emptyMap(), compute: suspend (String) -> String): String
Returns the cached answer to prompt, or runs compute and caches it — the installed cache's SemanticCache.getOrPut, reachable straight off the call.