mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
a246b79a4f
- Refactor channel adapters (feishu, telegram, local) with enhanced descriptor and config - Restructure channel manager, service, types, and outbound messaging - Simplify chat module by removing normalize.go and chat.go, consolidating into resolver and types - Update router channel handlers and tests - Sync swagger documentation
18 lines
388 B
Go
18 lines
388 B
Go
// Package common provides shared utilities for channel adapters.
|
|
package common
|
|
|
|
import "strings"
|
|
|
|
// SummarizeText returns a truncated preview of the text, limited to 120 characters.
|
|
func SummarizeText(text string) string {
|
|
value := strings.TrimSpace(text)
|
|
if value == "" {
|
|
return ""
|
|
}
|
|
const limit = 120
|
|
if len(value) <= limit {
|
|
return value
|
|
}
|
|
return value[:limit] + "..."
|
|
}
|