UserPromptAugmenter
A PromptAugmenter that injects retrieved context into the last Message.User of the prompt.
The retrieved context is rendered through template and added as an additional MessagePart.Text appended to the existing parts of the last user message. The original user message is replaced with a copy that:
preserves its Message.metaInfo and Message.id,
preserves all existing parts (text, attachments, tool results, etc.),
gains one extra MessagePart.Text at the end carrying the formatted context.
If the prompt contains no Message.User, or the formatted context is blank, or the relevant context list is empty, the original prompt is returned unchanged.
Parameters
The template for user context insertion. Use PromptAugmenter.RELEVANT_CONTEXT_PLACEHOLDER placeholder.
The prefix to add before relevant context.
See also
Types
Functions
Augments the given prompt with relevant context.