extractTextContent 提取消息的文本内容
(msg types.Message)
| 240 | |
| 241 | // extractTextContent 提取消息的文本内容 |
| 242 | func extractTextContent(msg types.Message) string { |
| 243 | var content strings.Builder |
| 244 | for _, block := range msg.ContentBlocks { |
| 245 | if textBlock, ok := block.(*types.TextBlock); ok { |
| 246 | content.WriteString(textBlock.Text) |
| 247 | content.WriteString(" ") |
| 248 | } |
| 249 | } |
| 250 | return strings.TrimSpace(content.String()) |
| 251 | } |
| 252 | |
| 253 | // extractKeyTopics 从摘要中提取关键主题 |
| 254 | func extractKeyTopics(summary string) []string { |
no test coverage detected