feat: OAuth 导入导出、提供商筛选、Gemini 图像生成支持与流式处理增强

- OAuth: 支持通过 Refresh Token 导入账号(文件拖拽/粘贴),OAuth Key 可导出为 JSON
- OAuth: 所有 OAuth 端点添加 require_admin 鉴权
- 提供商管理: 新增状态/API格式/模型三级筛选,后端返回 global_model_ids
- Gemini: 新增图像生成模型适配(finalize_provider_request 钩子 + envelope 跳过不兼容字段)
- 流式处理: buffer 残留数据 flush 与 token 兜底估算
- 上游元数据: 提取 merge_upstream_metadata,配额耗尽模型保留与深度合并
- Antigravity 配额: 无 quotaInfo 时视为耗尽,移除 Other 兜底分组
- README: 新增升级备份与回滚指南
This commit is contained in:
fawney19
2026-02-06 21:52:22 +08:00
parent 62dae22a2c
commit 8b6a5d3824
23 changed files with 1129 additions and 101 deletions

View File

@@ -58,6 +58,7 @@ export async function getModelCapabilities(modelName: string): Promise<ModelCapa
export interface RevealKeyResult {
auth_type: 'api_key' | 'vertex_ai' | 'oauth'
api_key?: string
refresh_token?: string
auth_config?: string | Record<string, any>
}

View File

@@ -46,3 +46,11 @@ export async function completeProviderLevelOAuth(
const resp = await client.post(`/api/admin/provider-oauth/providers/${providerId}/complete`, data)
return resp.data
}
export async function importProviderRefreshToken(
providerId: string,
data: { refresh_token: string; name?: string }
): Promise<ProviderOAuthCompleteResponseWithKey> {
const resp = await client.post(`/api/admin/provider-oauth/providers/${providerId}/import-refresh-token`, data)
return resp.data
}

View File

@@ -447,6 +447,7 @@ export interface ProviderWithEndpointsSummary {
active_keys: number
total_models: number
active_models: number
global_model_ids: string[]
avg_health_score: number
unhealthy_endpoints: number
api_formats: string[]