mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-08 21:17:24 +08:00
Merge pull request #5180 from frostime/contrib-modellist
✨ feat: 调整模型列表,将自定义模型放在前面显示
This commit is contained in:
@@ -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 {
|
||||
|
@@ -411,13 +411,17 @@ export class ChatGPTApi implements LLMApi {
|
||||
return [];
|
||||
}
|
||||
|
||||
//由于目前 OpenAI 的 disableListModels 默认为 true,所以当前实际不会运行到这场
|
||||
let seq = 1000; //同 Constant.ts 中的排序保持一致
|
||||
return chatModels.map((m) => ({
|
||||
name: m.id,
|
||||
available: true,
|
||||
sorted: seq++,
|
||||
provider: {
|
||||
id: "openai",
|
||||
providerName: "OpenAI",
|
||||
providerType: "openai",
|
||||
sorted: 1,
|
||||
},
|
||||
}));
|
||||
}
|
||||
|
Reference in New Issue
Block a user