mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-05-24 22:50:22 +09:00
Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web
This commit is contained in:
commit
40d8c26cce
@ -14,7 +14,7 @@ function getModels(remoteModelRes: OpenAIListModelResponse) {
|
|||||||
if (config.disableGPT4) {
|
if (config.disableGPT4) {
|
||||||
remoteModelRes.data = remoteModelRes.data.filter(
|
remoteModelRes.data = remoteModelRes.data.filter(
|
||||||
(m) =>
|
(m) =>
|
||||||
!(m.id.startsWith("gpt-4") || m.id.startsWith("chatgpt-4o")) ||
|
!(m.id.startsWith("gpt-4") || m.id.startsWith("chatgpt-4o") || m.id.startsWith("o1")) ||
|
||||||
m.id.startsWith("gpt-4o-mini"),
|
m.id.startsWith("gpt-4o-mini"),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -224,7 +224,7 @@ export class ChatGPTApi implements LLMApi {
|
|||||||
// O1 not support image, tools (plugin in ChatGPTNextWeb) and system, stream, logprobs, temperature, top_p, n, presence_penalty, frequency_penalty yet.
|
// O1 not support image, tools (plugin in ChatGPTNextWeb) and system, stream, logprobs, temperature, top_p, n, presence_penalty, frequency_penalty yet.
|
||||||
requestPayload = {
|
requestPayload = {
|
||||||
messages,
|
messages,
|
||||||
stream: !isO1 ? options.config.stream : false,
|
stream: options.config.stream,
|
||||||
model: modelConfig.model,
|
model: modelConfig.model,
|
||||||
temperature: !isO1 ? modelConfig.temperature : 1,
|
temperature: !isO1 ? modelConfig.temperature : 1,
|
||||||
presence_penalty: !isO1 ? modelConfig.presence_penalty : 0,
|
presence_penalty: !isO1 ? modelConfig.presence_penalty : 0,
|
||||||
@ -247,7 +247,7 @@ export class ChatGPTApi implements LLMApi {
|
|||||||
|
|
||||||
console.log("[Request] openai payload: ", requestPayload);
|
console.log("[Request] openai payload: ", requestPayload);
|
||||||
|
|
||||||
const shouldStream = !isDalle3 && !!options.config.stream && !isO1;
|
const shouldStream = !isDalle3 && !!options.config.stream;
|
||||||
const controller = new AbortController();
|
const controller = new AbortController();
|
||||||
options.onController?.(controller);
|
options.onController?.(controller);
|
||||||
|
|
||||||
|
@ -37,7 +37,8 @@ export function Avatar(props: { model?: ModelType; avatar?: string }) {
|
|||||||
return (
|
return (
|
||||||
<div className="no-dark">
|
<div className="no-dark">
|
||||||
{props.model?.startsWith("gpt-4") ||
|
{props.model?.startsWith("gpt-4") ||
|
||||||
props.model?.startsWith("chatgpt-4o") ? (
|
props.model?.startsWith("chatgpt-4o") ||
|
||||||
|
props.model?.startsWith("o1") ? (
|
||||||
<BlackBotIcon className="user-avatar" />
|
<BlackBotIcon className="user-avatar" />
|
||||||
) : (
|
) : (
|
||||||
<BotIcon className="user-avatar" />
|
<BotIcon className="user-avatar" />
|
||||||
|
@ -129,14 +129,15 @@ export const getServerSideConfig = () => {
|
|||||||
if (customModels) customModels += ",";
|
if (customModels) customModels += ",";
|
||||||
customModels += DEFAULT_MODELS.filter(
|
customModels += DEFAULT_MODELS.filter(
|
||||||
(m) =>
|
(m) =>
|
||||||
(m.name.startsWith("gpt-4") || m.name.startsWith("chatgpt-4o")) &&
|
(m.name.startsWith("gpt-4") || m.name.startsWith("chatgpt-4o") || m.name.startsWith("o1")) &&
|
||||||
!m.name.startsWith("gpt-4o-mini"),
|
!m.name.startsWith("gpt-4o-mini"),
|
||||||
)
|
)
|
||||||
.map((m) => "-" + m.name)
|
.map((m) => "-" + m.name)
|
||||||
.join(",");
|
.join(",");
|
||||||
if (
|
if (
|
||||||
(defaultModel.startsWith("gpt-4") ||
|
(defaultModel.startsWith("gpt-4") ||
|
||||||
defaultModel.startsWith("chatgpt-4o")) &&
|
defaultModel.startsWith("chatgpt-4o") ||
|
||||||
|
defaultModel.startsWith("o1")) &&
|
||||||
!defaultModel.startsWith("gpt-4o-mini")
|
!defaultModel.startsWith("gpt-4o-mini")
|
||||||
)
|
)
|
||||||
defaultModel = "";
|
defaultModel = "";
|
||||||
|
Loading…
Reference in New Issue
Block a user