Compare commits

...

5 Commits

Author SHA1 Message Date
Peter Dave Hello
40a186a639
Merge bc53c17a8c into 705dffc664 2025-06-11 19:43:09 +08:00
RiverRay
705dffc664
Merge pull request #6514 from KevinShiCN/patch-1
Some checks failed
Run Tests / test (push) Has been cancelled
Add gemini-2.5-pro-preview-06-05 into constant.ts
2025-06-11 16:14:09 +08:00
KevinShiCN
02f7e6de98
Add gemini-2.5-pro-preview-06-05 into constant.ts 2025-06-08 23:59:49 +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 8 additions and 6 deletions

View File

@ -546,6 +546,7 @@ const googleModels = [
"gemini-2.0-flash-thinking-exp-01-21",
"gemini-2.0-pro-exp",
"gemini-2.0-pro-exp-02-05",
"gemini-2.5-pro-preview-06-05",
];
const anthropicModels = [

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);
});
},