managarten/services/telegram-ollama-bot/src/config/configuration.ts
Till-JS 3f64c7422f feat(telegram-ollama-bot): add Telegram bot for local LLM inference via Ollama
- NestJS-based Telegram bot with nestjs-telegraf
- Ollama service for API communication with Gemma 3 4B
- Commands: /start, /help, /models, /model, /mode, /clear, /status
- Multiple modes: default, classify, summarize, translate, code
- Chat history with context (last 10 messages)
- User access control via TELEGRAM_ALLOWED_USERS
- Health endpoint for monitoring
- Updated MAC_MINI_SERVER.md with Ollama documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 15:43:41 +01:00

25 lines
1.1 KiB
TypeScript

export default () => ({
port: parseInt(process.env.PORT || '3301', 10),
telegram: {
token: process.env.TELEGRAM_BOT_TOKEN,
allowedUsers:
process.env.TELEGRAM_ALLOWED_USERS?.split(',').map((id) => parseInt(id, 10)) || [],
},
ollama: {
url: process.env.OLLAMA_URL || 'http://localhost:11434',
model: process.env.OLLAMA_MODEL || 'gemma3:4b',
timeout: parseInt(process.env.OLLAMA_TIMEOUT || '120000', 10),
},
});
export const SYSTEM_PROMPTS: Record<string, string> = {
default:
'Du bist ein hilfreicher Assistent. Antworte präzise und auf Deutsch, wenn der User Deutsch schreibt.',
classify:
'Du bist ein Klassifikations-Experte. Analysiere den gegebenen Text und ordne ihn einer passenden Kategorie zu. Antworte kurz und präzise.',
summarize:
'Du bist ein Zusammenfassungs-Experte. Fasse den gegebenen Text kurz und prägnant zusammen. Behalte die wichtigsten Informationen bei.',
translate:
'Du bist ein Übersetzer. Übersetze den Text in die gewünschte Sprache. Behalte den Ton und Stil bei.',
code: 'Du bist ein Programmier-Assistent. Hilf bei Code-Fragen, erkläre Konzepte und schlage Verbesserungen vor.',
};