mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-24 02:36:41 +02:00
feat(telegram-chat-bot): implement AI chat bot with multi-model support
- Add NestJS service with Telegraf for Telegram bot - Implement commands: /models, /model, /new, /convos, /history, /clear - Create Chat API client for completions and conversations - Support multiple AI models (local Gemma + cloud via OpenRouter) - Sync conversations with Chat web/mobile app - Add message splitting for long responses - Include Dockerfile, CLAUDE.md, and setup script Commands: - Send text → AI responds - /models - List available models - /model [name] - Switch model (gemma, claude, gpt, etc.) - /new [title] - New conversation - /convos - List conversations - /history - Show recent messages - /clear - Clear context https://claude.ai/code/session_01LwmhvhKpEsvVtY1ZKhYu6f
This commit is contained in:
parent
be748d2f9c
commit
faadc413cc
23 changed files with 5398 additions and 0 deletions
35
services/telegram-chat-bot/Dockerfile
Normal file
35
services/telegram-chat-bot/Dockerfile
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
FROM node:20-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN corepack enable && corepack prepare pnpm@9.15.0 --activate
|
||||
|
||||
COPY package.json pnpm-lock.yaml* ./
|
||||
COPY services/telegram-chat-bot/package.json ./services/telegram-chat-bot/
|
||||
|
||||
RUN pnpm install --frozen-lockfile --filter @manacore/telegram-chat-bot
|
||||
|
||||
COPY services/telegram-chat-bot ./services/telegram-chat-bot
|
||||
|
||||
WORKDIR /app/services/telegram-chat-bot
|
||||
RUN pnpm build
|
||||
|
||||
FROM node:20-alpine AS runner
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN corepack enable && corepack prepare pnpm@9.15.0 --activate
|
||||
|
||||
COPY --from=builder /app/services/telegram-chat-bot/dist ./dist
|
||||
COPY --from=builder /app/services/telegram-chat-bot/package.json ./
|
||||
COPY --from=builder /app/services/telegram-chat-bot/node_modules ./node_modules
|
||||
|
||||
ENV NODE_ENV=production
|
||||
ENV PORT=3305
|
||||
|
||||
EXPOSE 3305
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||
CMD wget --no-verbose --tries=1 --spider http://localhost:3305/health || exit 1
|
||||
|
||||
CMD ["node", "dist/src/main.js"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue