forked from open-webui/open-webui
feat: sort model list by alphabetical order
This commit is contained in:
parent
c6c32e2abd
commit
f6640c4e8b
3 changed files with 17 additions and 27 deletions
|
@ -67,7 +67,9 @@ export const getOllamaModels = async (
|
|||
throw error;
|
||||
}
|
||||
|
||||
return res?.models ?? [];
|
||||
return (res?.models ?? []).sort((a, b) => {
|
||||
return a.name.localeCompare(b.name);
|
||||
});
|
||||
};
|
||||
|
||||
export const generateTitle = async (
|
||||
|
|
|
@ -29,5 +29,8 @@ export const getOpenAIModels = async (
|
|||
|
||||
return models
|
||||
.map((model) => ({ name: model.id, external: true }))
|
||||
.filter((model) => (base_url.includes('openai') ? model.name.includes('gpt') : true));
|
||||
.filter((model) => (base_url.includes('openai') ? model.name.includes('gpt') : true))
|
||||
.sort((a, b) => {
|
||||
return a.name.localeCompare(b.name);
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue