@@ -904,46 +1287,12 @@ export function Settings() {
- {showAccessCode && (
-
- {
- accessStore.update(
- (access) => (access.accessCode = e.currentTarget.value),
- );
- }}
- />
-
- )}
+ {accessCodeComponent}
{!accessStore.hideUserApiKey && (
<>
- {
- // Conditionally render the following ListItem based on clientConfig.isApp
- !clientConfig?.isApp && ( // only show if isApp is false
-
-
- accessStore.update(
- (access) =>
- (access.useCustomConfig = e.currentTarget.checked),
- )
- }
- >
-
- )
- }
+ {useCustomConfigComponent}
+
{accessStore.useCustomConfig && (
<>
- {accessStore.provider === ServiceProvider.OpenAI && (
- <>
-
-
- accessStore.update(
- (access) =>
- (access.openaiUrl = e.currentTarget.value),
- )
- }
- >
-
-
- {
- accessStore.update(
- (access) =>
- (access.openaiApiKey = e.currentTarget.value),
- );
- }}
- />
-
- >
- )}
- {accessStore.provider === ServiceProvider.Azure && (
- <>
-
-
- accessStore.update(
- (access) =>
- (access.azureUrl = e.currentTarget.value),
- )
- }
- >
-
-
- {
- accessStore.update(
- (access) =>
- (access.azureApiKey = e.currentTarget.value),
- );
- }}
- />
-
-
-
- accessStore.update(
- (access) =>
- (access.azureApiVersion =
- e.currentTarget.value),
- )
- }
- >
-
- >
- )}
- {accessStore.provider === ServiceProvider.Google && (
- <>
-
-
- accessStore.update(
- (access) =>
- (access.googleUrl = e.currentTarget.value),
- )
- }
- >
-
-
- {
- accessStore.update(
- (access) =>
- (access.googleApiKey = e.currentTarget.value),
- );
- }}
- />
-
-
-
- accessStore.update(
- (access) =>
- (access.googleApiVersion =
- e.currentTarget.value),
- )
- }
- >
-
-
-
-
- >
- )}
- {accessStore.provider === ServiceProvider.Anthropic && (
- <>
-
-
- accessStore.update(
- (access) =>
- (access.anthropicUrl = e.currentTarget.value),
- )
- }
- >
-
-
- {
- accessStore.update(
- (access) =>
- (access.anthropicApiKey =
- e.currentTarget.value),
- );
- }}
- />
-
-
-
- accessStore.update(
- (access) =>
- (access.anthropicApiVersion =
- e.currentTarget.value),
- )
- }
- >
-
- >
- )}
- {accessStore.provider === ServiceProvider.Baidu && (
- <>
-
-
- accessStore.update(
- (access) =>
- (access.baiduUrl = e.currentTarget.value),
- )
- }
- >
-
-
- {
- accessStore.update(
- (access) =>
- (access.baiduApiKey = e.currentTarget.value),
- );
- }}
- />
-
-
- {
- accessStore.update(
- (access) =>
- (access.baiduSecretKey = e.currentTarget.value),
- );
- }}
- />
-
- >
- )}
-
- {accessStore.provider === ServiceProvider.ByteDance && (
- <>
-
-
- accessStore.update(
- (access) =>
- (access.bytedanceUrl = e.currentTarget.value),
- )
- }
- >
-
-
- {
- accessStore.update(
- (access) =>
- (access.bytedanceApiKey =
- e.currentTarget.value),
- );
- }}
- />
-
- >
- )}
-
- {accessStore.provider === ServiceProvider.Alibaba && (
- <>
-
-
- accessStore.update(
- (access) =>
- (access.alibabaUrl = e.currentTarget.value),
- )
- }
- >
-
-
- {
- accessStore.update(
- (access) =>
- (access.alibabaApiKey = e.currentTarget.value),
- );
- }}
- />
-
- >
- )}
+ {openAIConfigComponent}
+ {azureConfigComponent}
+ {googleConfigComponent}
+ {anthropicConfigComponent}
+ {baiduConfigComponent}
+ {byteDanceConfigComponent}
+ {alibabaConfigComponent}
>
)}
>