getOrPut

suspend fun getOrPut(prompt: String, scope: String = SemanticCache.DEFAULT_SCOPE, metadata: Map<String, String> = emptyMap(), compute: suspend (String) -> String): String
suspend fun getOrPut(prompt: String, context: List<String>, tags: Set<String> = emptySet(), scope: String = SemanticCache.DEFAULT_SCOPE, metadata: Map<String, String> = emptyMap(), compute: suspend (String) -> String): String
suspend fun <T> getOrPut(prompt: String, codec: ResponseCodec<T>, scope: String = SemanticCache.DEFAULT_SCOPE, metadata: Map<String, String> = emptyMap(), compute: suspend (String) -> T): T

See also