Files
intl_news/configs/system.yaml
T
simon 9aa44e610d feat: LLM/Embedding 重试次数纳入 system.yaml 统一配置
- system.yaml: llm.max_retries(死配置) 改为 llm.max_attempts;embedding 段新增 max_attempts
- llm/client.py: LLMConfig 新增 max_attempts(默认 3 兜底),load_llm_config 读取配置
- llm/extractor.py: translate_and_extract(_async) max_attempts=None 时取 config.max_attempts
- embedding/client.py: load_embedding_config 读取 embedding.max_attempts
- scheduler/reporter.py: _call_llm_simple max_retries=None 时取 max_attempts-1
- 新增 2 个配置读取测试;已同步 pi5 验证
2026-08-05 08:48:43 +08:00

93 lines
4.3 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ════════════════════════════════════════════════════
# 系统功能配置(非敏感)
# 密钥、API 地址 请在 .env 中配置
# ════════════════════════════════════════════════════
# ── 部署拓扑 ────────────────────────────────────────
# 海外服务器已弃用(M1-M6 全链路在 domestic 执行)
servers:
overseas_host: "ecs-user@8.217.19.253"
overseas_path: "/opt/intlgrab"
domestic_host: "pi@192.168.1.160"
domestic_path: "/home/pi/intlnews"
# ── HTTP 代理(Privoxy → ss-local → Shadowsocks 海外访问)──
proxy:
enabled: false # 通过 Profile 8g_headful 启用
url: "http://127.0.0.1:3128" # HTTP 代理地址
bypass_domains: [] # 不走代理的域名(如国内 CDN
# ── 抓取 ────────────────────────────────────────────
crawler:
max_memory_mb: 1800 # 内存上限 MB(超限触发 GC
source_timeout_sec: 7200 # 单源超时秒数(2h
article_delay_sec: 3.0 # 文章间冷却间隔
page_timeout_sec: 45 # 单页加载超时
viewport_width: 1024
viewport_height: 768
user_agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
headful: false # true=有头浏览器(需 X Server 或 xvfb),false=headless
xvfb_display: ":99" # headful 模式下的虚拟显示器(xvfb-run 自动设置)
# ── 正文提取 ──────────────────────────────────────────
extractor:
min_content_words: 50
trafilatura_fallback: true
# ── 去重 ────────────────────────────────────────────
dedup:
hamming_distance_threshold: 3
simhash_window_days: 30
min_content_length: 100
# ── LLM 翻译+事件抽取 ────────────────────────────────
llm:
provider: "deepseek"
deepseek_model: "deepseek-v4-flash"
qwen_model: "qwen-plus"
timeout_sec: 60
max_attempts: 3 # 单篇总尝试次数(含首次),失败后指数退避重试;日报 AI 摘要同用此值
max_tokens: 8192
temperature: 0.1
concurrency: 3
# ── Embedding 向量化 ────────────────────────────────
embedding:
provider: "dashscope"
dashscope_model: "text-embedding-v3"
dimension: 1024
batch_size: 10
max_attempts: 3 # 单批总尝试次数(含首次),失败后指数退避重试
timeout_sec: 30
# ── Qdrant ──────────────────────────────────────────
qdrant:
collection: "en_finance_news"
# ── 日报 ────────────────────────────────────────────
report:
max_events: 20
summary_max_chars: 500
importance_threshold: 4
upload_host: "simon@doorcome.cn"
upload_path: "/var/www/html/echart/research"
# ── 同步 (rsync) ─────────────────────────────────────
# 海外服务器已弃用,以下保留作为参考
sync:
port: 22
sentinel: "/tmp/en_news_sync_done"
pack_dir: "/tmp"
# ── 定时调度 ────────────────────────────────────────
# 全流程:M1 抓取 → M2→M6 管道 → 日报
# 每天 06:00 / 12:00 / 18:00 / 22:00 各执行一次
schedule:
day_cutoff_hour: 6
times: ["06:00", "12:00", "18:00", "22:00"]
# ── 日志 ────────────────────────────────────────────
logging:
level: "INFO"
dir: "logs"