mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-04 17:16:39 +08:00
Merge branch 'Yidadaa:main' into main
This commit is contained in:
commit
8d49a04e21
@ -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
|
||||||
- 拥有自己的域名?好上加好,绑定后即可在任何地方**无障碍**快速访问
|
- 拥有自己的域名?好上加好,绑定后即可在任何地方**无障碍**快速访问
|
||||||
|
|
||||||
## 开发计划
|
## 开发计划
|
||||||
@ -346,6 +346,9 @@ If you want to add a new translation, read this [document](./docs/translation.md
|
|||||||
[@piksonGit](https://github.com/piksonGit)
|
[@piksonGit](https://github.com/piksonGit)
|
||||||
[@ouyangzhiping](https://github.com/ouyangzhiping)
|
[@ouyangzhiping](https://github.com/ouyangzhiping)
|
||||||
[@wenjiavv](https://github.com/wenjiavv)
|
[@wenjiavv](https://github.com/wenjiavv)
|
||||||
|
[@LeXwDeX](https://github.com/LeXwDeX)
|
||||||
|
[@Licoy](https://github.com/Licoy)
|
||||||
|
[@shangmin2009](https://github.com/shangmin2009)
|
||||||
|
|
||||||
### Contributor
|
### Contributor
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ Azure Api 版本,你可以在这里找到:[Azure 文档](https://learn.micro
|
|||||||
OPENAI_API_KEY=<your api key here>
|
OPENAI_API_KEY=<your api key here>
|
||||||
|
|
||||||
# 中国大陆用户,可以使用本项目自带的代理进行开发,你也可以自由选择其他代理地址
|
# 中国大陆用户,可以使用本项目自带的代理进行开发,你也可以自由选择其他代理地址
|
||||||
BASE_URL=https://a.nextweb.fun/api/proxy
|
BASE_URL=https://b.nextweb.fun/api/proxy
|
||||||
```
|
```
|
||||||
|
|
||||||
### 本地开发
|
### 本地开发
|
||||||
|
@ -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(
|
||||||
() => {
|
() => {
|
||||||
|
@ -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"]}>
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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);
|
||||||
|
@ -3,7 +3,10 @@ import { showToast } from "./components/ui-lib";
|
|||||||
import Locale from "./locales";
|
import Locale from "./locales";
|
||||||
|
|
||||||
export function trimTopic(topic: string) {
|
export function trimTopic(topic: string) {
|
||||||
return topic.replace(/[,。!?”“"、,.!?]*$/, "");
|
// Fix an issue where double quotes still show in the Indonesian language
|
||||||
|
// This will remove the specified punctuation from the end of the string
|
||||||
|
// and also trim quotes from both the start and end if they exist.
|
||||||
|
return topic.replace(/^["“”]+|["“”]+$/g, "").replace(/[,。!?”“"、,.!?]*$/, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function copyToClipboard(text: string) {
|
export async function copyToClipboard(text: string) {
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
},
|
},
|
||||||
"package": {
|
"package": {
|
||||||
"productName": "ChatGPT Next Web",
|
"productName": "ChatGPT Next Web",
|
||||||
"version": "2.9.12"
|
"version": "2.9.13"
|
||||||
},
|
},
|
||||||
"tauri": {
|
"tauri": {
|
||||||
"allowlist": {
|
"allowlist": {
|
||||||
|
Loading…
Reference in New Issue
Block a user