CaptureUserMessage 捕获用户消息事件
(namespace, content string, metadata map[string]any)
| 293 | |
| 294 | // CaptureUserMessage 捕获用户消息事件 |
| 295 | func (m *LogicMemoryMiddleware) CaptureUserMessage(namespace, content string, metadata map[string]any) { |
| 296 | event := &logic.Event{ |
| 297 | Type: "user_message", |
| 298 | Source: namespace, |
| 299 | Data: map[string]any{"content": content}, |
| 300 | Timestamp: time.Now(), |
| 301 | } |
| 302 | maps.Copy(event.Data, metadata) |
| 303 | m.captureEvent(event) |
| 304 | } |
| 305 | |
| 306 | // CaptureUserFeedback 捕获用户反馈事件 |
| 307 | func (m *LogicMemoryMiddleware) CaptureUserFeedback(namespace string, feedback string, rating int, metadata map[string]any) { |