"""Constants for mcp-webscout."""
import os
# User Agent strings
DEFAULT_USER_AGENT_AUTONOMOUS = (
"ModelContextProtocol/1.0 (Autonomous; +https://github.com/modelcontextprotocol/servers)"
)
DEFAULT_USER_AGENT_MANUAL = (
"ModelContextProtocol/1.0 (User-Specified; +https://github.com/modelcontextprotocol/servers)"
)
# Default limits
DEFAULT_MAX_LENGTH = int(os.environ.get("DEFAULT_MAX_LENGTH", "5000"))
CHUNK_SIZE = int(os.environ.get("CHUNK_SIZE", "5000"))
# Proxy configuration
PROXY_URL = os.environ.get("PROXY_URL", "http://127.0.0.1:7890")
USE_PROXY = os.environ.get("USE_PROXY", "true").lower() == "true"
# DeepSeek API configuration
DEEPSEEK_API_BASE = os.environ.get("DEEPSEEK_API_BASE", "https://api.deepseek.com/v1")
DEEPSEEK_DEFAULT_MODEL = os.environ.get("DEEPSEEK_DEFAULT_MODEL", "deepseek-chat")
DEEPSEEK_DEFAULT_PROMPT = os.environ.get(
"DEEPSEEK_DEFAULT_PROMPT",
"提取网页的关键信息,包括标题、主要内容、关键数据点和总结"
)
# DeepSeek API Key - MUST be set via environment variable
# IMPORTANT: Never hardcode your API key in this file or commit it to version control!
# 1. Copy .env.example to .env
# 2. Add your API key to the .env file: DEEPSEEK_API_KEY=sk-your-key-here
# 3. The .env file is in .gitignore and will not be committed
DEEPSEEK_API_KEY = os.environ.get("DEEPSEEK_API_KEY", "")
# Warning if API key is not set
if not DEEPSEEK_API_KEY:
import warnings
warnings.warn(
"DEEPSEEK_API_KEY is not set. LLM extraction mode will not work. "
"Please copy .env.example to .env and add your API key.",
UserWarning,
stacklevel=2,
)