mavis
|
c3aa0f0cb6
|
feat(search): 智能搜索建议 - 固化候选词表 (search_keywords + search_title_suggestions)
后端:
- alembic 0009: 两张固化表 + GIN prefix_keys 索引 + articles trigger
- /api/v1/search/suggestions: 混合 A(高频词 ts_stat) + B(真实标题) + 冷启动 fallback
- worker 每日 03:00 + 启动时刷新 search_keywords
- 顺便填 commit 11 TODO: articles.title_zh_tsv + GIN 索引(未来 FTS 基础)
前端:
- NInput -> NAutoComplete + debounce 250ms
- 选标题 -> 跳详情;选关键词 -> 填入 + 触发搜索
- AbortController 防 race condition
性能: prefix_keys @> ARRAY[prefix] 走 GIN 亚毫秒,100w 行也稳
|
2026-06-15 18:26:35 +08:00 |
|
xiaji
|
e274246056
|
feat(ingest): API Push 前端层 + 文档 + 端到端联通
后端(支持 api_push source 创建/调度):
- schemas/source.py:SourceIn.url 改成 str(允许 api_push 的 api-push:// 占位)
- admin.py create_source 简化 url 传递
- workers/__main__.py:_rebuild_jobs 跳过 api_push 源(它是被动接收,不抓取)
- workers/pipeline.py:run_once 也加同条件,api_push 不进抓取循环
前端:
- api/articles.ts:ArticleListItem 加 is_short_news(required)/source_ref;
ArticleDetail 加 external_id;导出 IngestTokenOut;adminApi 加
list/create/revoke ingest token 三个方法
- views/Feed.vue:卡片根 class 短新闻加 short-card(淡蓝底 #f6f9fc +
左侧 3px 蓝色色条 #4f9eff);元信息栏加 📰 短讯 角标;长新闻摘要
body_zh_text 截前 200 字,短新闻不截取保留换行(white-space: pre-wrap);
短新闻不显示 AI 插图
- views/ArticleDetail.vue:tag 行加 📰 短讯 + source_ref 角标;短新闻
路径下隐藏翻译状态/重译/原文链接按钮;正文区短新闻直接渲染
body_zh_text,跳过译文/原文/AI 配图卡片;Angel + 美团双评论卡片
都保留
- views/AdminSources.vue:kind 加 api_push 选项;api_push 源 URL 字段
变只读占位、隐藏抓取间隔;列表操作列加 🔑 Token 按钮;
弹窗支持生成(raw_token 一次性显示 + 复制)/列表/撤销
文档:
- docs/api-push.md:调用方契约 + 三层去重 + 限速 + lifecycle +
owner 操作手册 + curl/Python 示例 + 重试策略 + 故障排查
- README.md:关键特性加 API Push;API 概览加 /api/v1/ingest 和
3 个 /admin/.../ingest-tokens 端点
|
2026-06-14 16:15:21 +08:00 |
|
Mavis
|
8d73f4fb28
|
fix(llm+worker+deploy): 兼容老 prompt 模板 + 消除 startup_run 日志噪音
- enrichment: 新增 _safe_format (基于 _SafeDict),缺失占位符保留原样不抛 KeyError。
_enrich_format / _enrich_classify / _enrich_image / _enrich_commentary
全部走 _safe_format,数据库里老 prompt(不支持 {body})不再让整条 article 卡住。
复现: 388183 classify 一直 KeyError,enrichment_loop 反复重试它,316 篇全卡在 n/a。
- workers.__main__: startup_run 从 IntervalTrigger(minutes=0) 改成 DateTrigger
(只跑一次),消除 'maximum number of running instances reached' 刷屏 WARNING。
- deploy_pull: 改 _connect 自动识别 RSA / Ed25519 / ECDSA key(原硬编码 Ed25519Key)
|
2026-06-08 21:20:43 +08:00 |
|
Mavis
|
ba2298da0a
|
chore: 集成 LLM 增强 — config/main/articles schema/workers + .env.example 加 Agnes 配置
|
2026-06-08 14:24:23 +08:00 |
|
Mavis
|
9862a92423
|
perf: 翻译独立后台循环(1 篇/秒)+ Semaphore 1
之前 fetch_one_source 入库后立即调翻译(可能并发触发腾讯 TMT 限速)
改为独立 translation_loop 后台循环:
- 完全不和 RSS 抓取并行
- 1 篇/秒节拍(Semaphore 1 + sleep 1.0)
- 没活时空闲 5 秒再轮询
- pending/failed 都重试
|
2026-06-08 00:27:09 +08:00 |
|
Mavis
|
60b062daf2
|
feat: initial MVP - FastAPI backend + Vue3 frontend + docker-compose
- backend: FastAPI + SQLAlchemy 2.0(async) + asyncpg + Alembic
- 7 API routes: auth/me/articles/sources/bookmarks/subscriptions/admin
- models: User/Source/Article/Bookmark/Subscription/ApiToken
- services: RSS fetcher (feedparser) + Tencent TMT translator with quota + cache + local NLLB fallback
- workers: APScheduler + asyncio pipeline (fetch -> dedupe -> insert -> translate)
- seed scripts: create_user, seed_sources (5 RSS: Reuters/BBC/Al Jazeera/NHK/DW)
- frontend: Vue 3 + Vite + Naive UI + Pinia + vue-router
- pages: Login, Feed (24h), ArticleDetail, Sources, Bookmarks, AdminSources
- deploy: docker-compose (postgres/redis/api/worker/frontend/caddy)
- docs: README, DEPLOY, architecture, acceptance
|
2026-06-07 21:51:01 +08:00 |
|