Refactor: Optimize DB performance, reduce repetitions, and add @-ping protection

- Optimized Markov chain storage: Switched from full rewrites to incremental DB updates.
- Improved AI creativity: Reduced repetitions using presence/frequency penalties and prompt tuning.
- Increased Markov randomness: Lowered order to 1 and enabled learning of special characters/emojis.
- Added @-ping protection: Automatically strips '@' symbols from AI and Markov responses.
- Enhanced robustness: Added startup token checks, directory auto-creation, and admin/bot-info caching.
This commit is contained in:
2026-05-14 13:35:45 +02:00
parent 9111d46a0e
commit cb70812739
5 changed files with 155 additions and 123 deletions

View File

@@ -60,7 +60,9 @@ export async function generateAIResponse(
model: config.model,
messages,
max_tokens: 500,
temperature: 0.7,
temperature: 0.8,
presence_penalty: 0.6,
frequency_penalty: 0.6,
}),
});