after_model(
self,
state: lc_agents.AgentState,
runtime: Runtime
) -> Optional[dict| Name | Type | Description |
|---|---|---|
state* | lc_agents.AgentState | |
runtime* | Runtime |
Sanitize model responses before returning to the user.
This hook is called after the model generates a response. We sanitize the AI's response to ensure it doesn't contain harmful content.
Current agent state containing messages.
Runtime object containing context and configuration.