forked from XiaoMo/ChatGPT-Next-Web
Merge branch 'Yidadaa:main' into main
This commit is contained in:
commit
5bbe59c9a2
@ -50,6 +50,8 @@ CMD if [ -n "$PROXY_URL" ]; then \
|
||||
echo "remote_dns_subnet 224" >> $conf; \
|
||||
echo "tcp_read_time_out 15000" >> $conf; \
|
||||
echo "tcp_connect_time_out 8000" >> $conf; \
|
||||
echo "localnet 127.0.0.0/255.0.0.0" >> $conf; \
|
||||
echo "localnet ::1/128" >> $conf; \
|
||||
echo "[ProxyList]" >> $conf; \
|
||||
echo "$protocol $host $port" >> $conf; \
|
||||
cat /etc/proxychains.conf; \
|
||||
|
@ -3,7 +3,10 @@ import { useAccessStore, useAppConfig, useChatStore } from "@/app/store";
|
||||
|
||||
import { ChatOptions, getHeaders, LLMApi, LLMUsage } from "../api";
|
||||
import Locale from "../../locales";
|
||||
import { fetchEventSource } from "@microsoft/fetch-event-source";
|
||||
import {
|
||||
EventStreamContentType,
|
||||
fetchEventSource,
|
||||
} from "@microsoft/fetch-event-source";
|
||||
import { prettyObject } from "@/app/utils/format";
|
||||
|
||||
export class ChatGPTApi implements LLMApi {
|
||||
@ -79,6 +82,13 @@ export class ChatGPTApi implements LLMApi {
|
||||
...chatPayload,
|
||||
async onopen(res) {
|
||||
clearTimeout(requestTimeoutId);
|
||||
if (
|
||||
res.ok &&
|
||||
res.headers.get("content-type") !== EventStreamContentType
|
||||
) {
|
||||
responseText += await res.clone().json();
|
||||
return finish();
|
||||
}
|
||||
if (res.status === 401) {
|
||||
let extraInfo = { error: undefined };
|
||||
try {
|
||||
|
@ -68,8 +68,8 @@ export function ModelConfigList(props: {
|
||||
></input>
|
||||
</ListItem>
|
||||
<ListItem
|
||||
title={Locale.Settings.PresencePenlty.Title}
|
||||
subTitle={Locale.Settings.PresencePenlty.SubTitle}
|
||||
title={Locale.Settings.PresencePenalty.Title}
|
||||
subTitle={Locale.Settings.PresencePenalty.SubTitle}
|
||||
>
|
||||
<InputRange
|
||||
value={props.modelConfig.presence_penalty?.toFixed(1)}
|
||||
|
@ -164,7 +164,7 @@ const cn = {
|
||||
Title: "单次回复限制 (max_tokens)",
|
||||
SubTitle: "单次交互所用的最大 Token 数",
|
||||
},
|
||||
PresencePenlty: {
|
||||
PresencePenalty: {
|
||||
Title: "话题新鲜度 (presence_penalty)",
|
||||
SubTitle: "值越大,越有可能扩展到新话题",
|
||||
},
|
||||
|
@ -165,7 +165,7 @@ const cs: LocaleType = {
|
||||
Title: "Max. počet tokenů",
|
||||
SubTitle: "Maximální délka vstupního tokenu a generovaných tokenů",
|
||||
},
|
||||
PresencePenlty: {
|
||||
PresencePenalty: {
|
||||
Title: "Přítomnostní korekce",
|
||||
SubTitle: "Větší hodnota zvyšuje pravděpodobnost nových témat.",
|
||||
},
|
||||
|
@ -167,7 +167,7 @@ const de: LocaleType = {
|
||||
Title: "Max Tokens", //Maximale Token
|
||||
SubTitle: "Maximale Anzahl der Anfrage- plus Antwort-Token",
|
||||
},
|
||||
PresencePenlty: {
|
||||
PresencePenalty: {
|
||||
Title: "Presence Penalty", //Anwesenheitsstrafe
|
||||
SubTitle:
|
||||
"Ein größerer Wert erhöht die Wahrscheinlichkeit, dass über neue Themen gesprochen wird",
|
||||
|
@ -165,7 +165,7 @@ const en: LocaleType = {
|
||||
Title: "Max Tokens",
|
||||
SubTitle: "Maximum length of input tokens and generated tokens",
|
||||
},
|
||||
PresencePenlty: {
|
||||
PresencePenalty: {
|
||||
Title: "Presence Penalty",
|
||||
SubTitle:
|
||||
"A larger value increases the likelihood to talk about new topics",
|
||||
|
@ -165,7 +165,7 @@ const es: LocaleType = {
|
||||
Title: "Máximo de tokens",
|
||||
SubTitle: "Longitud máxima de tokens de entrada y tokens generados",
|
||||
},
|
||||
PresencePenlty: {
|
||||
PresencePenalty: {
|
||||
Title: "Penalización de presencia",
|
||||
SubTitle:
|
||||
"Un valor mayor aumenta la probabilidad de hablar sobre nuevos temas",
|
||||
|
@ -166,7 +166,7 @@ const it: LocaleType = {
|
||||
Title: "Token massimi",
|
||||
SubTitle: "Lunghezza massima dei token in ingresso e dei token generati",
|
||||
},
|
||||
PresencePenlty: {
|
||||
PresencePenalty: {
|
||||
Title: "Penalità di presenza",
|
||||
SubTitle:
|
||||
"Un valore maggiore aumenta la probabilità di parlare di nuovi argomenti",
|
||||
|
@ -168,7 +168,7 @@ const jp: LocaleType = {
|
||||
Title: "シングルレスポンス制限 (max_tokens)",
|
||||
SubTitle: "1回のインタラクションで使用される最大トークン数",
|
||||
},
|
||||
PresencePenlty: {
|
||||
PresencePenalty: {
|
||||
Title: "トピックの新鮮度 (presence_penalty)",
|
||||
SubTitle: "値が大きいほど、新しいトピックへの展開が可能になります。",
|
||||
},
|
||||
|
@ -166,7 +166,7 @@ const ru: LocaleType = {
|
||||
Title: "Максимальное количество токенов",
|
||||
SubTitle: "Максимальная длина вводных и генерируемых токенов",
|
||||
},
|
||||
PresencePenlty: {
|
||||
PresencePenalty: {
|
||||
Title: "Штраф за повторения",
|
||||
SubTitle:
|
||||
"Чем выше значение, тем больше вероятность общения на новые темы",
|
||||
|
@ -167,7 +167,7 @@ const tr: LocaleType = {
|
||||
SubTitle:
|
||||
"Girdi belirteçlerinin ve oluşturulan belirteçlerin maksimum uzunluğu",
|
||||
},
|
||||
PresencePenlty: {
|
||||
PresencePenalty: {
|
||||
Title: "Varlık Cezası",
|
||||
SubTitle:
|
||||
"Daha büyük bir değer, yeni konular hakkında konuşma olasılığını artırır",
|
||||
|
@ -162,7 +162,7 @@ const tw: LocaleType = {
|
||||
Title: "單次回應限制 (max_tokens)",
|
||||
SubTitle: "單次互動所用的最大 Token 數",
|
||||
},
|
||||
PresencePenlty: {
|
||||
PresencePenalty: {
|
||||
Title: "話題新穎度 (presence_penalty)",
|
||||
SubTitle: "值越大,越有可能擴展到新話題",
|
||||
},
|
||||
|
@ -164,7 +164,7 @@ const vi: LocaleType = {
|
||||
Title: "Giới hạn số lượng token (max_tokens)",
|
||||
SubTitle: "Số lượng token tối đa được sử dụng trong mỗi lần tương tác",
|
||||
},
|
||||
PresencePenlty: {
|
||||
PresencePenalty: {
|
||||
Title: "Chủ đề mới (presence_penalty)",
|
||||
SubTitle: "Giá trị càng lớn tăng khả năng mở rộng sang các chủ đề mới",
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user