fix(bot): business rules top-priority + card limit + escalate email-from-chat (c682408)
d26def1 verified | # βββ Core βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # SIMPLE deploy (recommended): SQLite on a persistent volume β no database to provision. | |
| DATABASE_URL=sqlite+aiosqlite:////app/data/bot.db | |
| # At scale, switch to Postgres + pgvector instead: | |
| # DATABASE_URL=postgresql+psycopg://user:pass@host:5432/chatbot | |
| TESTING=0 | |
| # βββ LLM: Groq (primary, free tier) βββββββββββββββββββββββββββββββββββββ | |
| # Create a key at https://console.groq.com (free, no card). Commercial OK, no training on data. | |
| GROQ_API_KEY= | |
| # Redundancy: add MORE keys (comma-separated) so the bot never fails β the router | |
| # tries each in order and fails over on rate-limit/error. e.g. k1,k2,k3 | |
| GROQ_API_KEYS= | |
| GROQ_BASE_URL=https://api.groq.com/openai/v1 | |
| # gpt-oss-120b is reliable for tool calling on Groq (Llama 3.3 70B isn't). | |
| MODEL_LARGE=openai/gpt-oss-120b | |
| MODEL_SMALL=llama-3.1-8b-instant | |
| # βββ LLM: Cloudflare Workers AI (automatic failover, free tier) βββββββββ | |
| # Account ID + API token (Workers AI) from the Cloudflare dashboard. Free 10k neurons/day, no training. | |
| CLOUDFLARE_ACCOUNT_ID= | |
| CLOUDFLARE_API_TOKEN= | |
| CF_MODEL_LARGE=@cf/meta/llama-3.3-70b-instruct-fp8-fast | |
| CF_MODEL_SMALL=@cf/meta/llama-3.1-8b-instruct | |
| # βββ LLM: Cerebras (3rd provider, free, very fast, no training) βββββββββ | |
| # Free API key at https://cloud.cerebras.ai (no card). Independent capacity. | |
| CEREBRAS_API_KEY= | |
| CEREBRAS_MODEL=gpt-oss-120b | |
| # Provider order (comma-separated). Default: groq first, cloudflare failover. | |
| LLM_PROVIDER_ORDER=groq,cloudflare | |
| # βββ Shopify βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # MULTI-TENANT: each store's Shopify creds are set PER TENANT in the admin panel | |
| # (stored encrypted), NOT here. These global vars are only used by the optional | |
| # single-tenant App Proxy path. Leave blank for the standard multi-tenant setup. | |
| SHOPIFY_SHOP= | |
| SHOPIFY_CLIENT_ID= | |
| SHOPIFY_CLIENT_SECRET= | |
| SHOPIFY_API_VERSION=2026-01 | |
| # App Proxy shared secret (the app's client secret is used to sign proxy requests). | |
| SHOPIFY_APP_PROXY_SECRET= | |
| # Orders older than 60 days need the protected read_all_orders scope (Shopify approval). Off by default. | |
| SHOPIFY_READ_ALL_ORDERS=0 | |
| # βββ Admin panel ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # Bearer token to access the admin API/UI (ours, super-admin). Long random string. | |
| ADMIN_TOKEN= | |
| # Key used to encrypt each tenant's Shopify secret at rest. CHANGE in production. | |
| SECRET_KEY=change-me-to-a-long-random-string | |
| # βββ Branding (runtime-overridable from the admin panel) ββββββββββββββββ | |
| BRAND_NAME=Asistente | |
| # βββ CORS for the public widget (simple mode). "*" or a comma list. βββββ | |
| ALLOWED_ORIGINS=* | |
| # βββ Embeddings (local, free; 384-dim multilingual via fastembed/ONNX) ββ | |
| EMBEDDING_MODEL=sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2 | |
| # βββ Verification / retention βββββββββββββββββββββββββββββββββββββββββββ | |
| ORDER_VERIFY_MAX_ATTEMPTS=5 | |
| ORDER_VERIFY_LOCKOUT_SECONDS=900 | |
| SESSION_RETENTION_DAYS=30 | |
| # βββ Human escalation (SMTP) ββββββββββββββββββββββββββββββββββββββββββββ | |
| SUPPORT_EMAIL=support@your-store.com | |
| SMTP_HOST= | |
| SMTP_PORT=587 | |
| SMTP_USER= | |
| SMTP_PASSWORD= | |
| SMTP_FROM=bot@your-store.com | |