review code

This commit is contained in:
lloydzhou
2024-07-09 12:27:44 +08:00
parent f3e3f08377
commit f68cd2c5c0
3 changed files with 24 additions and 15 deletions

View File

@@ -24,13 +24,11 @@ export function collectModelTable(
// default models
models.forEach((m) => {
// supoort name=displayName egcompletions_pro=ernie-4.0-8k
const [name, displayName] = m.name?.split("=");
// using <modelName>@<providerId> as fullName
modelTable[`${name}@${m?.provider?.id}`] = {
modelTable[`${m.name}@${m?.provider?.id}`] = {
...m,
name,
displayName: displayName || name, // 'provider' is copied over if it exists
displayName: m.name, // 'provider' is copied over if it exists
};
});