PromptAugmenter
Interface for augmenting prompts with relevant context retrieved from memory.
Implementations define how retrieved context is inserted into the prompt. Two built-in implementations are provided:
SystemPromptAugmenter — inserts context as a system message
UserPromptAugmenter — inserts context as a user message
Can also be implemented as a lambda thanks to the fun interface declaration:
val custom = PromptAugmenter { prompt, context ->
// custom augmentation logic
prompt
}Content copied to clipboard