Merge remote-tracking branch 'upstream/main' into dev

# Conflicts:
#	app/client/api.ts
#	app/components/settings.tsx
#	app/constant.ts
#	src-tauri/tauri.conf.json
This commit is contained in:
sijinhui
2024-08-07 21:11:58 +08:00
18 changed files with 581 additions and 15 deletions

View File

@@ -1568,6 +1568,7 @@ function _Chat() {
)}
<div className={styles["chat-message-item"]}>
<Markdown
key={message.streaming ? "loading" : "done"}
content={getMessageTextContent(message)}
loading={
(message.preview || message.streaming) &&

View File

@@ -68,6 +68,7 @@ import {
SlotID,
UPDATE_URL,
Stability,
Iflytek,
} from "../constant";
import { Prompt, SearchService, usePromptStore } from "../store/prompt";
import { ErrorBoundary } from "./error";
@@ -1172,6 +1173,60 @@ export function Settings() {
</ListItem>
</>
);
const lflytekConfigComponent = accessStore.provider ===
ServiceProvider.Iflytek && (
<>
<ListItem
title={Locale.Settings.Access.Iflytek.Endpoint.Title}
subTitle={
Locale.Settings.Access.Iflytek.Endpoint.SubTitle +
Iflytek.ExampleEndpoint
}
>
<input
type="text"
value={accessStore.iflytekUrl}
placeholder={Iflytek.ExampleEndpoint}
onChange={(e) =>
accessStore.update(
(access) => (access.iflytekUrl = e.currentTarget.value),
)
}
></input>
</ListItem>
<ListItem
title={Locale.Settings.Access.Iflytek.ApiKey.Title}
subTitle={Locale.Settings.Access.Iflytek.ApiKey.SubTitle}
>
<PasswordInput
value={accessStore.iflytekApiKey}
type="text"
placeholder={Locale.Settings.Access.Iflytek.ApiKey.Placeholder}
onChange={(e) => {
accessStore.update(
(access) => (access.iflytekApiKey = e.currentTarget.value),
);
}}
/>
</ListItem>
<ListItem
title={Locale.Settings.Access.Iflytek.ApiSecret.Title}
subTitle={Locale.Settings.Access.Iflytek.ApiSecret.SubTitle}
>
<PasswordInput
value={accessStore.iflytekApiSecret}
type="text"
placeholder={Locale.Settings.Access.Iflytek.ApiSecret.Placeholder}
onChange={(e) => {
accessStore.update(
(access) => (access.iflytekApiSecret = e.currentTarget.value),
);
}}
/>
</ListItem>
</>
);
return (
<ErrorBoundary>
@@ -1475,6 +1530,7 @@ export function Settings() {
{/* {tencentConfigComponent}*/}
{/* {moonshotConfigComponent}*/}
{/* {stabilityConfigComponent}*/}
{/* {lflytekConfigComponent}*/}
{/* </>*/}
{/* )}*/}
{/* </>*/}