Skip to main content

strip_media_markers_model_visible

Function strip_media_markers_model_visible 

pub fn strip_media_markers_model_visible(message: &ChatMessage) -> String
Expand description

Strip every media marker from the model-visible text of one message, for the text-only degrade path: all marker kinds, all roles.

Same contract as sanitize_image_markers and sanitize_audio_markers, applied to a single message: an assistant tool-call envelope is rewritten field-wise (only its content string, through rewrite_model_visible_text) so signed reasoning_content and tool_calls[].extra_content replay byte-for-byte, and every other message is rewritten as a whole string. strip_media_markers stays the plain-string form for callers that hold text rather than a history message.