Compare commits

...

5 Commits

Author SHA1 Message Date
Peter Dave Hello
a755295f59
Merge bc53c17a8c into fb3af2a08f 2025-06-14 13:45:03 +08:00
RiverRay
fb3af2a08f
Merge pull request #6515 from dupl/main
Some checks failed
Run Tests / test (push) Has been cancelled
Removed deprecated Gemini models
2025-06-14 13:35:32 +08:00
dupl
eb193ac0ff
Removed deprecated Gemini models 2025-06-12 15:34:03 +08:00
Peter Dave Hello
bc53c17a8c Improve prompt store prompt list counting 2024-07-22 01:01:25 +08:00
Peter Dave Hello
16c16887ae Improve prompt store lang sorting 2024-07-22 01:01:16 +08:00
2 changed files with 7 additions and 11 deletions

View File

@ -523,20 +523,15 @@ const openaiModels = [
];
const googleModels = [
"gemini-1.0-pro", // Deprecated on 2/15/2025
"gemini-1.5-pro-latest",
"gemini-1.5-pro",
"gemini-1.5-pro-002",
"gemini-1.5-pro-exp-0827",
"gemini-1.5-flash-latest",
"gemini-1.5-flash-8b-latest",
"gemini-1.5-flash",
"gemini-1.5-flash-8b",
"gemini-1.5-flash-002",
"gemini-1.5-flash-exp-0827",
"learnlm-1.5-pro-experimental",
"gemini-exp-1114",
"gemini-exp-1121",
"gemini-exp-1206",
"gemini-2.0-flash",
"gemini-2.0-flash-exp",

View File

@ -159,10 +159,10 @@ export const usePromptStore = createPersistStore(
fetch(PROMPT_URL)
.then((res) => res.json())
.then((res) => {
let fetchPrompts = [res.en, res.tw, res.cn];
if (getLang() === "cn") {
fetchPrompts = fetchPrompts.reverse();
}
const lang = getLang();
const fetchPrompts = [res[lang], res.en, res.tw, res.cn].filter(
Boolean,
);
const builtinPrompts = fetchPrompts.map((promptList: PromptList) => {
return promptList.map(
([title, content]) =>
@ -180,8 +180,9 @@ export const usePromptStore = createPersistStore(
const allPromptsForSearch = builtinPrompts
.reduce((pre, cur) => pre.concat(cur), [])
.filter((v) => !!v.title && !!v.content);
SearchService.count.builtin =
res.en.length + res.cn.length + res.tw.length;
SearchService.count.builtin = Object.values(res)
.filter(Array.isArray)
.reduce((total, promptList) => total + promptList.length, 0);
SearchService.init(allPromptsForSearch, userPrompts);
});
},