Merge branch 'Yidadaa:main' into main

This commit is contained in:
Hk-Gosuto
2023-07-10 12:26:34 +08:00
committed by GitHub
27 changed files with 498 additions and 270 deletions

View File

@@ -257,12 +257,14 @@ export class ChatGPTApi implements LLMApi {
const chatModels = resJson.data?.filter((m) => m.id.startsWith("gpt-"));
console.log("[Models]", chatModels);
return (
chatModels?.map((m) => ({
name: m.id,
available: true,
})) || []
);
if (!chatModels) {
return [];
}
return chatModels.map((m) => ({
name: m.id,
available: true,
}));
}
}
export { OpenaiPath };