Merge pull request #5181 from webws/feature/support-iflytek-spark

Feature/support iflytek spark
This commit is contained in:
Dogtiti
2024-08-06 19:32:43 +08:00
committed by GitHub
13 changed files with 556 additions and 1 deletions

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}
</>
)}
</>