Documentation
¶
Overview ¶
Package sanitize provides text sanitization for session backfill processing.
Index ¶
Constants ¶
View Source
const DefaultMaxBlockSize = 3000
DefaultMaxBlockSize is the maximum size of a single text block before truncation.
Variables ¶
View Source
var ( // Base64Regex matches large base64/hex payloads (500+ chars). Base64Regex = regexp.MustCompile(`(?m)[A-Za-z0-9+/=]{500,}`) // SystemReminderRegex matches <system-reminder>...</system-reminder> blocks. SystemReminderRegex = regexp.MustCompile(`(?s)<system-reminder>.*?</system-reminder>`) )
Patterns for content that should be stripped before LLM processing.
Functions ¶
func Text ¶
Text sanitizes a text block by removing system reminders, base64 payloads, and truncating overly long blocks.
func TextWithLimit ¶
TextWithLimit sanitizes text with a custom truncation limit.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.