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

Function generateSummaryWithLLM

examples/phase4_integration.go:69–99  ·  view source on GitHub ↗

generateSummaryWithLLM 使用 LLM 生成对话总结

(_ context.Context, messages []types.Message)

Source from the content-addressed store, hash-verified

67
68// generateSummaryWithLLM 使用 LLM 生成对话总结
69func generateSummaryWithLLM(_ context.Context, messages []types.Message) (string, error) {
70 // 这是一个示例实现
71 // 实际应用中应该:
72 // 1. 使用 Provider 接口调用 LLM
73 // 2. 使用专门的总结提示词
74 // 3. 设置较低的 temperature (如 0.3)
75
76 // 构建总结请求
77 _ = `Please provide a concise summary of the following conversation, capturing:
781. Main topics discussed
792. Important decisions or conclusions
803. Action items or next steps
814. Relevant technical details or constraints
82
83Keep the summary focused and informative, around 200-300 words.`
84
85 // TODO: 实际应该组装消息并调用LLM
86 // Example:
87 // summaryMessages := []types.Message{
88 // {Role: types.MessageRoleSystem, Content: summaryPrompt},
89 // }
90 // summaryMessages = append(summaryMessages, messages...)
91 // resp, err := provider.Stream(ctx, summaryMessages, &provider.StreamOptions{
92 // Temperature: 0.3,
93 // MaxTokens: 500,
94 // })
95 _ = messages
96
97 // 示例返回
98 return "Summary of conversation: [Topics discussed, decisions made, next steps...]", nil
99}
100
101// createStoreBackend 创建 Store Backend (持久化存储)
102func createStoreBackend() backends.BackendProtocol {

Callers 1

Phase4IntegrationExampleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected