refactor: 简化模型管理,移除启用/禁用,优化测试和布局
- 移除供应商/模型启用禁用能力,清理DB schema/migration/API/前端 - 供应商测试改为Base URL连通性+/models探测 - 新增POST /api/models/test模型连接测试 - 新增GET /api/providers/options专用供应商选项接口 - 统一工具栏为ModelsToolbar,参考项目管理布局 - 模型弹窗优化:默认能力、响应式3列标签、并排数值 - 前后端正整数校验、供应商下拉loading/error/empty状态 - 表格列宽统一,操作列/名称列固定宽度
This commit is contained in:
@@ -40,7 +40,6 @@ export interface Model {
|
||||
capabilities: ModelCapability[];
|
||||
contextLength: null | number;
|
||||
createdAt: string;
|
||||
enabled: boolean;
|
||||
id: string;
|
||||
maxOutputTokens: null | number;
|
||||
modelId: string;
|
||||
@@ -81,6 +80,15 @@ export interface ModelResponse {
|
||||
model: Model;
|
||||
}
|
||||
|
||||
export interface ModelTestResponse {
|
||||
message: string;
|
||||
ok: boolean;
|
||||
}
|
||||
|
||||
export interface ModelTestResultResponse {
|
||||
modelTestResponse: ModelTestResponse;
|
||||
}
|
||||
|
||||
export interface Project {
|
||||
archivedAt: null | string;
|
||||
createdAt: string;
|
||||
@@ -108,7 +116,6 @@ export interface Provider {
|
||||
apiKey: string;
|
||||
baseUrl: string;
|
||||
createdAt: string;
|
||||
enabled: boolean;
|
||||
id: string;
|
||||
name: string;
|
||||
type: ProviderType;
|
||||
@@ -122,6 +129,16 @@ export interface ProviderListResponse {
|
||||
total: number;
|
||||
}
|
||||
|
||||
export interface ProviderOption {
|
||||
id: string;
|
||||
name: string;
|
||||
type: ProviderType;
|
||||
}
|
||||
|
||||
export interface ProviderOptionsResponse {
|
||||
items: ProviderOption[];
|
||||
}
|
||||
|
||||
export interface ProviderResponse {
|
||||
provider: Provider;
|
||||
}
|
||||
@@ -139,6 +156,11 @@ export type ProviderType = "anthropic" | "openai" | "openai-compatible";
|
||||
|
||||
export type RuntimeMode = "development" | "production" | "test";
|
||||
|
||||
export interface TestModelRequest {
|
||||
modelId: string;
|
||||
providerId: string;
|
||||
}
|
||||
|
||||
export interface UpdateModelRequest {
|
||||
capabilities?: ModelCapability[];
|
||||
contextLength?: null | number;
|
||||
|
||||
Reference in New Issue
Block a user