RedisPromptCache

class RedisPromptCache(client: RedisClient, prefix: String, ttl: Duration) : PromptCache(source)

Redis-based implementation of PromptCache. This implementation stores cache entries in a Redis database.

Parameters

client

The Redis client to use for connecting to Redis

Constructors

Link copied to clipboard
constructor(client: RedisClient, prefix: String, ttl: Duration)

Types

Link copied to clipboard

Companion object for the RedisPromptCache class, functioning as a factory for creating Redis-backed implementations of the PromptCache interface.

Functions

Link copied to clipboard
fun close()

Closes the Redis connection. This method should be called when the cache is no longer needed.

Link copied to clipboard
open suspend override fun get(prompt: Prompt, tools: List<ToolDescriptor>): List<Message.Response>?
Link copied to clipboard
open suspend override fun put(prompt: Prompt, tools: List<ToolDescriptor>, response: List<Message.Response>)