This commit is contained in:
GH Action - Upstream Sync 2023-11-27 18:00:37 +00:00
commit beb6a53382
6 changed files with 38 additions and 22 deletions

View File

@ -75,7 +75,7 @@ One-Click to get well-designed cross-platform ChatGPT web UI.
- 预制角色功能(面具),方便地创建、分享和调试你的个性化对话 - 预制角色功能(面具),方便地创建、分享和调试你的个性化对话
- 海量的内置 prompt 列表,来自[中文](https://github.com/PlexPt/awesome-chatgpt-prompts-zh)和[英文](https://github.com/f/awesome-chatgpt-prompts) - 海量的内置 prompt 列表,来自[中文](https://github.com/PlexPt/awesome-chatgpt-prompts-zh)和[英文](https://github.com/f/awesome-chatgpt-prompts)
- 自动压缩上下文聊天记录,在节省 Token 的同时支持超长对话 - 自动压缩上下文聊天记录,在节省 Token 的同时支持超长对话
- 多国语言支持English, 简体中文, 繁体中文, 日本語, Español, Italiano, Türkçe, Deutsch, Tiếng Việt, Русский, Čeština - 多国语言支持English, 简体中文, 繁体中文, 日本語, Español, Italiano, Türkçe, Deutsch, Tiếng Việt, Русский, Čeština, 한국어, Indonesia
- 拥有自己的域名?好上加好,绑定后即可在任何地方**无障碍**快速访问 - 拥有自己的域名?好上加好,绑定后即可在任何地方**无障碍**快速访问
## 开发计划 ## 开发计划
@ -348,6 +348,7 @@ If you want to add a new translation, read this [document](./docs/translation.md
[@wenjiavv](https://github.com/wenjiavv) [@wenjiavv](https://github.com/wenjiavv)
[@LeXwDeX](https://github.com/LeXwDeX) [@LeXwDeX](https://github.com/LeXwDeX)
[@Licoy](https://github.com/Licoy) [@Licoy](https://github.com/Licoy)
[@shangmin2009](https://github.com/shangmin2009)
### Contributor ### Contributor

View File

@ -30,7 +30,10 @@ export async function requestOpenai(req: NextRequest) {
console.log("[Proxy] ", path); console.log("[Proxy] ", path);
console.log("[Base Url]", baseUrl); console.log("[Base Url]", baseUrl);
console.log("[Org ID]", serverConfig.openaiOrgId); // this fix [Org ID] undefined in server side if not using custom point
if (serverConfig.openaiOrgId !== undefined) {
console.log("[Org ID]", serverConfig.openaiOrgId);
}
const timeoutId = setTimeout( const timeoutId = setTimeout(
() => { () => {

View File

@ -449,8 +449,7 @@ export function ChatActions(props: {
); );
showToast(nextModel); showToast(nextModel);
} }
// eslint-disable-next-line react-hooks/exhaustive-deps }, [chatStore, currentModel, models]);
}, [currentModel, models]);
return ( return (
<div className={styles["chat-input-actions"]}> <div className={styles["chat-input-actions"]}>

View File

@ -635,6 +635,11 @@ export function Settings() {
navigate(Path.Home); navigate(Path.Home);
} }
}; };
if (clientConfig?.isApp) { // Force to set custom endpoint to true if it's app
accessStore.update((state) => {
state.useCustomConfig = true;
});
}
document.addEventListener("keydown", keydownEvent); document.addEventListener("keydown", keydownEvent);
return () => { return () => {
document.removeEventListener("keydown", keydownEvent); document.removeEventListener("keydown", keydownEvent);
@ -909,21 +914,26 @@ export function Settings() {
{!accessStore.hideUserApiKey && ( {!accessStore.hideUserApiKey && (
<> <>
<ListItem {
title={Locale.Settings.Access.CustomEndpoint.Title} // Conditionally render the following ListItem based on clientConfig.isApp
subTitle={Locale.Settings.Access.CustomEndpoint.SubTitle} !clientConfig?.isApp && ( // only show if isApp is false
> <ListItem
<input title={Locale.Settings.Access.CustomEndpoint.Title}
type="checkbox" subTitle={Locale.Settings.Access.CustomEndpoint.SubTitle}
checked={accessStore.useCustomConfig} >
onChange={(e) => <input
accessStore.update( type="checkbox"
(access) => checked={accessStore.useCustomConfig}
(access.useCustomConfig = e.currentTarget.checked), onChange={(e) =>
) accessStore.update(
} (access) =>
></input> (access.useCustomConfig = e.currentTarget.checked),
</ListItem> )
}
></input>
</ListItem>
)
}
{accessStore.useCustomConfig && ( {accessStore.useCustomConfig && (
<> <>
<ListItem <ListItem

View File

@ -1,10 +1,10 @@
import { SubmitKey } from "../store/config"; import { SubmitKey } from "../store/config";
import { LocaleType } from "../locales/index"; import { PartialLocaleType } from "../locales/index";
import { getClientConfig } from "../config/client"; import { getClientConfig } from "../config/client";
const isApp = !!getClientConfig()?.isApp; const isApp = !!getClientConfig()?.isApp;
const pt: LocaleType = { const pt: PartialLocaleType = {
WIP: "Em breve...", WIP: "Em breve...",
Error: { Error: {
Unauthorized: isApp Unauthorized: isApp

View File

@ -557,7 +557,10 @@ export const useChatStore = createPersistStore(
}, },
onFinish(message) { onFinish(message) {
console.log("[Memory] ", message); console.log("[Memory] ", message);
session.lastSummarizeIndex = lastSummarizeIndex; get().updateCurrentSession((session) => {
session.lastSummarizeIndex = lastSummarizeIndex;
session.memoryPrompt = message; // Update the memory prompt for stored it in local storage
});
}, },
onError(err) { onError(err) {
console.error("[Summarize] ", err); console.error("[Summarize] ", err);