Companion

A companion object implementation of the PromptCache.Factory.Named specialized for an in-memory prompt cache. This factory is responsible for creating instances of InMemoryPromptCache based on a specific configuration string.

The factory expects the configuration string to begin with "memory", followed by an optional size limit. The size limit may either be omitted, set to "unlimited", or represented as a numeric value indicating the maximum number of entries in the cache.

Properties

Link copied to clipboard

The unique name associated with the factory.

Functions

Link copied to clipboard
open override fun create(config: String): PromptCache

Creates a new instance of PromptCache based on the provided configuration string.

Link copied to clipboard
open fun elements(config: String): List<String>

Splits the given configuration string into a list of elements using ':' as the primary delimiter, while correctly handling nested structures indicated by curly braces '{' and '}'.

Link copied to clipboard
fun supports(config: String): Boolean

Determines if the current factory instance can support the provided configuration string.