EmbedFailurePolicy

What SemanticCache.getOrPut does when the Embedder throws.

The embedder is a network call the cache makes on every lookup, so it is the cache's most frequent point of failure. The two policies encode the two honest answers to "the embedder is down": surface it, or route around it.

This only governs SemanticCache.getOrPut, the one entry point that has something to fall back to — a compute block that can produce the answer without the cache. SemanticCache.lookup, SemanticCache.get and SemanticCache.put have no such fallback and always propagate an embed failure regardless of this setting.

A kotlin.coroutines.cancellation.CancellationException is never a "failure" in this sense: it is always re-thrown so coroutine cancellation keeps working, whichever policy is set.

Entries

Link copied to clipboard

Re-throw the embedder's exception to the caller (the default).

Link copied to clipboard

Swallow the embedder's exception and call compute as if the lookup had missed.

Properties

Link copied to clipboard

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.