Skip to content

strands.injection.message_injection

Delivery primitives for context injection.

These fold just-in-time text into the latest user message ephemerally — the model sees the augmented input for one call while the agent’s durable history is never touched. Reach injection through the ContextInjector plugin or the MemoryManager rather than these primitives directly.

class RenderContentCallback(Protocol)

Defined in: src/strands/injection/message_injection.py:26

Renders the text to fold into the latest user message for a model call.

Implemented by a plain function as well — the **kwargs tail lets the calling convention grow new keyword arguments without breaking existing callbacks.

def __call__(context: InjectionContext,
**kwargs: Any) -> str | None | Awaitable[str | None]

Defined in: src/strands/injection/message_injection.py:33

Return the text to inject, None/"" to skip, or an awaitable of either.