Files
cmbot/docs/ai_models.sample.json
T
adminandClaude Opus 4.8 c47e9dee95 refactor(ai-outfit): 标题模型改为「配置定名」、去掉下拉 (§19.19)
标题模型是「配一次就固定」的,不像分辨率/话术需每次选;左栏 ~360px 已叠两个
提示词组,去掉下拉更干净,还消掉「误选图片模型」的坑。模型名放 app_config.title_model
(默认 GPT-5.5 文本),运行时按名字查 ai_models.json —— 换模型只改配置不改代码(docs/11 §17.3/§17.6)。

- ai_outfit_panel.py:_build_title_group 去掉标题模型下拉;apply_config 改记 title_model
  名字、_emit_config 不再写(UI 不覆盖);_selected_title_model_config → 纯函数
  _find_title_model(按 name 查 + 校验,返回 (config, error))+ UI 包装
  _resolve_title_model_config;找不到/未配置/图片接口时明确报错
- config_service:DEFAULT_CONFIG.title_model 默认改为 "GPT-5.5 文本"
- docs/ai_models.sample.json:补一条 name=「GPT-5.5 文本」的 chat 文本模型样板(占位 key)
- 测试:面板断言无标题模型下拉;_find_title_model 命中/缺失/无模型三例;全套 py37 通过
- 冒烟:seeded ai_models.json + apply_config → title_model 名字解析到 gpt-5.5(chat),缺失→报错

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 11:45:36 +08:00

57 lines
2.3 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.
{
"_说明": "复制此文件到 ~/.cmbot/config/ai_models.json(Windows: %USERPROFILE%\\.cmbot\\config\\ai_models.json),把 api_key/url/model 换成真实值。含真实 key 的 ai_models.json 不要提交 git。界面「AI 模型」下拉显示每项的 name;下面列了图片用的 4 种 api_type 示例(按你的中转接口选一种保留即可)+ 1 个标题生成用的文本模型。",
"_标题模型说明": "AI 穿搭页「生成标题」用文本模型(返回文字、不返回图)。把下面 name=「GPT-5.5 文本」这条的 url/model/api_key 换成你的真实文本模型,并让 app_config.json 的 title_model 与它的 name 一致(默认即「GPT-5.5 文本」)。详见 docs/11-ai-outfit.md §17.3。",
"models": [
{
"name": "GPT-5.5 文本",
"url": "https://your-relay.example.com/v1/chat/completions",
"model": "gpt-5.5",
"api_key": "sk-REPLACE_WITH_YOUR_KEY",
"api_type": "chat",
"timeout_seconds": 0,
"connect_timeout_seconds": 30,
"extra_body": {}
},
{
"name": "Nano Banana · 中转(chat)",
"url": "https://your-relay.example.com/v1/chat/completions",
"model": "nano-banana",
"api_key": "sk-REPLACE_WITH_YOUR_KEY",
"api_type": "chat",
"timeout_seconds": 0,
"connect_timeout_seconds": 30,
"extra_body": {}
},
{
"name": "Gemini 图像 · 中转(gemini)",
"url": "https://your-relay.example.com/v1beta/models/{model}:generateContent",
"model": "gemini-2.5-flash-image",
"api_key": "sk-REPLACE_WITH_YOUR_KEY",
"api_type": "gemini",
"timeout_seconds": 0,
"connect_timeout_seconds": 30,
"extra_body": {}
},
{
"name": "Images 生成 · 中转(images)",
"url": "https://your-relay.example.com/v1/images/generations",
"model": "your-image-model",
"api_key": "sk-REPLACE_WITH_YOUR_KEY",
"api_type": "images",
"timeout_seconds": 0,
"connect_timeout_seconds": 30,
"extra_body": {}
},
{
"name": "Images 编辑 · 中转(images_edits)",
"url": "https://your-relay.example.com/v1/images/edits",
"model": "your-edit-model",
"api_key": "sk-REPLACE_WITH_YOUR_KEY",
"api_type": "images_edits",
"timeout_seconds": 0,
"connect_timeout_seconds": 30,
"extra_body": {}
}
]
}