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

Method GetSummaryText

pkg/memory/session_summary.go:290–335  ·  view source on GitHub ↗

GetSummaryText 获取摘要文本(用于添加到上下文)

(sessionID string)

Source from the content-addressed store, hash-verified

288
289// GetSummaryText 获取摘要文本(用于添加到上下文)
290func (m *SessionSummaryManager) GetSummaryText(sessionID string) string {
291 summary, exists := m.GetSummary(sessionID)
292 if !exists {
293 return ""
294 }
295
296 text := fmt.Sprintf("会话摘要:\n%s\n", summary.Summary)
297
298 if len(summary.Topics) > 0 {
299 text += "\n讨论主题:\n"
300 var textSb299 strings.Builder
301 for _, topic := range summary.Topics {
302 textSb299.WriteString(fmt.Sprintf("- %s\n", topic))
303 }
304 text += textSb299.String()
305 }
306
307 if len(summary.KeyPoints) > 0 {
308 text += "\n关键要点:\n"
309 var textSb306 strings.Builder
310 for _, point := range summary.KeyPoints {
311 textSb306.WriteString(fmt.Sprintf("- %s\n", point))
312 }
313 text += textSb306.String()
314 }
315
316 if len(summary.Decisions) > 0 {
317 text += "\n决策:\n"
318 var textSb313 strings.Builder
319 for _, decision := range summary.Decisions {
320 textSb313.WriteString(fmt.Sprintf("- %s\n", decision))
321 }
322 text += textSb313.String()
323 }
324
325 if len(summary.ActionItems) > 0 {
326 text += "\n行动项:\n"
327 var textSb320 strings.Builder
328 for _, item := range summary.ActionItems {
329 textSb320.WriteString(fmt.Sprintf("- %s\n", item))
330 }
331 text += textSb320.String()
332 }
333
334 return text
335}
336
337// 辅助方法
338

Calls 2

GetSummaryMethod · 0.95
StringMethod · 0.45

Tested by 1