feat(channel): 添加模型映射和获取模型的 API

- 在 ChannelConfig 中添加 models 字段以支持模型映射
- 新增 ChannelFetchModelsEndpoint 用于获取上游模型列表
- 更新 normalizeChannelConfig 函数以处理新模型结构
- 修改相关的数据库操作以适应新的配置结构
- 引入 buildPrefixedTargetUrl 函数以简化 URL 构建
- 更新 utils 函数以支持模型映射查找
This commit is contained in:
Jeff Gu committed 2026-04-09 11:56:38 +08:00
1 parent a2c97959ba
commit 84cc346ebd
17 files changed
+951 -424

No files matched your search

+6
View File
@@ -161,6 +161,12 @@ export const apiClient = {
body: JSON.stringify(config),
}),
fetchChannelModels: (config: unknown) =>
request<ApiResponse>('/api/admin/channel/models/fetch', {
method: 'POST',
body: JSON.stringify(config),
}),
deleteChannel: (key: string) =>
request(`/api/admin/channel/${encodeURIComponent(key)}`, { method: 'DELETE' }),