feat: support baidu model

This commit is contained in:
Dogtiti
2024-07-06 13:05:09 +08:00
parent 2d1f522aaf
commit 785d3748e1
14 changed files with 586 additions and 4 deletions

View File

@@ -24,10 +24,13 @@ 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[`${m.name}@${m?.provider?.id}`] = {
modelTable[`${name}@${m?.provider?.id}`] = {
...m,
displayName: m.name, // 'provider' is copied over if it exists
name,
displayName: displayName || name, // 'provider' is copied over if it exists
};
});