Files
hack/tools/scripts/llm-key-hunter/results/_cache/content/chenyuheee_chinese-car-watch.json
T

1 line
17 KiB
JSON

{"repo": "chenyuheee/chinese-car-watch", "files": {"docker-compose.yml": {"a36c98fa78f12e87cde68c0c5a47c6d8f29d2900": {"t": 1785745260.2353227, "n": 452, "h": "faed1f990012ad27", "c": "services:\n web:\n build: .\n container_name: autoinsight\n ports:\n - \"127.0.0.1:8081:8000\"\n volumes:\n - ./data:/app/data # persist SQLite\n - ./.env:/app/.env:ro # API keys\n restart: unless-stopped\n environment:\n - DEEPSEEK_API_KEY=${DEEPSEEK_API_KEY}\n healthcheck:\n test: [\"CMD\", \"curl\", \"-f\", \"http://localhost:8000/auto/api/health\"]\n interval: 60s\n timeout: 10s\n retries: 3\n"}, "09f9ee065d788ae2b46a026e81a315b646f8dd25": {"t": 1785749351.2791045, "n": 452, "h": "faed1f990012ad27", "c": "services:\n web:\n build: .\n container_name: autoinsight\n ports:\n - \"127.0.0.1:8081:8000\"\n volumes:\n - ./data:/app/data # persist SQLite\n - ./.env:/app/.env:ro # API keys\n restart: unless-stopped\n environment:\n - DEEPSEEK_API_KEY=${DEEPSEEK_API_KEY}\n healthcheck:\n test: [\"CMD\", \"curl\", \"-f\", \"http://localhost:8000/auto/api/health\"]\n interval: 60s\n timeout: 10s\n retries: 3\n"}, "4ae71666080ce01aa594bab04bfd70c391da78c3": {"t": 1785749352.352575, "n": 442, "h": "cf7965d368946bc5", "c": "services:\n web:\n build: .\n container_name: autoinsight\n ports:\n - \"8081:8000\"\n volumes:\n - ./data:/app/data # persist SQLite\n - ./.env:/app/.env:ro # API keys\n restart: unless-stopped\n environment:\n - DEEPSEEK_API_KEY=${DEEPSEEK_API_KEY}\n healthcheck:\n test: [\"CMD\", \"curl\", \"-f\", \"http://localhost:8000/auto/api/health\"]\n interval: 60s\n timeout: 10s\n retries: 3\n"}}, "deploy/setup.sh": {"a36c98fa78f12e87cde68c0c5a47c6d8f29d2900": {"t": 1785745948.7566524, "n": 1420, "h": "781321919d4b82e5", "c": "#!/bin/bash\n# AutoInsight server setup script\n# Run on server: bash deploy/setup.sh\nset -e\n\nTARGET=/var/www/insight/auto\nREPO=git@github.com:ChenyuHeee/chinese-car-watch.git\n\necho \"=== AutoInsight Setup ===\"\necho \"Target: $TARGET\"\n\n# 1. Clone or update repo\nif [ -d \"$TARGET/.git\" ]; then\n echo \"→ Updating existing repo...\"\n cd \"$TARGET\" && git pull\nelse\n echo \"→ Cloning repo...\"\n mkdir -p \"$(dirname \"$TARGET\")\"\n git clone \"$REPO\" \"$TARGET\"\nfi\n\ncd \"$TARGET\"\n\n# 2. Create .env if missing\nif [ ! -f .env ]; then\n echo \"→ Creating .env (please fill in DEEPSEEK_API_KEY)...\"\n cat > .env << 'EOF'\n# DeepSeek API key (get from https://platform.deepseek.com/api_keys)\nDEEPSEEK_API_KEY=your_key_here\n\n# Proxy (if needed in mainland China)\n# HTTPS_PROXY=http://127.0.0.1:7890\n# HTTP_PROXY=http://127.0.0.1:7890\nEOF\n echo \"⚠️ Edit $TARGET/.env with your actual API key!\"\nfi\n\n# 3. Build and start\necho \"→ Building Docker image...\"\ndocker compose build\n\necho \"→ Starting services...\"\ndocker compose up -d\n\n# 4. Verify\nsleep 3\necho \"→ Health check...\"\ncurl -s http://localhost:8081/auto/api/health || echo \"⚠️ Health check failed\"\n\necho \"\"\necho \"=== Setup complete ===\"\necho \"Dashboard: http://localhost:8081/auto\"\necho \"\"\necho \"Next steps:\"\necho \" 1. Edit .env with your DEEPSEEK_API_KEY\"\necho \" 2. Configure nginx to proxy /auto to localhost:8081\"\necho \" 3. Set up cron: crontab deploy/crontab.txt\"\n"}, "4ae71666080ce01aa594bab04bfd70c391da78c3": {"t": 1785749351.5666919, "n": 1420, "h": "781321919d4b82e5", "c": "#!/bin/bash\n# AutoInsight server setup script\n# Run on server: bash deploy/setup.sh\nset -e\n\nTARGET=/var/www/insight/auto\nREPO=git@github.com:ChenyuHeee/chinese-car-watch.git\n\necho \"=== AutoInsight Setup ===\"\necho \"Target: $TARGET\"\n\n# 1. Clone or update repo\nif [ -d \"$TARGET/.git\" ]; then\n echo \"→ Updating existing repo...\"\n cd \"$TARGET\" && git pull\nelse\n echo \"→ Cloning repo...\"\n mkdir -p \"$(dirname \"$TARGET\")\"\n git clone \"$REPO\" \"$TARGET\"\nfi\n\ncd \"$TARGET\"\n\n# 2. Create .env if missing\nif [ ! -f .env ]; then\n echo \"→ Creating .env (please fill in DEEPSEEK_API_KEY)...\"\n cat > .env << 'EOF'\n# DeepSeek API key (get from https://platform.deepseek.com/api_keys)\nDEEPSEEK_API_KEY=your_key_here\n\n# Proxy (if needed in mainland China)\n# HTTPS_PROXY=http://127.0.0.1:7890\n# HTTP_PROXY=http://127.0.0.1:7890\nEOF\n echo \"⚠️ Edit $TARGET/.env with your actual API key!\"\nfi\n\n# 3. Build and start\necho \"→ Building Docker image...\"\ndocker compose build\n\necho \"→ Starting services...\"\ndocker compose up -d\n\n# 4. Verify\nsleep 3\necho \"→ Health check...\"\ncurl -s http://localhost:8081/auto/api/health || echo \"⚠️ Health check failed\"\n\necho \"\"\necho \"=== Setup complete ===\"\necho \"Dashboard: http://localhost:8081/auto\"\necho \"\"\necho \"Next steps:\"\necho \" 1. Edit .env with your DEEPSEEK_API_KEY\"\necho \" 2. Configure nginx to proxy /auto to localhost:8081\"\necho \" 3. Set up cron: crontab deploy/crontab.txt\"\n"}}, "agents/config.py": {"a36c98fa78f12e87cde68c0c5a47c6d8f29d2900": {"t": 1785746867.0922844, "n": 3253, "h": "f9ab563e9224baa7", "c": "\"\"\"\nAG2 configuration with DeepSeek provider.\n\"\"\"\n\nimport logging\nimport os\nfrom pathlib import Path\n\nfrom dotenv import load_dotenv\n\nload_dotenv() # Load .env file if present\n\nlog = logging.getLogger(__name__)\n\n# ── DeepSeek API setup ──────────────────────────────────\nDEEPSEEK_API_KEY = os.environ.get(\"DEEPSEEK_API_KEY\", \"\")\nDEEPSEEK_BASE_URL = \"https://api.deepseek.com\"\n\nif not DEEPSEEK_API_KEY:\n log.warning(\"DEEPSEEK_API_KEY not set — agent calls will fail\")\n log.warning(\"Set it via: export DEEPSEEK_API_KEY=sk-... or create a .env file\")\n\n# Model mapping for different agent roles\n# deepseek-v4-pro: flagship model with thinking (for Analyst, Critic, Orchestrator)\n# deepseek-v4-flash: fast model with thinking (for Investigator, Writer)\nMODEL_CONFIG = {\n \"orchestrator\": {\n \"model\": \"deepseek-v4-pro\",\n \"api_key\": DEEPSEEK_API_KEY,\n \"base_url\": DEEPSEEK_BASE_URL,\n \"temperature\": 0.3,\n \"max_tokens\": 32768,\n \"extra_body\": {\"thinking\": {\"type\": \"enabled\"}},\n },\n \"analyst\": {\n \"model\": \"deepseek-v4-pro\",\n \"api_key\": DEEPSEEK_API_KEY,\n \"base_url\": DEEPSEEK_BASE_URL,\n \"temperature\": 0.3,\n \"max_tokens\": 32768,\n \"extra_body\": {\"thinking\": {\"type\": \"enabled\"}},\n },\n \"critic\": {\n \"model\": \"deepseek-v4-pro\",\n \"api_key\": DEEPSEEK_API_KEY,\n \"base_url\": DEEPSEEK_BASE_URL,\n \"temperature\": 0.2,\n \"max_tokens\": 16384,\n \"extra_body\": {\"thinking\": {\"type\": \"enabled\"}},\n },\n \"investigator\": {\n \"model\": \"deepseek-v4-flash\",\n \"api_key\": DEEPSEEK_API_KEY,\n \"base_url\": DEEPSEEK_BASE_URL,\n \"temperature\": 0.7,\n \"max_tokens\": 16384,\n \"extra_body\": {\"thinking\": {\"type\": \"enabled\"}},\n },\n \"writer\": {\n \"model\": \"deepseek-v4-flash\",\n \"api_key\": DEEPSEEK_API_KEY,\n \"base_url\": DEEPSEEK_BASE_URL,\n \"temperature\": 0.5,\n \"max_tokens\": 16384,\n },\n}\n\n# Paths\nPROJECT_ROOT = Path(__file__).resolve().parent.parent\nPROMPTS_DIR = Path(__file__).resolve().parent / \"prompts\"\n\n\ndef load_prompt(name: str) -> str:\n \"\"\"Load a system prompt from agents/prompts/{name}.md\"\"\"\n path = PROMPTS_DIR / f\"{name}.md\"\n if path.exists():\n return path.read_text(encoding=\"utf-8\")\n return \"\"\n\n\ndef make_agent(\n name: str,\n role: str,\n system_prompt: str = \"\",\n tools: list = None,\n) -> \"ConversableAgent\":\n \"\"\"Create an AG2 ConversableAgent with the given role config.\"\"\"\n from autogen import ConversableAgent\n\n cfg = MODEL_CONFIG.get(role, MODEL_CONFIG[\"investigator\"])\n llm_config = {\n \"config_list\": [\n {\n \"model\": cfg[\"model\"],\n \"api_key\": cfg[\"api_key\"],\n \"base_url\": cfg[\"base_url\"],\n \"api_type\": \"openai\",\n }\n ],\n \"temperature\": cfg[\"temperature\"],\n \"max_tokens\": cfg[\"max_tokens\"],\n }\n if \"extra_body\" in cfg:\n llm_config[\"config_list\"][0][\"extra_body\"] = cfg[\"extra_body\"]\n\n return ConversableAgent(\n name=name,\n system_message=system_prompt,\n llm_config=llm_config,\n human_input_mode=\"NEVER\",\n max_consecutive_auto_reply=8,\n )\n"}, "09f9ee065d788ae2b46a026e81a315b646f8dd25": {"t": 1785749351.909887, "n": 3253, "h": "f9ab563e9224baa7", "c": "\"\"\"\nAG2 configuration with DeepSeek provider.\n\"\"\"\n\nimport logging\nimport os\nfrom pathlib import Path\n\nfrom dotenv import load_dotenv\n\nload_dotenv() # Load .env file if present\n\nlog = logging.getLogger(__name__)\n\n# ── DeepSeek API setup ──────────────────────────────────\nDEEPSEEK_API_KEY = os.environ.get(\"DEEPSEEK_API_KEY\", \"\")\nDEEPSEEK_BASE_URL = \"https://api.deepseek.com\"\n\nif not DEEPSEEK_API_KEY:\n log.warning(\"DEEPSEEK_API_KEY not set — agent calls will fail\")\n log.warning(\"Set it via: export DEEPSEEK_API_KEY=sk-... or create a .env file\")\n\n# Model mapping for different agent roles\n# deepseek-v4-pro: flagship model with thinking (for Analyst, Critic, Orchestrator)\n# deepseek-v4-flash: fast model with thinking (for Investigator, Writer)\nMODEL_CONFIG = {\n \"orchestrator\": {\n \"model\": \"deepseek-v4-pro\",\n \"api_key\": DEEPSEEK_API_KEY,\n \"base_url\": DEEPSEEK_BASE_URL,\n \"temperature\": 0.3,\n \"max_tokens\": 32768,\n \"extra_body\": {\"thinking\": {\"type\": \"enabled\"}},\n },\n \"analyst\": {\n \"model\": \"deepseek-v4-pro\",\n \"api_key\": DEEPSEEK_API_KEY,\n \"base_url\": DEEPSEEK_BASE_URL,\n \"temperature\": 0.3,\n \"max_tokens\": 32768,\n \"extra_body\": {\"thinking\": {\"type\": \"enabled\"}},\n },\n \"critic\": {\n \"model\": \"deepseek-v4-pro\",\n \"api_key\": DEEPSEEK_API_KEY,\n \"base_url\": DEEPSEEK_BASE_URL,\n \"temperature\": 0.2,\n \"max_tokens\": 16384,\n \"extra_body\": {\"thinking\": {\"type\": \"enabled\"}},\n },\n \"investigator\": {\n \"model\": \"deepseek-v4-flash\",\n \"api_key\": DEEPSEEK_API_KEY,\n \"base_url\": DEEPSEEK_BASE_URL,\n \"temperature\": 0.7,\n \"max_tokens\": 16384,\n \"extra_body\": {\"thinking\": {\"type\": \"enabled\"}},\n },\n \"writer\": {\n \"model\": \"deepseek-v4-flash\",\n \"api_key\": DEEPSEEK_API_KEY,\n \"base_url\": DEEPSEEK_BASE_URL,\n \"temperature\": 0.5,\n \"max_tokens\": 16384,\n },\n}\n\n# Paths\nPROJECT_ROOT = Path(__file__).resolve().parent.parent\nPROMPTS_DIR = Path(__file__).resolve().parent / \"prompts\"\n\n\ndef load_prompt(name: str) -> str:\n \"\"\"Load a system prompt from agents/prompts/{name}.md\"\"\"\n path = PROMPTS_DIR / f\"{name}.md\"\n if path.exists():\n return path.read_text(encoding=\"utf-8\")\n return \"\"\n\n\ndef make_agent(\n name: str,\n role: str,\n system_prompt: str = \"\",\n tools: list = None,\n) -> \"ConversableAgent\":\n \"\"\"Create an AG2 ConversableAgent with the given role config.\"\"\"\n from autogen import ConversableAgent\n\n cfg = MODEL_CONFIG.get(role, MODEL_CONFIG[\"investigator\"])\n llm_config = {\n \"config_list\": [\n {\n \"model\": cfg[\"model\"],\n \"api_key\": cfg[\"api_key\"],\n \"base_url\": cfg[\"base_url\"],\n \"api_type\": \"openai\",\n }\n ],\n \"temperature\": cfg[\"temperature\"],\n \"max_tokens\": cfg[\"max_tokens\"],\n }\n if \"extra_body\" in cfg:\n llm_config[\"config_list\"][0][\"extra_body\"] = cfg[\"extra_body\"]\n\n return ConversableAgent(\n name=name,\n system_message=system_prompt,\n llm_config=llm_config,\n human_input_mode=\"NEVER\",\n max_consecutive_auto_reply=8,\n )\n"}, "4ae71666080ce01aa594bab04bfd70c391da78c3": {"t": 1785749352.988025, "n": 4483, "h": "edfc6c623368dba4", "c": "\"\"\"\nAG2 configuration with DeepSeek provider.\nAll agent products import from here.\n\"\"\"\n\nimport os\nfrom pathlib import Path\n\nfrom autogen import ConversableAgent, GroupChat, GroupChatManager\n\n# ── DeepSeek API setup ──────────────────────────────────\nDEEPSEEK_API_KEY = os.environ.get(\"DEEPSEEK_API_KEY\", \"\")\nDEEPSEEK_BASE_URL = \"https://api.deepseek.com\"\n\n# Model mapping for different agent roles\nMODEL_CONFIG = {\n \"orchestrator\": {\n \"model\": \"deepseek-v4-pro\",\n \"api_key\": DEEPSEEK_API_KEY,\n \"base_url\": DEEPSEEK_BASE_URL,\n \"temperature\": 0.3,\n \"max_tokens\": 32768,\n \"extra_body\": {\"thinking\": {\"type\": \"enabled\"}, \"reasoning_effort\": \"high\"},\n },\n \"analyst\": {\n \"model\": \"deepseek-v4-pro\",\n \"api_key\": DEEPSEEK_API_KEY,\n \"base_url\": DEEPSEEK_BASE_URL,\n \"temperature\": 0.3,\n \"max_tokens\": 32768,\n \"extra_body\": {\"thinking\": {\"type\": \"enabled\"}, \"reasoning_effort\": \"high\"},\n },\n \"critic\": {\n \"model\": \"deepseek-v4-pro\",\n \"api_key\": DEEPSEEK_API_KEY,\n \"base_url\": DEEPSEEK_BASE_URL,\n \"temperature\": 0.2,\n \"max_tokens\": 16384,\n \"extra_body\": {\"thinking\": {\"type\": \"enabled\"}, \"reasoning_effort\": \"high\"},\n },\n \"investigator\": {\n \"model\": \"deepseek-v4-flash\",\n \"api_key\": DEEPSEEK_API_KEY,\n \"base_url\": DEEPSEEK_BASE_URL,\n \"temperature\": 0.7,\n \"max_tokens\": 16384,\n \"extra_body\": {\"thinking\": {\"type\": \"enabled\"}},\n },\n \"writer\": {\n \"model\": \"deepseek-v4-flash\",\n \"api_key\": DEEPSEEK_API_KEY,\n \"base_url\": DEEPSEEK_BASE_URL,\n \"temperature\": 0.5,\n \"max_tokens\": 16384,\n },\n}\n\n# Paths\nPROJECT_ROOT = Path(__file__).resolve().parent.parent\nPROMPTS_DIR = Path(__file__).resolve().parent / \"prompts\"\n\n# LLM config list for AG2 — compatible with OpenAI client\nLLM_CONFIG_LIST = [\n {\n \"model\": cfg[\"model\"],\n \"api_key\": cfg[\"api_key\"],\n \"base_url\": cfg[\"base_url\"],\n \"api_type\": \"openai\", # DeepSeek is OpenAI-compatible\n }\n for cfg in MODEL_CONFIG.values()\n]\n\n\ndef load_prompt(name: str) -> str:\n \"\"\"Load a system prompt from agents/prompts/{name}.md\"\"\"\n path = PROMPTS_DIR / f\"{name}.md\"\n if path.exists():\n return path.read_text(encoding=\"utf-8\")\n return \"\"\n\n\ndef make_agent(\n name: str,\n role: str,\n system_prompt: str = \"\",\n tools: list = None,\n) -> ConversableAgent:\n \"\"\"Create an AG2 ConversableAgent with the given role config.\n\n Args:\n name: unique agent name (e.g. 'analyst_1')\n role: one of 'orchestrator', 'analyst', 'critic', 'investigator', 'writer'\n system_prompt: agent instructions\n tools: list of callable tools\n \"\"\"\n cfg = MODEL_CONFIG.get(role, MODEL_CONFIG[\"investigator\"])\n llm_config = {\n \"config_list\": [\n {\n \"model\": cfg[\"model\"],\n \"api_key\": cfg[\"api_key\"],\n \"base_url\": cfg[\"base_url\"],\n \"api_type\": \"openai\",\n }\n ],\n \"temperature\": cfg[\"temperature\"],\n \"max_tokens\": cfg[\"max_tokens\"],\n }\n # Pass DeepSeek thinking params via extra_body if available\n if \"extra_body\" in cfg:\n llm_config[\"config_list\"][0][\"extra_body\"] = cfg[\"extra_body\"]\n\n return ConversableAgent(\n name=name,\n system_message=system_prompt,\n llm_config=llm_config,\n human_input_mode=\"NEVER\",\n max_consecutive_auto_reply=8,\n )\n\n\ndef make_group_chat(\n agents: list[ConversableAgent],\n speaker_selection_method: str = \"auto\",\n max_round: int = 20,\n) -> tuple[GroupChat, GroupChatManager]:\n \"\"\"Create an AG2 GroupChat with the given agents.\"\"\"\n group_chat = GroupChat(\n agents=agents,\n messages=[],\n max_round=max_round,\n speaker_selection_method=speaker_selection_method,\n )\n manager = GroupChatManager(\n groupchat=group_chat,\n llm_config={\n \"config_list\": [\n {\n \"model\": MODEL_CONFIG[\"orchestrator\"][\"model\"],\n \"api_key\": MODEL_CONFIG[\"orchestrator\"][\"api_key\"],\n \"base_url\": MODEL_CONFIG[\"orchestrator\"][\"base_url\"],\n \"api_type\": \"openai\",\n }\n ],\n \"temperature\": 0.3,\n \"max_tokens\": 4096,\n },\n human_input_mode=\"NEVER\",\n )\n return group_chat, manager\n"}}}}