Spaces:
Running on Zero
Running on Zero
|
Download README.md from Catalna/ginchiee-bot: direct link, hf CLI and curl.
- Browser
- Download file 4.64 kB
-
https://huggingface.co/spaces/Catalna/ginchiee-bot/resolve/main/README.md
- Command line
-
hf download hf://spaces/Catalna/ginchiee-bot/README.md
-
curl -L -o README.md https://huggingface.co/spaces/Catalna/ginchiee-bot/resolve/main/README.md
4.64 kB
A newer version of the Gradio SDK is available: 6.32.0
metadata
title: Ginchiee Bot
emoji: πΈ
colorFrom: pink
colorTo: purple
sdk: gradio
app_file: app.py
app_port: 7860
pinned: false
π Ginchiee β AI Diet Companion Bot
Bot Telegram yang membantu kamu menjaga pola makan melalui reminder cerdas, food logging, estimasi nutrisi, dan percakapan natural dengan AI.
β¨ Fitur MVP
- π€ AI Conversation β Ngobrol natural tentang diet & pola makan
- π Food Logging β Catat makanan dengan bahasa natural
- π Nutrition Tracking β Hitung kalori, protein, karbs, lemak otomatis
- β° Intelligent Reminder β Reminder makan yang personal & kontekstual
- π€ User Profile β Setup profil & target nutrisi personal
- π― Daily Progress β Pantau progress nutrisi harian
π Quick Start
1. Clone & Setup
git clone <repo>
cd ginchiee-bot
python -m venv .venv
.venv\Scripts\activate # Windows
# source .venv/bin/activate # Linux/Mac
pip install -r requirements.txt
2. Konfigurasi
cp .env.example .env
Edit .env:
TELEGRAM_BOT_TOKEN=your_bot_token_here
GEMINI_API_KEY=your_gemini_api_key_here
Cara dapat token:
- Telegram Bot Token: Chat @BotFather di Telegram β
/newbot - Gemini API Key: https://aistudio.google.com/app/apikey
3. Jalankan
python main.py
π Commands
| Command | Fungsi |
|---|---|
/start |
Mulai & setup profil |
/profile |
Lihat profil & target nutrisi |
/today |
Progress nutrisi hari ini |
/log [makanan] |
Catat makanan |
/schedule |
Atur jadwal makan & reminder |
/reminders |
Lihat jadwal makan |
/help |
Bantuan |
ποΈ Struktur Project
ginchiee-bot/
βββ main.py # Entry point
βββ config/
β βββ settings.py # Konfigurasi (fail-fast)
βββ database/
β βββ connection.py # PostgreSQL pool (asyncpg)
β βββ migrations.py # Migrasi berversi
β βββ migrations/ # 0001_initial.sql, 0002_...
βββ nutrition/
β βββ calculator.py # BMR/TDEE/macro calculator
β βββ food_database.py # Database nutrisi makanan
β βββ parser.py # NLP food parser
βββ services/
β βββ ai_service.py # Gemini LLM abstraction
β βββ personality.py # Persona, few-shot, sanitizer
β βββ intent_service.py # Router intent (1 call/pesan)
β βββ nutrition_service.py # Food logging, koreksi & hapus
β βββ reminder_service.py # Reminder generation
β βββ scheduler_service.py # APScheduler
β βββ user_service.py # User CRUD
βββ scripts/
β βββ migrate_sqlite_to_postgres.py
βββ bot/
β βββ conversations/
β β βββ onboarding.py # Multi-step registration
β βββ handlers/
β βββ activity_handler.py
β βββ food_handler.py
β βββ help_handler.py
β βββ message_handler.py # Router + konfirmasi
β βββ photo_handler.py
β βββ profile_handler.py
β βββ schedule_handler.py
β βββ today_handler.py
βββ tests/
βββ test_database.py # Migrasi, wrapper, SQL nyata
βββ test_personality.py # Sanitizer & gaya bicara
βββ test_intent_router.py # Parser intent
βββ test_huggingface_runtime.py
π§ Stack
- Python 3.11+
- python-telegram-bot β Telegram handler
- Google Gemini β LLM (persona + JSON-mode router)
- PostgreSQL + asyncpg β Database (Neon / Supabase / lokal)
- APScheduler β Meal & activity reminder scheduler
- Migrasi berversi β
database/migrations/NNN_*.sql, idempotent per boot
βοΈ Konfigurasi
| Env | Wajib | Isi |
|---|---|---|
TELEGRAM_BOT_TOKEN |
β | Token dari @BotFather |
GEMINI_API_KEY |
β | API key Google AI Studio |
DATABASE_URL |
β | Connection string Postgres |
ALLOWED_USER_IDS |
β | Batasi bot ke user id tertentu (koma) |
AI_TEMPERATURE |
β | Default 0.95 |
GEMINI_MODEL |
β | Default gemini-flash-lite-latest |
Di Hugging Face, set variabel ini di Settings β Variables and secrets, bukan
memakai file .env.
β οΈ Disclaimer
Ginchiee adalah AI companion, bukan dokter atau ahli gizi. Semua estimasi nutrisi bersifat perkiraan. Konsultasikan ke profesional kesehatan untuk saran medis.