symfonic.core.documents.truncation¶
truncation ¶
Token-aware text truncation utilities.
estimate_tokens ¶
truncate_to_tokens ¶
Truncate text to fit within a token budget.
Uses a simple character-based estimate: max_tokens * chars_per_token.