优化 API 配置:一个弹窗完成接口、Key 与模型选择
- 去掉预设供应商,直接选择接口类型并填写 Base URL、API Key - 可在保存前从接口拉取模型,搜索并勾选多个;也可手动输入模型名 - 适配中转站:漏写 /v1(Gemini 为 /v1beta)时自动补全,同时发送 Bearer 与官方鉴权头 - 保存时服务端同步连接下的模型列表;编辑时不填 Key 也可拉取 - 单模型测试与参数设置;手机端布局优化 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -113,6 +113,8 @@ function streamChapter(res, body) {
|
||||
|
||||
createServer(async (req, res) => {
|
||||
const url = new URL(req.url, `http://localhost:${port}`)
|
||||
// 与真实接口一样要求 /v1 前缀,用于测试 Base URL 自动补全
|
||||
if (!url.pathname.startsWith('/v1/')) return json(res, 404, { error: { message: 'not found' } })
|
||||
if (req.method === 'GET' && url.pathname.endsWith('/models')) {
|
||||
return json(res, 200, { object: 'list', data: [{ id: 'mock-editor' }, { id: 'mock-writer-trunc' }] })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user