Compare commits

..

70 Commits

Author SHA1 Message Date
GH Action - Upstream Sync
f3467d3d43 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-09-13 00:42:12 +00:00
GH Action - Upstream Sync
e5e6070b97 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-09-10 00:42:22 +00:00
GH Action - Upstream Sync
05ae1fc4e9 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-09-09 00:43:58 +00:00
GH Action - Upstream Sync
3b2ac7546b Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-09-08 00:46:30 +00:00
GH Action - Upstream Sync
3ddbbbdc98 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-09-07 00:41:07 +00:00
GH Action - Upstream Sync
97368f54dd Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-09-05 00:41:50 +00:00
GH Action - Upstream Sync
f51a6a6b6e Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-08-30 00:41:30 +00:00
GH Action - Upstream Sync
488bf51b93 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-08-28 00:40:48 +00:00
GH Action - Upstream Sync
91b69c4fb7 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-08-25 00:43:53 +00:00
GH Action - Upstream Sync
3be687a28a Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-08-22 00:40:45 +00:00
GH Action - Upstream Sync
b2e364e6dd Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-08-21 00:39:36 +00:00
GH Action - Upstream Sync
c5ab4d80d1 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-08-20 00:39:42 +00:00
GH Action - Upstream Sync
b9702a7902 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-08-17 00:38:36 +00:00
E.da
09b56c9399 fix: CUSTOM_MODELS optional configuration -all,+xxx causes the custom model to be unusable
`CUSTOM_MODELS ` optional configuration ` -all,+xxx ` causes the custom model to be unusable
2024-08-16 10:50:09 +08:00
GH Action - Upstream Sync
4aae37b90c Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-08-16 00:39:26 +00:00
GH Action - Upstream Sync
2565f5a398 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-08-14 00:39:55 +00:00
GH Action - Upstream Sync
2c0a73049d Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-08-09 00:40:02 +00:00
GH Action - Upstream Sync
57a2ce222c Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-08-08 00:39:37 +00:00
GH Action - Upstream Sync
76eb67d7ac Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-08-07 00:39:54 +00:00
GH Action - Upstream Sync
b07af51649 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-08-06 00:39:22 +00:00
GH Action - Upstream Sync
735b8cd8b0 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-08-04 00:42:56 +00:00
GH Action - Upstream Sync
240058cd32 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-08-03 00:38:27 +00:00
GH Action - Upstream Sync
433c2f37bd Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-08-02 00:39:07 +00:00
GH Action - Upstream Sync
548e39eb82 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-31 00:32:12 +00:00
GH Action - Upstream Sync
84789c5f26 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-30 00:39:17 +00:00
GH Action - Upstream Sync
24ae8b2015 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-27 00:38:37 +00:00
GH Action - Upstream Sync
d6223e45a4 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-26 00:38:46 +00:00
GH Action - Upstream Sync
0a985fe891 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-23 00:39:22 +00:00
GH Action - Upstream Sync
33f63f3463 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-21 00:42:35 +00:00
GH Action - Upstream Sync
770c265567 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-20 00:38:03 +00:00
GH Action - Upstream Sync
89f1daa226 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-19 02:28:09 +00:00
GH Action - Upstream Sync
914c825725 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-18 00:38:19 +00:00
GH Action - Upstream Sync
d8b774ccfe Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-17 00:39:17 +00:00
GH Action - Upstream Sync
af5de8bdb6 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-16 00:39:21 +00:00
GH Action - Upstream Sync
397a7f56d4 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-14 00:42:50 +00:00
GH Action - Upstream Sync
15d9f82081 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-13 00:38:50 +00:00
GH Action - Upstream Sync
ec653812b9 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-12 00:38:18 +00:00
GH Action - Upstream Sync
8159ebe671 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-11 00:39:05 +00:00
GH Action - Upstream Sync
ccd22742f7 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-10 00:38:55 +00:00
GH Action - Upstream Sync
6b078392ee Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-07 00:42:05 +00:00
GH Action - Upstream Sync
741bd325d6 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-06 00:36:48 +00:00
GH Action - Upstream Sync
01b28f76e5 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-05 00:37:51 +00:00
GH Action - Upstream Sync
1e125b2fdd Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-04 00:38:06 +00:00
GH Action - Upstream Sync
9848ef22ec Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-02 00:38:00 +00:00
GH Action - Upstream Sync
7466c75534 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-06-27 00:37:44 +00:00
GH Action - Upstream Sync
3373db8fc7 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-06-25 00:37:18 +00:00
GH Action - Upstream Sync
18d7ec8a01 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-06-08 00:37:12 +00:00
GH Action - Upstream Sync
c6ed7720dc Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-05-28 00:36:26 +00:00
GH Action - Upstream Sync
724b35d7b5 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-05-23 00:35:53 +00:00
GH Action - Upstream Sync
1dd1a80f91 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-05-21 00:36:19 +00:00
GH Action - Upstream Sync
963cdceb83 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-05-17 00:36:04 +00:00
GH Action - Upstream Sync
90bb307486 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-05-16 00:35:30 +00:00
GH Action - Upstream Sync
c67b79785e Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-05-15 00:35:46 +00:00
GH Action - Upstream Sync
c3f91a89b9 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-05-14 00:35:42 +00:00
GH Action - Upstream Sync
9e4518d5ca Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-05-08 00:29:15 +00:00
GH Action - Upstream Sync
d3e801780e Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-05-07 00:35:08 +00:00
GH Action - Upstream Sync
783c314a46 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-05-01 00:37:47 +00:00
GH Action - Upstream Sync
eda303bb0f Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-04-26 00:34:42 +00:00
GH Action - Upstream Sync
ee1658e826 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-04-17 00:34:27 +00:00
GH Action - Upstream Sync
3f21cb5435 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-04-16 00:33:58 +00:00
GH Action - Upstream Sync
9a911fc146 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-04-15 02:54:48 +00:00
GH Action - Upstream Sync
fcf3de17a5 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-04-13 00:29:02 +00:00
GH Action - Upstream Sync
2729326131 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-04-12 00:34:32 +00:00
GH Action - Upstream Sync
f3dcf6ece0 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-04-11 00:34:42 +00:00
GH Action - Upstream Sync
3acd5fb986 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-04-10 00:33:53 +00:00
GH Action - Upstream Sync
c8a97db52e Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-04-09 00:34:26 +00:00
GH Action - Upstream Sync
8e8560417a Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-04-04 00:35:05 +00:00
GH Action - Upstream Sync
101c2602ae Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-03-29 00:33:41 +00:00
GH Action - Upstream Sync
1d8839ae74 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-03-28 00:33:48 +00:00
GH Action - Upstream Sync
3eb6235bf1 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-03-27 00:33:21 +00:00
7 changed files with 18 additions and 46 deletions

View File

@@ -160,7 +160,6 @@ export class ChatGPTApi implements LLMApi {
let requestPayload: RequestPayload | DalleRequestPayload;
const isDalle3 = _isDalle3(options.config.model);
const isO1 = options.config.model.startsWith("o1");
if (isDalle3) {
const prompt = getMessageTextContent(
options.messages.slice(-1)?.pop() as any,
@@ -182,32 +181,30 @@ export class ChatGPTApi implements LLMApi {
const content = visionModel
? await preProcessImageContent(v.content)
: getMessageTextContent(v);
if (!(isO1 && v.role === "system"))
messages.push({ role: v.role, content });
messages.push({ role: v.role, content });
}
// O1 not support image, tools (plugin in ChatGPTNextWeb) and system, stream, logprobs, temperature, top_p, n, presence_penalty, frequency_penalty yet.
requestPayload = {
messages,
stream: !isO1 ? options.config.stream : false,
stream: options.config.stream,
model: modelConfig.model,
temperature: !isO1 ? modelConfig.temperature : 1,
presence_penalty: !isO1 ? modelConfig.presence_penalty : 0,
frequency_penalty: !isO1 ? modelConfig.frequency_penalty : 0,
top_p: !isO1 ? modelConfig.top_p : 1,
temperature: modelConfig.temperature,
presence_penalty: modelConfig.presence_penalty,
frequency_penalty: modelConfig.frequency_penalty,
top_p: modelConfig.top_p,
// max_tokens: Math.max(modelConfig.max_tokens, 1024),
// Please do not ask me why not send max_tokens, no reason, this param is just shit, I dont want to explain anymore.
};
// add max_tokens to vision model
if (visionModel) {
if (visionModel && modelConfig.model.includes("preview")) {
requestPayload["max_tokens"] = Math.max(modelConfig.max_tokens, 4000);
}
}
console.log("[Request] openai payload: ", requestPayload);
const shouldStream = !isDalle3 && !!options.config.stream && !isO1;
const shouldStream = !isDalle3 && !!options.config.stream;
const controller = new AbortController();
options.onController?.(controller);
@@ -316,7 +313,7 @@ export class ChatGPTApi implements LLMApi {
// make a fetch request
const requestTimeoutId = setTimeout(
() => controller.abort(),
isDalle3 || isO1 ? REQUEST_TIMEOUT_MS * 2 : REQUEST_TIMEOUT_MS, // dalle3 using b64_json is slow.
isDalle3 ? REQUEST_TIMEOUT_MS * 2 : REQUEST_TIMEOUT_MS, // dalle3 using b64_json is slow.
);
const res = await fetch(chatPath, chatPayload);

View File

@@ -80,7 +80,7 @@ export const HTMLPreview = forwardRef<HTMLPreviewHander, HTMLPreviewProps>(
}, [props.autoHeight, props.height, iframeHeight]);
const srcDoc = useMemo(() => {
const script = `<script>window.addEventListener("DOMContentLoaded", () => new ResizeObserver((entries) => parent.postMessage({id: '${frameId}', height: entries[0].target.clientHeight}, '*')).observe(document.body))</script>`;
const script = `<script>new ResizeObserver((entries) => parent.postMessage({id: '${frameId}', height: entries[0].target.clientHeight}, '*')).observe(document.body)</script>`;
if (props.code.includes("<!DOCTYPE html>")) {
props.code.replace("<!DOCTYPE html>", "<!DOCTYPE html>" + script);
}

View File

@@ -507,8 +507,6 @@ export function ChatActions(props: {
const currentStyle =
chatStore.currentSession().mask.modelConfig?.style ?? "vivid";
const isMobileScreen = useMobileScreen();
useEffect(() => {
const show = isVisionModel(currentModel);
setShowUploadImage(show);
@@ -763,13 +761,11 @@ export function ChatActions(props: {
/>
)}
{!isMobileScreen && (
<ChatAction
onClick={() => props.setShowShortcutKeyModal(true)}
text={Locale.Chat.ShortcutKey.Title}
icon={<ShortcutkeyIcon />}
/>
)}
<ChatAction
onClick={() => props.setShowShortcutKeyModal(true)}
text={Locale.Chat.ShortcutKey.Title}
icon={<ShortcutkeyIcon />}
/>
</div>
);
}

View File

@@ -237,26 +237,9 @@ function escapeBrackets(text: string) {
);
}
function tryWrapHtmlCode(text: string) {
// try add wrap html code (fixed: html codeblock include 2 newline)
return text
.replace(
/([`]*?)(\w*?)([\n\r]*?)(<!DOCTYPE html>)/g,
(match, quoteStart, lang, newLine, doctype) => {
return !quoteStart ? "\n```html\n" + doctype : match;
},
)
.replace(
/(<\/body>)([\r\n\s]*?)(<\/html>)([\n\r]*?)([`]*?)([\n\r]*?)/g,
(match, bodyEnd, space, htmlEnd, newLine, quoteEnd) => {
return !quoteEnd ? bodyEnd + space + htmlEnd + "\n```\n" : match;
},
);
}
function _MarkDownContent(props: { content: string }) {
const escapedContent = useMemo(() => {
return tryWrapHtmlCode(escapeBrackets(escapeDollarNumber(props.content)));
return escapeBrackets(escapeDollarNumber(props.content));
}, [props.content]);
return (

View File

@@ -250,8 +250,6 @@ export const KnowledgeCutOffDate: Record<string, string> = {
"gpt-4o-mini": "2023-10",
"gpt-4o-mini-2024-07-18": "2023-10",
"gpt-4-vision-preview": "2023-04",
"o1-mini": "2023-10",
"o1-preview": "2023-10",
// After improvements,
// it's now easier to add "KnowledgeCutOffDate" instead of stupid hardcoding it, as was done previously.
"gemini-pro": "2023-12",
@@ -278,8 +276,6 @@ const openaiModels = [
"gpt-4-turbo-2024-04-09",
"gpt-4-1106-preview",
"dall-e-3",
"o1-mini",
"o1-preview"
];
const googleModels = [

View File

@@ -8,7 +8,7 @@ export function useAllModels() {
const models = useMemo(() => {
return collectModelsWithDefaultModel(
configStore.models,
[configStore.customModels, accessStore.customModels].join(","),
[accessStore.customModels, configStore.customModels].join(","),
accessStore.defaultModel,
);
}, [

View File

@@ -9,7 +9,7 @@
},
"package": {
"productName": "NextChat",
"version": "2.15.2"
"version": "2.15.1"
},
"tauri": {
"allowlist": {