Skip to main content

format_event_for_agent

Function format_event_for_agent 

Source
pub fn format_event_for_agent(event: &Event) -> String
Expand description

Format an event as a system message the agent can understand. Wrapped in XML tags to prevent prompt injection — the model should treat content inside tags as DATA, not instructions. Example: <event id="abc" type="alert" severity="high" source="uptime-kuma" channel="alerts">Jellyfin is DOWN.</event>