Markov updates

This commit is contained in:
2025-05-27 00:09:48 -06:00
parent b306143db2
commit 6955421fd7
6 changed files with 1254 additions and 59 deletions

View File

@ -20,6 +20,8 @@ type Config struct {
MarkovDefaultMessages int
MarkovMaxMessages int
MarkovCacheSize int
MarkovMaxNGram int // Maximum n-gram level (3, 4, 5, etc.)
MarkovMemoryLimit int // Memory limit in MB for n-gram chains
// Database settings
MaxOpenConns int
@ -30,6 +32,7 @@ type Config struct {
PingCooldown int
HsCooldown int
MarkovCooldown int
MarkovAskCooldown int
HimbucksCooldown int
HimboardCooldown int
SendbucksCooldown int
@ -52,6 +55,8 @@ func LoadConfig() *Config {
MarkovDefaultMessages: getEnvInt("MARKOV_DEFAULT_MESSAGES", 100),
MarkovMaxMessages: getEnvInt("MARKOV_MAX_MESSAGES", 1000),
MarkovCacheSize: getEnvInt("MARKOV_CACHE_SIZE", 10),
MarkovMaxNGram: getEnvInt("MARKOV_MAX_NGRAM", 5),
MarkovMemoryLimit: getEnvInt("MARKOV_MEMORY_LIMIT_MB", 100),
// Database settings
MaxOpenConns: getEnvInt("DB_MAX_OPEN_CONNS", 25),
@ -62,6 +67,7 @@ func LoadConfig() *Config {
PingCooldown: getEnvInt("PING_COOLDOWN_SECONDS", 5),
HsCooldown: getEnvInt("HS_COOLDOWN_SECONDS", 10),
MarkovCooldown: getEnvInt("MARKOV_COOLDOWN_SECONDS", 30),
MarkovAskCooldown: getEnvInt("MARKOV_ASK_COOLDOWN_SECONDS", 30),
HimbucksCooldown: getEnvInt("HIMBUCKS_COOLDOWN_SECONDS", 5),
HimboardCooldown: getEnvInt("HIMBOARD_COOLDOWN_SECONDS", 5),
SendbucksCooldown: getEnvInt("SENDBUCKS_COOLDOWN_SECONDS", 1800),