CachedPromptExecutor

class CachedPromptExecutor(cache: PromptCache, nested: PromptExecutor, clock: KoogClock = KoogClock.System) : PromptExecutor(source)

A CodePromptExecutor that caches responses from a nested executor.

Parameters

cache

The cache implementation to use

nested

The nested executor to use for cache misses

Constructors

Link copied to clipboard
constructor(cache: PromptCache, nested: PromptExecutor, clock: KoogClock = KoogClock.System)

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
open suspend override fun execute(prompt: Prompt, model: LLModel, tools: List<ToolDescriptor>): Message.Assistant
open suspend fun execute(prompt: Prompt, model: ResolvedModel, tools: List<ToolDescriptor>): Message.Assistant
Link copied to clipboard
open suspend fun executeMultipleChoices(prompt: Prompt, resolvedModel: ResolvedModel, tools: List<ToolDescriptor>): LLMChoice
open suspend fun executeMultipleChoices(prompt: Prompt, model: LLModel, tools: List<ToolDescriptor>): LLMChoice
Link copied to clipboard
open override fun executeStreaming(prompt: Prompt, model: LLModel, tools: List<ToolDescriptor>): Flow<StreamFrame>
open fun executeStreaming(prompt: Prompt, resolvedModel: ResolvedModel, tools: List<ToolDescriptor>): Flow<StreamFrame>
Link copied to clipboard
Link copied to clipboard
open suspend override fun models(): List<LLModel>
Link copied to clipboard
open suspend override fun moderate(prompt: Prompt, model: LLModel): ModerationResult
open suspend fun moderate(prompt: Prompt, model: ResolvedModel): ModerationResult
Link copied to clipboard
open suspend fun resolveModel(model: LLModel, promptExecutorOperation: PromptExecutorOperation): ResolvedModel