2 Commits
Author SHA1 Message Date
wangdefa e2cdb99194 接入信息补tts端点,可用模型新增过滤弃用开关
CI / test (push) Successful in 25s
Release / release (push) Successful in 25s
- 接入信息展示 POST /tts(xAI 官方格式)
- 可用模型卡片「过滤弃用」NSwitch:GET/PUT /api/v1/ai-settings,切换即时刷新;修复 request body 双重 stringify
- CHANGELOG 0.5.0(0.4.0 已发版冻结)
2026-07-14 09:50:01 +08:00
wangdefa 7f529bd991 AI网关接入信息补齐新端点,CHANGELOG 0.4.0
CI / test (push) Successful in 26s
Release / release (push) Successful in 26s
2026-07-13 20:14:28 +08:00
4 changed files with 70 additions and 7 deletions
+18 -5
View File
@@ -1,8 +1,21 @@
# Changelog # Changelog
格式遵循 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),版本号遵循语义化版本。 格式参考 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/)(版本段不记日期),版本号遵循语义化版本。
## [0.3.0] - 2026-07-13 ## [0.5.0]
### Added
- AI 网关「接入信息」新增 `POST /tts` 端点展示(文本转语音 · xAI 官方格式)
- AI 网关「可用模型」新增「过滤弃用」开关:开启后已宣布弃用(即使未退役)的模型从模型列表与路由中排除,状态持久化,切换即时刷新列表
## [0.4.0]
### Added
- AI 网关「接入信息」补齐新端点展示:`POST /audio/speech`(文本转语音 · xAI Voice)、`POST /rerank`(文档重排 · Cohere Rerank)、`POST /moderations`(内容审核 · OCI Guardrails
## [0.3.0]
### Added ### Added
@@ -27,7 +40,7 @@
- 修复租户列表分页状态在页面重绘时丢失,以及筛选后停留在越界页码的问题 - 修复租户列表分页状态在页面重绘时丢失,以及筛选后停留在越界页码的问题
- 修复「引导卷(GB)」等可清空数字输入框的步进箭头挤出输入框右缘的错位;清空图标改为悬浮在步进竖栏左侧,输入文本自动避让 - 修复「引导卷(GB)」等可清空数字输入框的步进箭头挤出输入框右缘的错位;清空图标改为悬浮在步进竖栏左侧,输入文本自动避让
## [0.2.0] - 2026-07-12 ## [0.2.0]
### Added ### Added
@@ -39,7 +52,7 @@
- 租户删除确认弹窗分段排版(标题 / 面板清理范围 / 云端提示),列表与详情页文案一致 - 租户删除确认弹窗分段排版(标题 / 面板清理范围 / 云端提示),列表与详情页文案一致
## [0.1.0] - 2026-07-10 ## [0.1.0]
### Added ### Added
@@ -61,7 +74,7 @@
- 租户详情「用户」「策略」等 Tab 切换域后内容不刷新 - 租户详情「用户」「策略」等 Tab 切换域后内容不刷新
- 实例详情区块加载中时禁用头部操作按钮,防误点 - 实例详情区块加载中时禁用头部操作按钮,防误点
## [0.0.1] - 2026-07-09 ## [0.0.1]
首个版本:OCI Portal 前端。 首个版本:OCI Portal 前端。
+11
View File
@@ -7,6 +7,7 @@ import type {
AiModel, AiModel,
AiModelBlacklistItem, AiModelBlacklistItem,
AiModelCacheItem, AiModelCacheItem,
AiSettings,
} from '@/types/api' } from '@/types/api'
// ---- 网关密钥 ---- // ---- 网关密钥 ----
@@ -88,6 +89,16 @@ export function listAiModels(): Promise<AiModel[]> {
return request<{ items: AiModel[] }>('/ai-models').then((r) => r.items) return request<{ items: AiModel[] }>('/ai-models').then((r) => r.items)
} }
// ---- 网关全局设置 ----
export function getAiSettings(): Promise<AiSettings> {
return request<AiSettings>('/ai-settings')
}
export function updateAiSettings(body: AiSettings): Promise<AiSettings> {
return request<AiSettings>('/ai-settings', { method: 'PUT', body })
}
// ---- 模型黑名单 ---- // ---- 模型黑名单 ----
export function listAiBlacklist(): Promise<AiModelBlacklistItem[]> { export function listAiBlacklist(): Promise<AiModelBlacklistItem[]> {
+5
View File
@@ -968,6 +968,11 @@ export interface AiModelCacheItem {
} }
/** 模型黑名单条目:拉黑即全渠道剔除,同步 / 探测不再入库 */ /** 模型黑名单条目:拉黑即全渠道剔除,同步 / 探测不再入库 */
/** AI 网关全局设置 */
export interface AiSettings {
filterDeprecated: boolean
}
export interface AiModelBlacklistItem { export interface AiModelBlacklistItem {
id: number id: number
name: string name: string
+35 -1
View File
@@ -1,14 +1,16 @@
<script setup lang="ts"> <script setup lang="ts">
import { NButton, useDialog } from 'naive-ui' import { NButton, NSwitch, useDialog } from 'naive-ui'
import { computed, ref } from 'vue' import { computed, ref } from 'vue'
import { import {
addAiBlacklist, addAiBlacklist,
getAiSettings,
listAiBlacklist, listAiBlacklist,
listAiChannels, listAiChannels,
listAiKeys, listAiKeys,
listAiModels, listAiModels,
removeAiBlacklist, removeAiBlacklist,
updateAiSettings,
} from '@/api/aigateway' } from '@/api/aigateway'
import AiChannelPanel from '@/components/ai/AiChannelPanel.vue' import AiChannelPanel from '@/components/ai/AiChannelPanel.vue'
import AiKeyPanel from '@/components/ai/AiKeyPanel.vue' import AiKeyPanel from '@/components/ai/AiKeyPanel.vue'
@@ -31,6 +33,10 @@ const endpoints = [
{ method: 'POST', path: '/responses', note: 'OpenAI Responses · 无状态子集' }, { method: 'POST', path: '/responses', note: 'OpenAI Responses · 无状态子集' },
{ method: 'POST', path: '/messages', note: 'Claude · 流式/非流式' }, { method: 'POST', path: '/messages', note: 'Claude · 流式/非流式' },
{ method: 'POST', path: '/embeddings', note: 'OpenAI Embeddings · 向量化' }, { method: 'POST', path: '/embeddings', note: 'OpenAI Embeddings · 向量化' },
{ method: 'POST', path: '/audio/speech', note: '文本转语音 · xAI Voice' },
{ method: 'POST', path: '/tts', note: '文本转语音 · xAI 官方格式' },
{ method: 'POST', path: '/rerank', note: '文档重排 · Cohere Rerank' },
{ method: 'POST', path: '/moderations', note: '内容审核 · OCI Guardrails' },
{ method: 'GET', path: '/models', note: '模型列表(按密钥分组过滤)' }, { method: 'GET', path: '/models', note: '模型列表(按密钥分组过滤)' },
] ]
@@ -84,6 +90,25 @@ async function copyModel(id: string) {
} }
} }
/** 「过滤弃用模型」开关:开启后已宣布弃用(即使未退役)的模型从列表与路由中排除 */
const filterDeprecated = ref(false)
void getAiSettings()
.then((s) => { filterDeprecated.value = s.filterDeprecated })
.catch(() => {})
async function toggleFilterDeprecated(v: boolean) {
filterDeprecated.value = v
try {
const s = await updateAiSettings({ filterDeprecated: v })
filterDeprecated.value = s.filterDeprecated
message.success(v ? '已过滤弃用模型(列表与路由同时排除)' : '已恢复展示弃用模型')
} catch (e) {
message.error(e instanceof Error ? e.message : '操作失败')
filterDeprecated.value = !v
}
refreshModels()
}
function refreshModels() { function refreshModels() {
void models.run({ silent: true }) void models.run({ silent: true })
void blacklist.run({ silent: true }) void blacklist.run({ silent: true })
@@ -163,8 +188,17 @@ async function unbanModel(b: AiModelBlacklistItem) {
<div class="text-sm font-semibold">可用模型</div> <div class="text-sm font-semibold">可用模型</div>
<div class="mt-0.5 text-xs text-ink-3">按厂商分组;点击厂商展开,点击模型名复制, 加入黑名单</div> <div class="mt-0.5 text-xs text-ink-3">按厂商分组;点击厂商展开,点击模型名复制, 加入黑名单</div>
</div> </div>
<div class="flex flex-none items-center gap-3">
<label
class="flex cursor-pointer items-center gap-1.5 text-xs text-ink-3"
title="开启后,已宣布弃用(即使未退役)的模型从模型列表与路由中排除;关闭恢复"
>
过滤弃用
<NSwitch size="small" :value="filterDeprecated" @update:value="toggleFilterDeprecated" />
</label>
<span class="text-xs text-ink-3">{{ models.data.value?.length ?? '…' }} </span> <span class="text-xs text-ink-3">{{ models.data.value?.length ?? '…' }} </span>
</div> </div>
</div>
<div class="px-4.5 py-1.5"> <div class="px-4.5 py-1.5">
<div <div
v-for="g in modelGroups" v-for="g in modelGroups"