SystemPromptAugmenter
A PromptAugmenter that injects retrieved context into the first Message.System of the prompt.
The retrieved context is rendered through template and added as an additional MessagePart.Text appended to the existing parts of the first system message, separated by PromptAugmenter.SECTION_SEPARATOR. The original system message is replaced with a copy that:
preserves its Message.metaInfo and Message.id,
preserves all existing parts (text, attachments, etc.),
gains two extra MessagePart.Text entries at the end: a separator and the formatted context.
If the prompt contains no Message.System, or the formatted context is blank, or the relevant context list is empty, the original prompt is returned unchanged.
Parameters
The template for the system message. Use PromptAugmenter.RELEVANT_CONTEXT_PLACEHOLDER placeholder.
The prefix to add before relevant context.
See also
Types
Functions
Augments the given prompt with relevant context.