This commit is contained in:
sijinhui 2024-07-21 08:37:28 +08:00
parent c8f2d8029b
commit 932c1103f2
6 changed files with 101 additions and 99 deletions

View File

@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
#npx lint-staged
npx lint-staged

View File

@ -1286,95 +1286,94 @@ export function Settings() {
</ListItem>
</List>
<!--
<List id={SlotID.CustomModel}>
{accessCodeComponent}
{/*<List id={SlotID.CustomModel}>*/}
{/* {accessCodeComponent}*/}
{!accessStore.hideUserApiKey && (
<>
{useCustomConfigComponent}
{/* {!accessStore.hideUserApiKey && (*/}
{/* <>*/}
{/* {useCustomConfigComponent}*/}
{accessStore.useCustomConfig && (
<>
<ListItem
title={Locale.Settings.Access.Provider.Title}
subTitle={Locale.Settings.Access.Provider.SubTitle}
>
<Select
value={accessStore.provider}
onChange={(e) => {
accessStore.update(
(access) =>
(access.provider = e.target
.value as ServiceProvider),
);
}}
>
{Object.entries(ServiceProvider).map(([k, v]) => (
<option value={v} key={k}>
{k}
</option>
))}
</Select>
</ListItem>
{/* {accessStore.useCustomConfig && (*/}
{/* <>*/}
{/* <ListItem*/}
{/* title={Locale.Settings.Access.Provider.Title}*/}
{/* subTitle={Locale.Settings.Access.Provider.SubTitle}*/}
{/* >*/}
{/* <Select*/}
{/* value={accessStore.provider}*/}
{/* onChange={(e) => {*/}
{/* accessStore.update(*/}
{/* (access) =>*/}
{/* (access.provider = e.target*/}
{/* .value as ServiceProvider),*/}
{/* );*/}
{/* }}*/}
{/* >*/}
{/* {Object.entries(ServiceProvider).map(([k, v]) => (*/}
{/* <option value={v} key={k}>*/}
{/* {k}*/}
{/* </option>*/}
{/* ))}*/}
{/* </Select>*/}
{/* </ListItem>*/}
{openAIConfigComponent}
{azureConfigComponent}
{googleConfigComponent}
{anthropicConfigComponent}
{baiduConfigComponent}
{byteDanceConfigComponent}
{alibabaConfigComponent}
</>
)}
</>
)}
-->
<!--
{!shouldHideBalanceQuery && !clientConfig?.isApp ? (
<ListItem
title={Locale.Settings.Usage.Title}
subTitle={
showUsage
? loadingUsage
? Locale.Settings.Usage.IsChecking
: Locale.Settings.Usage.SubTitle(
usage?.used ?? "[?]",
usage?.subscription ?? "[?]",
)
: Locale.Settings.Usage.NoAccess
}
>
{!showUsage || loadingUsage ? (
<div />
) : (
<IconButton
icon={<ResetIcon></ResetIcon>}
text={Locale.Settings.Usage.Check}
onClick={() => checkUsage(true)}
/>
)}
</ListItem>
) : null}
{/* {openAIConfigComponent}*/}
{/* {azureConfigComponent}*/}
{/* {googleConfigComponent}*/}
{/* {anthropicConfigComponent}*/}
{/* {baiduConfigComponent}*/}
{/* {byteDanceConfigComponent}*/}
{/* {alibabaConfigComponent}*/}
{/* </>*/}
{/* )}*/}
{/* </>*/}
{/* )}*/}
{/* {!shouldHideBalanceQuery && !clientConfig?.isApp ? (*/}
{/* <ListItem*/}
{/* title={Locale.Settings.Usage.Title}*/}
{/* subTitle={*/}
{/* showUsage*/}
{/* ? loadingUsage*/}
{/* ? Locale.Settings.Usage.IsChecking*/}
{/* : Locale.Settings.Usage.SubTitle(*/}
{/* usage?.used ?? "[?]",*/}
{/* usage?.subscription ?? "[?]",*/}
{/* )*/}
{/* : Locale.Settings.Usage.NoAccess*/}
{/* }*/}
{/* >*/}
{/* {!showUsage || loadingUsage ? (*/}
{/* <div />*/}
{/* ) : (*/}
{/* <IconButton*/}
{/* icon={<ResetIcon></ResetIcon>}*/}
{/* text={Locale.Settings.Usage.Check}*/}
{/* onClick={() => checkUsage(true)}*/}
{/* />*/}
{/* )}*/}
{/* </ListItem>*/}
{/* ) : null}*/}
{/* <ListItem*/}
{/* title={Locale.Settings.Access.CustomModel.Title}*/}
{/* subTitle={Locale.Settings.Access.CustomModel.SubTitle}*/}
{/* >*/}
{/* <input*/}
{/* type="text"*/}
{/* value={config.customModels}*/}
{/* placeholder="model1,model2,model3"*/}
{/* onChange={(e) =>*/}
{/* config.update(*/}
{/* (config) => (config.customModels = e.currentTarget.value),*/}
{/* )*/}
{/* }*/}
{/* ></input>*/}
{/* </ListItem>*/}
{/*</List>*/}
<ListItem
title={Locale.Settings.Access.CustomModel.Title}
subTitle={Locale.Settings.Access.CustomModel.SubTitle}
>
<input
type="text"
value={config.customModels}
placeholder="model1,model2,model3"
onChange={(e) =>
config.update(
(config) => (config.customModels = e.currentTarget.value),
)
}
></input>
</ListItem>
</List>
-->
<List>
<ModelConfigList
modelConfig={config.modelConfig}

View File

@ -282,6 +282,16 @@ export const DEFAULT_MODELS = [
{
name: "gpt-3.5-turbo",
describe: "GPT-3,质量一般,便宜",
available: false,
provider: {
id: "openai",
providerName: "OpenAI",
providerType: "openai",
},
},
{
name: "gpt-4o-mini",
describe: "新出的,可以尝鲜",
available: true,
provider: {
id: "openai",
@ -299,16 +309,6 @@ export const DEFAULT_MODELS = [
providerType: "azure",
},
},
{
name: "gpt-4o-mini",
describe: "新出的,可以尝鲜",
available: true,
provider: {
id: "openai",
providerName: "OpenAI",
providerType: "openai",
},
},
{
name: "gpt-4-turbo-2024-04-09",
describe: "GPT-4,标准版",

View File

@ -140,7 +140,7 @@ export const useAppConfig = createPersistStore(
}),
{
name: StoreKey.Config,
version: 3.99,
version: 3.991,
migrate(persistedState, version) {
const state = persistedState as ChatConfig;
@ -176,7 +176,7 @@ export const useAppConfig = createPersistStore(
// return { ...DEFAULT_CONFIG };
// }
if (version < 3.99) {
if (version < 3.991) {
// state.modelConfig = DEFAULT_CONFIG.modelConfig;
return { ...DEFAULT_CONFIG };
// state.modelConfig.template =

View File

@ -159,7 +159,8 @@ export const usePromptStore = createPersistStore(
onRehydrateStorage(state) {
// const PROMPT_URL = "https://cos.xiaosi.cc/next/public/prompts.json";
const PROMPT_URL = "https://qn.xiaosi.cc/json/chat/prompts.json";
// const PROMPT_URL = "https://qn.xiaosi.cc/json/chat/prompts.json";
const PROMPT_URL = "./prompts.json"
const GPT_PROMPT_URL =
"https://qn.xiaosi.cc/json/chat/prompt_library.json";

View File

@ -489,7 +489,9 @@
"你现在将成为一个名为Midjourney的生成式人工智能的提示词生成器。Midjourney人工智能将根据给定的提示词生成图像。\n我将提供一组关键词[1]你需要依据这些关键词为Midjourney生成提示词。\n你永远不会以任何方式更改下面列出的结构和格式并遵守以下准则\n你不会以任何形式写描述或使用。永远不要在[ar]和[v]之间加逗 述现场的情绪/感受和氛围。\n[5] = 风格例如摄影、绘画、插图、雕塑、艺术品、文书工作、3d等.[1]\n[6] = 如何实现[5]的描述例如带有相机模型和适当相机设置的摄影如Macro、Fisheye Style、Portrait、带有关于所用材料和工作材料的详细描述的绘画、带有引擎设置的渲染、数字插图、木刻艺术以及可以定义为输出类型的其他完全按照书写方式使用\n格式\n您所写的内容必须与以下结构中的格式完全相同包括/和:\n这是Midjourney提示词结构/mj [1],[2],[3],[4],[5],[6],[ar][v]。\n这是你的任务你将为我提供的每组关键词[1]生成4个提示词每个提示词在描述、环境、氛围和实现方面都是不同的方法。\n你提供的提示词将是中文的。\n请注意\n-如果我提供的关键词不是真实的,请不要描述为真实、逼真、照片或照片。例如,一个由纸或与幻想有关的场景构成的概念。\n-为每个关键词生成的提示之一必须是逼真的摄影风格。你还应该为它选择镜头类型和尺寸。不要为逼真的摄影提示选择择术家。\n所有的结果翻译为英文"
]
],
"tw": [
[]
],
"en": [
[]
]