PromptCache

interface PromptCache(source)

Interface for caching prompt execution results. Implementations should provide a way to store and retrieve prompt execution results.

Inheritors

Types

Link copied to clipboard
interface Factory

Represents a factory interface for creating instances of PromptCache. Factories implementing this interface are designed to construct specific types of prompt caches based on a provided configuration string.

Functions

Link copied to clipboard
abstract suspend fun get(prompt: Prompt, tools: List<ToolDescriptor> = emptyList()): List<Message.Response>?

Get a cached response for a prompt with tools, or null if not cached.

Link copied to clipboard
abstract suspend fun put(prompt: Prompt, tools: List<ToolDescriptor> = emptyList(), response: List<Message.Response>)

Put a response in the cache for a prompt with tools.