Babble / README.md
root
Add persona menu and memory controls
69d3ddc
metadata
title: Babble
emoji: 📊
colorFrom: gray
colorTo: pink
sdk: docker
app_port: 7860
app_file: app.py
pinned: false
short_description: Babble Telegram Bot

Babble

Telegram AI character bot backend demo.

Runtime

This Space runs as a Docker Space for FastAPI webhook reliability. The container starts:

uvicorn app:app --host 0.0.0.0 --port 7860

The Gradio landing demo is optional and mounted by the FastAPI app when Gradio is available. The Telegram webhook does not depend on Gradio.

Character Menu

Babble now ships with persona presets, a custom character builder, and per-session memory.

Telegram commands:

  • /menu shows the active persona and available presets
  • /persona <id> switches the current persona preset
  • /character key=value ... updates the current character profile
  • /reset clears the session memory and custom overrides
  • /start shows the current opening line

Character fields support name, age, gender, style, voice, mood, boundaries, and opening.

The bundled persona presets live in data/personas.json.

Deployment Checks

Health check:

curl https://thewheke-babble.hf.space/health

Expected response:

{"status":"ok","service":"babble"}

Set the Telegram webhook:

curl "https://api.telegram.org/bot<TELEGRAM_BOT_TOKEN>/setWebhook?url=https://thewheke-babble.hf.space/telegram/webhook/<WEBHOOK_SECRET>"

Check Telegram webhook status:

curl "https://api.telegram.org/bot<TELEGRAM_BOT_TOKEN>/getWebhookInfo"

Required Hugging Face Space secrets:

  • TELEGRAM_BOT_TOKEN
  • WEBHOOK_SECRET
  • LLM_PROVIDER=stub
  • LLM_API_KEY=stub

Optional debug endpoint:

  • /debug/config exists only when DEBUG=true.
  • It reports whether required settings are configured, but never returns secret values.

Useful environment variables:

  • PERSONA_ID
  • PERSONAS_PATH
  • MEMORY_ENABLED
  • MEMORY_PATH
  • MEMORY_MAX_TURNS