通用配置
字数
805 字
阅读时间
4 分钟
WebUI「通用配置」各段通过统一 REST 暴露;段定义在 pallas/console/webui/env_sections.py。侧栏 AI 配置(Provider / 媒体连接)另有专用页面与接口,不全部落在下列 section_id 里。
| 方法 | 路径 | 写 | 说明 |
|---|---|---|---|
| GET | /common-config/sections | 段元数据列表(id、标题、说明) | |
| GET | /common-config/{section_id} | 段内字段与当前值 | |
| PUT | /common-config/{section_id} | 是 | Body {"values": {...}} |
| POST | /common-config/service_gateways/connectivity-check | 是 | 服务网关草稿连通性探测 |
| GET | /common-config/llm/runtime-overview | 聚合 AI health、模型、任务统计、conversation kernel |
常见 section_id
| ID | 用途 |
|---|---|
cmd_perm | 命令权限 |
control_plane | 联邦控制 |
corpus_federation | 语料联邦 |
ingress_fanout | 入站全员同响命令 |
ingress_dispatch | 入站调度运行时 |
repeater_learn | 复读后台学习 |
message_scrub | 消息审查 |
service_gateways | 画画 / MAA / 点歌等网关 URL |
pallas_webui / pallas_protocol / help | 对应插件控制台子集 |
在线统计已迁至插件页 pb_stats(旧段 ID community_stats 在前端会重定向)。见 在线统计与社区主站。
PUT 落盘 webui.json;各段 apply_webui_env_section_patch 内触发对应 reload(如 cmd_perm 清缓存、message_scrub 热读)。
service_gateways/connectivity-check 返回要点
该接口返回:
lines: 面向文本展示的探测摘要results: 结构化探测结果数组
其中 results[*] 目前至少可能包含以下运行时契约字段:
runtime_stateruntime_detailcapability_idcapability_groupruntime_typefailure_classhealth_statecircuit_stateconsecutive_failuresrecent_failure_classqueue_load_hint
说明:
capability_*/runtime_type对齐 AI runtime capability 规格,用于稳定标识能力身份。failure_class/health_state/circuit_state对齐统一运行时词汇,供 WebUI、日志与后续 AI 仓契约共用。- 不同探测项可按能力成熟度返回字段子集;缺失字段表示当前探测源尚未提供,而非协议保留不用。
llm/runtime-overview 返回要点
该接口聚合现有只读接口,供单页大盘直接消费,主要字段:
healthok/url/status_code/errorllm_runtime_detailllm_healthimage_healthtts_healthmedia_tasks
model_admintask_statsconversation_kernel
注意:
- 这是聚合视图,不是新的状态机事实源。
- 各子字段仍沿用 AI runtime 既有健康语义,如
health_state、circuit_state、degraded_state。
媒体权重与模型管理
Bot 代理 AI Runtime(需媒体服务可达):
| 方法 | 路径 | 说明 |
|---|---|---|
| GET | /common-config/llm/media-assets/status | 资源包就绪 / 大小 / download_allowed / delete_allowed |
| POST | /common-config/llm/media-assets/download | Body 可选 { "assets": ["tts", ...] };缺省下全部缺失 |
| POST | /common-config/llm/media-assets/delete | Body { "assets": [...] }(仅源码可写) |
| GET | /common-config/llm/media-assets/download/jobs/{job_id} | 下载任务进度 |
| GET | /common-config/llm/media-models/sing/speakers | 说话人清单 |
| GET | /common-config/llm/media-models/sing/backends | SVC backend 清单与 preferred |
| PUT | /common-config/llm/media-models/sing/defaults | { "default_speaker" } 和/或 { "preferred_backend" }(空串=自动 fallback) |
| GET | /common-config/llm/media-models/tts/voices | TTS 参考音频清单 |
| GET/PUT | /common-config/llm/media-models/tts/defaults | ref_audio_path / prompt_text 等 |
| GET/PUT | /common-config/llm/media-models/tts/translator | TTS 中翻日开关、后端与密钥(secret GET 脱敏) |
WebUI「能力包」页消费上述接口。默认配置落在 AI 侧 data/media_models.json。
前端对应
fetchCommonConfigSections、fetchCommonConfigSection、putCommonConfigSectionpostServiceGatewaysConnectivityCheck
实现:common_config_api.py + llm_product_api.py(LLM runtime overview)+ env_sections.py;网关探测 pallas/product/service_gateways/、service_gateways_section.py。
GET /common-config/llm/runtime-overview 中的 conversation kernel 反映 Bot 内 Provider 路径;媒体相关子字段依赖 AI Runtime 可达,与普通聊天是否可用无关。