feat: Web 控制面板支持主题词、订阅与 AI 配置管理(含推理强度) - #1207
Open
siliscar wants to merge 1 commit into
Open
Conversation
- 报告页工具栏新增「配置」弹窗,含三个标签页: - 主题词:编辑关注词全文,支持正则/别名/组名/必须词/排除词等全部语法,实时统计词组数 - 订阅管理:RSS 源增删改、启用开关、保留天数,含 URL/重复 id 校验与 id 自动生成 - AI 配置:API Key(脱敏回显、点「显示」可查看已存密钥)、模型、API 地址、推理强度 - 配置持久化到 output/.webui.json overlay,运行时覆盖文件配置 (优先级:面板 > 环境变量 > config.yaml),config 只读挂载亦可生效, 不改写 config.yaml / frequency_words.txt 原文件及其注释 - 新增 ai.reasoning_effort 推理强度:openai/ 前缀模型走 extra_body 原样透传(绕过 litellm 对自定义模型名的参数白名单校验), 其他提供商走顶层参数以保留 litellm 跨商映射;留空不发送 - 接通此前声明但未生效的 ai.extra_params(显式参数优先) - 爬虫输出带序号进度并 flush,供控制面板实时解析进度条 - Docker:manage.py/entrypoint 启动 web_control 控制面板(原为纯静态 http.server) - 单元测试覆盖 overlay 校验、HTTP API、参数拼装(48 用例)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
功能概述
为 Web 控制面板(报告页顶部工具栏)新增「⚙️ 配置」弹窗,支持在浏览器中管理三类核心配置,无需进容器改文件或重建镜像。
1. 主题词
frequency_words.txt等效全文,支持正则/.../、=> 别名、[组名]、+必须词、!排除词、@数量、[GLOBAL_FILTER]全部既有语法2. 订阅管理(RSS)
max_age_days)3. AI 配置
sk-***abcd;输入框为空时点「显示」可查看已保存密钥;留空保存表示保持不变)reasoning_effort(minimal / low / medium / high,留空不发送):openai/前缀模型(多为自定义兼容端点)通过extra_body原样透传,绕过 litellm 对自定义模型名的参数白名单校验(否则抛UnsupportedParamsError)实现说明
output/.webui.jsonoverlay,运行时覆盖文件配置。优先级:面板 > 环境变量 > config.yamlconfig.yaml/frequency_words.txt原文件及其注释;Docker 中config/只读挂载亦可生效(overlay 写入可写的output/卷)webui_settings.py原有的 schedule / ai_analysis 开关),扩展frequency_words、rss、ai三个键及校验flush=True,控制面板据此实时解析进度条manage.py/entrypoint.sh启动trendradar.web_control控制面板(替代原纯静态http.server),先起面板再执行 IMMEDIATE_RUN,避免首次抓取阻塞访问接口
/api/topics/api/feeds/api/ai?reveal=1返回明文密钥(供「显示」按钮)明文密钥仅在显式
reveal=1请求中返回,其余响应只含脱敏形式。测试
load_config正确应用、真实 AI 调用携带reasoning_effort=high成功返回