MCPcopy Create free account
hub / github.com/astercloud/aster / extractTextContent

Function extractTextContent

pkg/session/summary.go:242–251  ·  view source on GitHub ↗

extractTextContent 提取消息的文本内容

(msg types.Message)

Source from the content-addressed store, hash-verified

240
241// extractTextContent 提取消息的文本内容
242func 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 从摘要中提取关键主题
254func extractKeyTopics(summary string) []string {

Callers 4

SearchHistoryMethod · 0.85
FindSimilarMessagesMethod · 0.85
buildSummaryPromptMethod · 0.85

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected