(value string, maxLen int)
| 619 | } |
| 620 | |
| 621 | func truncateRunes(value string, maxLen int) string { |
| 622 | if maxLen <= 0 { |
| 623 | return "" |
| 624 | } |
| 625 | runes := []rune(value) |
| 626 | if len(runes) <= maxLen { |
| 627 | return value |
| 628 | } |
| 629 | return string(runes[:maxLen]) |
| 630 | } |
| 631 | |
| 632 | // Manual title regeneration is user-initiated and can use richer |
| 633 | // conversation context than the automatic first-message title path |
no outgoing calls