Package-level declarations

Types

Link copied to clipboard

Configuration for the Kmemo plugin.

Properties

Link copied to clipboard
val Kmemo: ApplicationPlugin<KmemoConfig>

A Ktor server plugin that makes a SemanticCache available to every route handler.

Link copied to clipboard
val Application.kmemoCache: SemanticCache
val ApplicationCall.kmemoCache: SemanticCache

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.