feat(model): 增加 sorted 字段,并使用该字段对模型列表进行排序

1. 在 Model 和 Provider 类型中增加 sorted 字段(api.ts)
2. 默认模型在初始化的时候,自动设置默认 sorted 字段,从 1000 开始自增长(constant.ts)
3. 自定义模型更新的时候,自动分配 sorted 字段(model.ts)
This commit is contained in:
frostime
2024-08-05 19:43:32 +08:00
parent b023a00445
commit 150fc84b9b
3 changed files with 50 additions and 20 deletions

View File

@@ -64,12 +64,14 @@ export interface LLMModel {
displayName?: string;
available: boolean;
provider: LLMModelProvider;
sorted: number;
}
export interface LLMModelProvider {
id: string;
providerName: string;
providerType: string;
sorted: number;
}
export abstract class LLMApi {