before_model(
self,
state: lc_agents.AgentState,
runtime: Runtime
) -> Optional[dict| Name | Type | Description |
|---|---|---|
state* | lc_agents.AgentState | |
runtime* | Runtime |
Sanitize user prompts before sending to the model.
This hook is called before the model processes the input. It extracts the latest user message and sanitizes it using Model Armor.
Current agent state containing messages.
Runtime object containing context and configuration.