import os from dotenv import load_dotenv load_dotenv() TELEGRAM_TOKEN: str = os.getenv("TELEGRAM_TOKEN", "") GOOGLE_API_KEY: str = os.getenv("GOOGLE_API_KEY", "") OWNER_ID: int = int(os.getenv("OWNER_ID", "0")) OWNER_USERNAME: str = os.getenv("OWNER_USERNAME", "").lstrip("@") DEFAULT_MODEL: str = os.getenv("AI_MODEL", "gemini-2.5-flash-lite") IMAGEN_MODEL: str = os.getenv("IMAGEN_MODEL", "imagen-4.0-fast-generate-001") DEFAULT_OR_MODEL: str = "openai/gpt-4o-mini" GOOGLE_AI_BASE_URL = "https://generativelanguage.googleapis.com/v1beta/openai/" OPENROUTER_BASE_URL = "https://openrouter.ai/api/v1" OPENROUTER_API_KEY: str = os.getenv("OPENROUTER_API_KEY", "") MAX_TOKENS_DEFAULT: int = 300 MAX_TOKENS_MIN: int = 50 MAX_TOKENS_MAX: int = 4000 MAX_HISTORY_MESSAGES: int = 20 # messages kept in memory MAX_API_CONTEXT: int = 10 # messages sent to API (saves input tokens) MAX_INPUT_TOKENS: int = 12000 # auto-reset chat history above this estimated input size IMAGE_DAILY_LIMIT: int = 10 AUTH_FILE = "authorized_users.json" SETTINGS_FILE = "settings.json" BOT_VERSION = "1.1.0" DEFAULT_SYSTEM_PROMPT = """You are Puppy (پاپی), a friendly and capable AI assistant on Telegram. LANGUAGE: Always reply in the same language as the user's message (Persian/Farsi or English). TOOLS: You have two tools available via the API: search_web (for real-time info: date, news, weather, prices, recent events) and image_search (when user wants to see images). NEVER output raw XML or JSON tool calls in your text — the API handles tool calls automatically. FORMATTING: Use Telegram markdown — **bold**, *italic*, `code`, ```code blocks```, ~~strikethrough~~, ||spoiler||. Be concise, warm, helpful, and occasionally playful with light dog references."""