feat: 提醒到期 → LLM生成自然提醒语 → 推送
- Gateway ReminderScheduler 到期时调用 ai-core /api/v1/internal/reminder-trigger - ai-core 用 LLM 生成温柔俏皮的提醒语,通过 messagePusher 推送 - Thinker 新增 TriggerReminderMessage 方法 - 环境变量: AI_CORE_URL (Gateway 已有) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -350,6 +350,26 @@ func (t *Thinker) UpdatePresence(online bool, sessionID string) {
|
||||
}
|
||||
}
|
||||
|
||||
// TriggerReminderMessage pushes a reminder message generated by LLM to the user.
|
||||
// Called by the internal reminder-trigger endpoint when a reminder fires.
|
||||
func (t *Thinker) TriggerReminderMessage(userID, sessionID, message string) {
|
||||
t.mu.Lock()
|
||||
pusher := t.messagePusher
|
||||
pushSessionID := sessionID
|
||||
if pushSessionID == "" {
|
||||
pushSessionID = t.activeSessionID
|
||||
}
|
||||
if pushSessionID == "" {
|
||||
pushSessionID = t.adminSessionID
|
||||
}
|
||||
t.mu.Unlock()
|
||||
|
||||
if pusher != nil && message != "" {
|
||||
log.Printf("[提醒推送] 推送LLM提醒: user=%s session=%s msg=%s", userID, pushSessionID, message)
|
||||
pusher(userID, pushSessionID, message)
|
||||
}
|
||||
}
|
||||
|
||||
// ThinkerConfig 后台思考配置
|
||||
type ThinkerConfig struct {
|
||||
Enabled bool
|
||||
|
||||
Reference in New Issue
Block a user