Your Name 4a3c7e7923 refactor: 清理无用模块、修复前后端对齐、添加注册页面
- 删除后端 risk_exceptions 模块(API/Model/Schema/迁移/测试)
- 删除后端 metrics 模块(API/测试)
- 删除后端 ManualTask 模型和相关 Schema
- 修复搜索接口响应缺少 total 字段的问题
- 统一 Platform 枚举(前端去掉后端不支持的 weibo/wechat)
- 新增前端注册页面 /register,登录页添加注册链接

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 14:51:17 +08:00

88 lines
1.5 KiB
TypeScript

/**
* AI 配置类型定义
* 与后端 schemas/ai_config.py 对齐
*/
export type AIProvider =
| 'oneapi'
| 'openrouter'
| 'anthropic'
| 'openai'
| 'deepseek'
| 'qwen'
| 'doubao'
| 'zhipu'
| 'moonshot'
export interface AIModelsConfig {
text: string
vision: string
audio: string
}
export interface AIParametersConfig {
temperature: number
max_tokens: number
}
// ===== 请求 =====
export interface AIConfigUpdate {
provider: AIProvider
base_url: string
api_key: string
models: AIModelsConfig
parameters: AIParametersConfig
}
export interface GetModelsRequest {
provider: AIProvider
base_url: string
api_key: string
}
export interface TestConnectionRequest {
provider: AIProvider
base_url: string
api_key: string
models: AIModelsConfig
}
// ===== 响应 =====
export interface AIConfigResponse {
provider: string
base_url: string
api_key_masked: string
models: AIModelsConfig
parameters: AIParametersConfig
available_models: Record<string, ModelInfo[]>
is_configured: boolean
last_test_at?: string | null
last_test_result?: Record<string, unknown> | null
}
export interface ModelInfo {
id: string
name: string
}
export interface ModelsListResponse {
success: boolean
models: Record<string, ModelInfo[]>
error?: string | null
}
export interface ModelTestResult {
success: boolean
latency_ms?: number | null
error?: string | null
model: string
}
export interface ConnectionTestResponse {
success: boolean
results: Record<string, ModelTestResult>
message: string
}