新增: F-01模型拉取IPC+Settings拉取UI(FR-S1密钥内存解析闭环)

This commit is contained in:
2026-06-17 00:14:38 +08:00
parent 8a142c212c
commit a26b86e003
7 changed files with 257 additions and 2 deletions

View File

@@ -181,12 +181,57 @@ export interface AiProviderConfig {
base_url: string
default_model: string
models: string | null
/** 模型能力配置数组(F-01:4 维度 + 路由控制;DB TEXT 列 JSON 解析,老库可能缺失) */
model_configs?: ModelConfig[]
is_default: boolean
config: string | null
created_at: string
updated_at: string
}
// ============================================================
// F-01 模型能力系统(ModelConfig,与 crates/df-ai-core/src/model.rs 严格对齐)
// ============================================================
/** 维度 1 — 模态(模型能接收什么输入)。serde snake_case 字面量。 */
export type Modality = 'text' | 'vision' | 'audio' | 'video'
/** 维度 2 — 能力(模型能做什么)。serde snake_case 字面量。 */
export type Capability = 'tool_use' | 'embedding' | 'code_gen'
/** 维度 3 — 价格分级(成本)。serde snake_case 字面量。 */
export type CostTier = 'free' | 'low' | 'medium' | 'high'
/** 维度 4 — 智力分级。serde snake_case 字面量。 */
export type IntelligenceTier = 'lite' | 'standard' | 'plus' | 'ultra'
/** 探测来源(只读,由后端探测器填充)。serde snake_case 字面量。 */
export type ProbeSource = 'user_set' | 'preset_table' | 'heuristic' | 'default'
/** 单模型完整配置(4 维度 + 路由控制 + 探测元数据)。 */
export interface ModelConfig {
/** 模型名(如 "glm-4v-flash") */
model_id: string
/** 启用/禁用(false=配了但不参与路由) */
enabled: boolean
/** 用户自定义别名(可选) */
label?: string
/** 模态集合 */
modalities: Modality[]
/** 能力集合 */
capabilities: Capability[]
/** 价格分级 */
cost_tier: CostTier
/** 智力分级 */
intelligence: IntelligenceTier
/** 权重(0-100,同能力候选中优先选权重高的) */
weight: number
/** 上下文窗口大小(tokens) */
context_window: number
/** 探测来源(可选) */
probe_source?: ProbeSource
}
/**
* AI 错误分类字面量集(B-260615-42)。
* 与后端 `commands::ai::ErrorType` 的 serde(rename_all = "snake_case") 严格对齐。