refactor: 抽离 AI pipeline 与调度共享能力逻辑

This commit is contained in:
fawney19
2026-04-10 01:46:14 +08:00
parent b901a6ffc7
commit 5014e2f5fd
255 changed files with 15057 additions and 3115 deletions

View File

@@ -155,7 +155,12 @@ export const cacheApi = {
const response = await api.get('/api/admin/monitoring/cache/affinities', {
params: keyword ? { keyword } : undefined
})
return response.data.data
const data = response.data.data ?? {}
return {
items: data.items ?? [],
total: data.meta?.total ?? data.items?.length ?? 0,
matched_user_id: data.matched_user_id ?? null
}
}
}

View File

@@ -8,6 +8,8 @@ export interface CandidateRecord {
provider_id?: string
provider_name?: string
provider_website?: string // Provider 官网
provider_priority?: number
provider_keep_priority_on_conversion?: boolean
endpoint_id?: string
endpoint_name?: string // 端点显示名称api_format
key_id?: string
@@ -15,6 +17,8 @@ export interface CandidateRecord {
key_account_label?: string // 更适合展示的测试账号标签(优先 OAuth 邮箱)
key_preview?: string // 密钥脱敏预览(如 sk-***abcOAuth 类型不返回
key_auth_type?: string // 密钥认证类型api_key, service_account, oauth 等)
key_internal_priority?: number
key_global_priority_by_format?: Record<string, number> | null
key_oauth_plan_type?: string // OAuth 账号套餐类型free/plus/team/enterprise
key_capabilities?: Record<string, boolean> | null // Key 支持的能力
required_capabilities?: Record<string, boolean> | null // 请求实际需要的能力标签