managarten/services/telegram-ollama-bot/src/health.controller.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

21 lines
532 B
TypeScript

import { Controller, Get } from '@nestjs/common';
import { OllamaService } from './ollama/ollama.service';
@Controller()
export class HealthController {
constructor(private readonly ollamaService: OllamaService) {}
@Get('health')
async health() {
const ollamaConnected = await this.ollamaService.checkConnection();
return {
status: ollamaConnected ? 'ok' : 'degraded',
timestamp: new Date().toISOString(),
ollama: {
connected: ollamaConnected,
model: this.ollamaService.getDefaultModel(),
},
};
}
}