From e2cdb99194c7335730d0f46f68d8343476036ccf Mon Sep 17 00:00:00 2001 From: Wang Defa <1+wangdefa@noreply.gitea.bcde.io> Date: Tue, 14 Jul 2026 09:50:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=85=A5=E4=BF=A1=E6=81=AF=E8=A1=A5tt?= =?UTF-8?q?s=E7=AB=AF=E7=82=B9,=E5=8F=AF=E7=94=A8=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=BF=87=E6=BB=A4=E5=BC=83=E7=94=A8=E5=BC=80?= =?UTF-8?q?=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 接入信息展示 POST /tts(xAI 官方格式) - 可用模型卡片「过滤弃用」NSwitch:GET/PUT /api/v1/ai-settings,切换即时刷新;修复 request body 双重 stringify - CHANGELOG 0.5.0(0.4.0 已发版冻结) --- CHANGELOG.md | 7 +++++++ src/api/aigateway.ts | 11 +++++++++++ src/types/api.ts | 5 +++++ src/views/AiGatewayView.vue | 35 +++++++++++++++++++++++++++++++++-- 4 files changed, 56 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1829edc..ab3d790 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ 格式参考 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/)(版本段不记日期),版本号遵循语义化版本。 +## [0.5.0] + +### Added + +- AI 网关「接入信息」新增 `POST /tts` 端点展示(文本转语音 · xAI 官方格式) +- AI 网关「可用模型」新增「过滤弃用」开关:开启后已宣布弃用(即使未退役)的模型从模型列表与路由中排除,状态持久化,切换即时刷新列表 + ## [0.4.0] ### Added diff --git a/src/api/aigateway.ts b/src/api/aigateway.ts index 845a0e7..4d637c2 100644 --- a/src/api/aigateway.ts +++ b/src/api/aigateway.ts @@ -7,6 +7,7 @@ import type { AiModel, AiModelBlacklistItem, AiModelCacheItem, + AiSettings, } from '@/types/api' // ---- 网关密钥 ---- @@ -88,6 +89,16 @@ export function listAiModels(): Promise { return request<{ items: AiModel[] }>('/ai-models').then((r) => r.items) } +// ---- 网关全局设置 ---- + +export function getAiSettings(): Promise { + return request('/ai-settings') +} + +export function updateAiSettings(body: AiSettings): Promise { + return request('/ai-settings', { method: 'PUT', body }) +} + // ---- 模型黑名单 ---- export function listAiBlacklist(): Promise { diff --git a/src/types/api.ts b/src/types/api.ts index 2101a2e..29b1f6e 100644 --- a/src/types/api.ts +++ b/src/types/api.ts @@ -968,6 +968,11 @@ export interface AiModelCacheItem { } /** 模型黑名单条目:拉黑即全渠道剔除,同步 / 探测不再入库 */ +/** AI 网关全局设置 */ +export interface AiSettings { + filterDeprecated: boolean +} + export interface AiModelBlacklistItem { id: number name: string diff --git a/src/views/AiGatewayView.vue b/src/views/AiGatewayView.vue index c24ab5c..882312c 100644 --- a/src/views/AiGatewayView.vue +++ b/src/views/AiGatewayView.vue @@ -1,14 +1,16 @@