Aimpress_site/chatbot-api/config.py
Vadym Samoilenko 73b1a0feda Add AI chatbot: FastAPI backend + React chat widget
- Python FastAPI backend (chatbot-api/) with Claude Sonnet 4.6, prompt injection
  protection, rate limiting (30 msg/session), off-topic filtering, Redis session storage
- Rocket.Chat integration for live monitoring and human takeover
- Lead capture via n8n webhook
- React chat widget: floating bubble, auto-greeting after 30s, glassmorphism chat
  window, mobile responsive, lazy loaded, Mixpanel analytics
- Nginx proxy /api/chat → chatbot-api:8000
- Docker: chatbot-api + Redis services added to docker-compose

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 17:14:07 +00:00

21 lines
666 B
Python

from pydantic_settings import BaseSettings
class Settings(BaseSettings):
anthropic_api_key: str = ""
redis_url: str = "redis://chatbot-redis:6379"
rocketchat_url: str = "https://chat.ai-impress.com"
rocketchat_auth_token: str = ""
rocketchat_user_id: str = ""
n8n_webhook_url: str = "https://n8n.ai-impress.com/webhook"
max_messages_per_session: int = 30
max_message_length: int = 500
conversation_window: int = 15
max_response_tokens: int = 300
conversation_ttl: int = 86400 # 24 hours
model: str = "claude-sonnet-4-6-20250514"
model_config = {"env_file": ".env"}
settings = Settings()