/tldr [since] summarizes the messages in the channel it is run in that the caller has not been summarized yet, using a small local model on Ollama, and replies ephemerally. The answer streams into the reply as it is written. - Per-user, per-channel cursor (tldr_cursors) so each run picks up where the last left off; `since:` (e.g. 6h, 2d, max 7d) peeks without moving it. First use covers the last 24h, and a stale cursor never reaches back more than 7 days. - Only summarizes channels both the caller and the bot can read. - The transcript drops bots, system messages, reactions and filler, turns links, GIFs, images and files into short tags ([link: site], [image], [file: name], preview titles), marks replies, and writes a date marker where the chat paused for 3h or more so the model can keep topics apart. - The prompt asks for one bullet per conversation, oldest first, with a worked example; it was tuned against a synthetic chat and a real export with qwen3:4b-instruct-2507 (the default model). - One model call at a time across the bot, one /tldr per user. - docker-compose: Ollama service (CPU only, 8g memory cap: 6g killed the runner mid-request), model pull on startup. Needs the tldr_cursors migration (velox-dashboard-api 000016). Co-Authored-By: Claude Opus 5.5 <[email protected]>
56 lines
1.8 KiB
Go
56 lines
1.8 KiB
Go
package services
|
|
|
|
import (
|
|
"velox-bot/internal/db/services/defaultrole"
|
|
"velox-bot/internal/db/services/level"
|
|
"velox-bot/internal/db/services/levelsettings"
|
|
"velox-bot/internal/db/services/logsettings"
|
|
"velox-bot/internal/db/services/meeting"
|
|
"velox-bot/internal/db/services/musicsettings"
|
|
"velox-bot/internal/db/services/projects"
|
|
"velox-bot/internal/db/services/rps"
|
|
"velox-bot/internal/db/services/schedule"
|
|
"velox-bot/internal/db/services/tldr"
|
|
"velox-bot/internal/db/services/twitch"
|
|
"velox-bot/internal/db/services/usersettings"
|
|
"velox-bot/internal/db/services/welcome"
|
|
)
|
|
|
|
type Services struct {
|
|
Level *level.Service
|
|
LevelSettings *levelsettings.Service
|
|
Meeting *meeting.Service
|
|
Schedule *schedule.Service
|
|
UserSettings *usersettings.Service
|
|
Projects *projects.Service
|
|
RPS *rps.Service
|
|
Twitch *twitch.Service
|
|
Welcome *welcome.Service
|
|
DefaultRole *defaultrole.Service
|
|
LogSettings *logsettings.Service
|
|
MusicSettings *musicsettings.Service
|
|
TLDR *tldr.Service
|
|
}
|
|
|
|
var Global *Services
|
|
|
|
func NewServices(level *level.Service, levelSettings *levelsettings.Service, meeting *meeting.Service, schedule *schedule.Service, userSettings *usersettings.Service, projects *projects.Service, rps *rps.Service, twitchSvc *twitch.Service, welcomeSvc *welcome.Service, defaultRoleSvc *defaultrole.Service, logSettingsSvc *logsettings.Service, musicSvc *musicsettings.Service, tldrSvc *tldr.Service) *Services {
|
|
s := &Services{
|
|
Level: level,
|
|
LevelSettings: levelSettings,
|
|
Meeting: meeting,
|
|
Schedule: schedule,
|
|
UserSettings: userSettings,
|
|
Projects: projects,
|
|
RPS: rps,
|
|
Twitch: twitchSvc,
|
|
Welcome: welcomeSvc,
|
|
DefaultRole: defaultRoleSvc,
|
|
LogSettings: logSettingsSvc,
|
|
MusicSettings: musicSvc,
|
|
TLDR: tldrSvc,
|
|
}
|
|
Global = s
|
|
return s
|
|
}
|