Files
AgentsMeeting/gateway/scripts/specs/article_processor.json
T

57 lines
3.1 KiB
JSON
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.
{
"module": "article_processor",
"version": "1.1",
"purpose": "文章抓取服务运行在 Windows (192.168.1.16:5810),负责抓取微信公众号全文链接并转换为纯文本,支持 OCR 图片识别。",
"ui_location": "Infrastructure tab → Platform → 文章抓取服务 (5810)",
"human_help": {
"title": "文章抓取服务 (:5810)",
"description": [
"这是整个系统的'阅读器'。当莫荷或小小莫需要阅读一个微信公众号文章链接时,由这个服务负责:",
"① 调用 wechat_fetcher.pyDrissionPage 版)用本地 Chrome + 持久微信 profile 渲染页面",
"② 等页面加载完成,提取全文转为 Markdown",
"③ 如果包含图片,调用 SenseNova 视觉 API 识别图片文字",
"④ 返回结构化内容给请求方",
"依赖微信 mp.weixin.qq.com 的读者登录态(持久 profile 中已保存),不用每次扫码。"
],
"usage": [
"监控状态:Infrastructure → Platform 下查看状态和最近抓取信息",
"如果 health_data 中有 error:表示最近一次抓取失败,查看 error 内容",
"点击服务旁的 § 查看 AI 接口详情"
],
"troubleshooting": [
"如果状态 stopped:检查 Windows 上 article_processor.py 进程",
"如果抓取失败返回 '等待登录超时'Chrome profile 的读者会话已过期,运行 wechat_fetcher.py --login 重新扫码",
"如果图片 OCR 失败:检查 SenseNova API key 是否有效",
"日志位置:gateway/logs/article_processor.log"
],
"related": "莫荷微信(依赖文章抓取服务处理微信中的链接)"
},
"ai_spec": {
"apis": [
{"method": "GET", "path": "/health", "returns": "{ok, service, port, ocr_model, status}", "desc": "服务状态 + OCR 模型信息"},
{"method": "GET", "path": "/logs?lines=N", "returns": "{ok, lines[]}", "desc": "最近 N 行日志"},
{"method": "POST", "path": "/process", "body": "{\"url\":\"...\"}", "returns": "{ok, title, content, images[]}", "desc": "抓取并处理文章(主端点)"}
],
"dependencies": [
"依赖本地 Chrome + 持久 profileDrissionPage 驱动)",
"依赖 mp.weixin.qq.com 读者登录态(持久 cookie",
"依赖 SenseNova 视觉 API 识别图片文字",
"依赖网络连通性访问微信公众号和服务端"
],
"constraints": [
"DrissionPage 驱动本地 Chrome(非无头,可见浏览器),微信会检测无头模式",
"Chrome profile 持久化在 wechat_fetcher 配置目录,会话过期需重新扫码",
"OCR 使用 SenseNovaWindows 自包含,不依赖小果/246",
"Linux 上访问此服务时需要 EasyTier VPN 连通"
],
"related_files": [
"projects/self-growing-knowledge/scripts/article_processor.py — HTTP 服务端",
"projects/self-growing-knowledge/scripts/wechat_fetcher.py — DrissionPage 实际抓取",
"gateway/scripts/templates/dashboard.html — fI() 状态展示",
"gateway/scripts/specs/article_processor.json — 本 spec 文件"
]
}
}