mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-09 19:46:37 +08:00
Merge branch 'main' of https://github.com/Yidadaa/ChatGPT-Next-Web
This commit is contained in:
commit
d1d1775738
@ -7,7 +7,7 @@ One-Click to deploy well-designed ChatGPT web UI on Vercel.
|
|||||||
|
|
||||||
一键免费部署你的私人 ChatGPT 网页应用。
|
一键免费部署你的私人 ChatGPT 网页应用。
|
||||||
|
|
||||||
[演示 Demo](https://chat-gpt-next-web.vercel.app/) / [反馈 Issues](https://github.com/Yidadaa/ChatGPT-Next-Web/issues) / [Join Discord](https://discord.gg/zrhvHCr79N) / [QQ 群](https://user-images.githubusercontent.com/16968934/228190818-7dd00845-e9b9-4363-97e5-44c507ac76da.jpeg) / [打赏开发者](https://user-images.githubusercontent.com/16968934/227772541-5bcd52d8-61b7-488c-a203-0330d8006e2b.jpg) / [Buy Me a Coffee](https://www.buymeacoffee.com/yidadaa)
|
[演示 Demo](https://chat-gpt-next-web.vercel.app/) / [反馈 Issues](https://github.com/Yidadaa/ChatGPT-Next-Web/issues) / [Join Discord](https://discord.gg/zrhvHCr79N) / [QQ 群](https://user-images.githubusercontent.com/16968934/231095592-330adc52-0337-4c13-8452-938ec169e367.jpeg) / [打赏开发者](https://user-images.githubusercontent.com/16968934/227772541-5bcd52d8-61b7-488c-a203-0330d8006e2b.jpg) / [Buy Me a Coffee](https://www.buymeacoffee.com/yidadaa)
|
||||||
|
|
||||||
[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FYidadaa%2FChatGPT-Next-Web&env=OPENAI_API_KEY&env=CODE&project-name=chatgpt-next-web&repository-name=ChatGPT-Next-Web)
|
[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FYidadaa%2FChatGPT-Next-Web&env=OPENAI_API_KEY&env=CODE&project-name=chatgpt-next-web&repository-name=ChatGPT-Next-Web)
|
||||||
|
|
||||||
@ -20,6 +20,7 @@ One-Click to deploy well-designed ChatGPT web UI on Vercel.
|
|||||||
## Features
|
## Features
|
||||||
|
|
||||||
- **Deploy for free with one-click** on Vercel in under 1 minute
|
- **Deploy for free with one-click** on Vercel in under 1 minute
|
||||||
|
- Privacy first, all data stored locally in the browser
|
||||||
- Responsive design, dark mode and PWA
|
- Responsive design, dark mode and PWA
|
||||||
- Fast first screen loading speed (~100kb)
|
- Fast first screen loading speed (~100kb)
|
||||||
- Awesome prompts powered by [awesome-chatgpt-prompts-zh](https://github.com/PlexPt/awesome-chatgpt-prompts-zh) and [awesome-chatgpt-prompts](https://github.com/f/awesome-chatgpt-prompts)
|
- Awesome prompts powered by [awesome-chatgpt-prompts-zh](https://github.com/PlexPt/awesome-chatgpt-prompts-zh) and [awesome-chatgpt-prompts](https://github.com/f/awesome-chatgpt-prompts)
|
||||||
@ -45,6 +46,7 @@ One-Click to deploy well-designed ChatGPT web UI on Vercel.
|
|||||||
- 在 1 分钟内使用 Vercel **免费一键部署**
|
- 在 1 分钟内使用 Vercel **免费一键部署**
|
||||||
- 精心设计的 UI,响应式设计,支持深色模式,支持 PWA
|
- 精心设计的 UI,响应式设计,支持深色模式,支持 PWA
|
||||||
- 极快的首屏加载速度(~100kb)
|
- 极快的首屏加载速度(~100kb)
|
||||||
|
- 隐私安全,所有数据保存在用户浏览器本地
|
||||||
- 海量的内置 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 的同时支持超长对话
|
||||||
- 一键导出聊天记录,完整的 Markdown 支持
|
- 一键导出聊天记录,完整的 Markdown 支持
|
||||||
|
@ -4,4 +4,4 @@ import type {
|
|||||||
} from "openai";
|
} from "openai";
|
||||||
|
|
||||||
export type ChatRequest = CreateChatCompletionRequest;
|
export type ChatRequest = CreateChatCompletionRequest;
|
||||||
export type ChatReponse = CreateChatCompletionResponse;
|
export type ChatResponse = CreateChatCompletionResponse;
|
||||||
|
@ -73,6 +73,7 @@ const cn = {
|
|||||||
es: "Español",
|
es: "Español",
|
||||||
it: "Italiano",
|
it: "Italiano",
|
||||||
tr: "Türkçe",
|
tr: "Türkçe",
|
||||||
|
jp: "日本語",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Avatar: "头像",
|
Avatar: "头像",
|
||||||
|
@ -76,6 +76,7 @@ const en: LocaleType = {
|
|||||||
es: "Español",
|
es: "Español",
|
||||||
it: "Italiano",
|
it: "Italiano",
|
||||||
tr: "Türkçe",
|
tr: "Türkçe",
|
||||||
|
jp: "日本語",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Avatar: "Avatar",
|
Avatar: "Avatar",
|
||||||
|
@ -76,6 +76,7 @@ const es: LocaleType = {
|
|||||||
es: "Español",
|
es: "Español",
|
||||||
it: "Italiano",
|
it: "Italiano",
|
||||||
tr: "Türkçe",
|
tr: "Türkçe",
|
||||||
|
jp: "日本語",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Avatar: "Avatar",
|
Avatar: "Avatar",
|
||||||
|
@ -4,10 +4,11 @@ import TW from "./tw";
|
|||||||
import ES from "./es";
|
import ES from "./es";
|
||||||
import IT from "./it";
|
import IT from "./it";
|
||||||
import TR from "./tr";
|
import TR from "./tr";
|
||||||
|
import JP from "./jp";
|
||||||
|
|
||||||
export type { LocaleType } from "./cn";
|
export type { LocaleType } from "./cn";
|
||||||
|
|
||||||
export const AllLangs = ["en", "cn", "tw", "es", "it", "tr"] as const;
|
export const AllLangs = ["en", "cn", "tw", "es", "it", "tr", "jp"] as const;
|
||||||
type Lang = (typeof AllLangs)[number];
|
type Lang = (typeof AllLangs)[number];
|
||||||
|
|
||||||
const LANG_KEY = "lang";
|
const LANG_KEY = "lang";
|
||||||
@ -53,6 +54,8 @@ export function getLang(): Lang {
|
|||||||
return "it";
|
return "it";
|
||||||
} else if (lang.includes("tr")) {
|
} else if (lang.includes("tr")) {
|
||||||
return "tr";
|
return "tr";
|
||||||
|
} else if (lang.includes("jp")) {
|
||||||
|
return "jp";
|
||||||
} else {
|
} else {
|
||||||
return "en";
|
return "en";
|
||||||
}
|
}
|
||||||
@ -63,4 +66,6 @@ export function changeLang(lang: Lang) {
|
|||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
export default { en: EN, cn: CN, tw: TW, es: ES, it: IT, tr: TR }[getLang()];
|
export default { en: EN, cn: CN, tw: TW, es: ES, it: IT, tr: TR, jp: JP }[
|
||||||
|
getLang()
|
||||||
|
];
|
||||||
|
@ -76,6 +76,7 @@ const it: LocaleType = {
|
|||||||
es: "Español",
|
es: "Español",
|
||||||
it: "Italiano",
|
it: "Italiano",
|
||||||
tr: "Türkçe",
|
tr: "Türkçe",
|
||||||
|
jp: "日本語",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Avatar: "Avatar",
|
Avatar: "Avatar",
|
||||||
|
182
app/locales/jp.ts
Normal file
182
app/locales/jp.ts
Normal file
@ -0,0 +1,182 @@
|
|||||||
|
import { SubmitKey } from "../store/app";
|
||||||
|
|
||||||
|
const jp = {
|
||||||
|
WIP: "この機能は開発中です……",
|
||||||
|
Error: {
|
||||||
|
Unauthorized:
|
||||||
|
"現在は未承認状態です。左下の設定ボタンをクリックし、アクセスパスワードを入力してください。",
|
||||||
|
},
|
||||||
|
ChatItem: {
|
||||||
|
ChatItemCount: (count: number) => `${count} 通のチャット`,
|
||||||
|
},
|
||||||
|
Chat: {
|
||||||
|
SubTitle: (count: number) => `ChatGPTとの ${count} 通のチャット`,
|
||||||
|
Actions: {
|
||||||
|
ChatList: "メッセージリストを表示",
|
||||||
|
CompressedHistory: "圧縮された履歴プロンプトを表示",
|
||||||
|
Export: "チャット履歴をエクスポート",
|
||||||
|
Copy: "コピー",
|
||||||
|
Stop: "停止",
|
||||||
|
Retry: "リトライ",
|
||||||
|
},
|
||||||
|
Rename: "チャットの名前を変更",
|
||||||
|
Typing: "入力中…",
|
||||||
|
Input: (submitKey: string) => {
|
||||||
|
var inputHints = `${submitKey} で送信`;
|
||||||
|
if (submitKey === String(SubmitKey.Enter)) {
|
||||||
|
inputHints += ",Shift + Enter で改行";
|
||||||
|
}
|
||||||
|
return inputHints + ",/ で自動補完をトリガー";
|
||||||
|
},
|
||||||
|
Send: "送信",
|
||||||
|
},
|
||||||
|
Export: {
|
||||||
|
Title: "チャット履歴をMarkdown形式でエクスポート",
|
||||||
|
Copy: "すべてコピー",
|
||||||
|
Download: "ファイルをダウンロード",
|
||||||
|
MessageFromYou: "あなたからのメッセージ",
|
||||||
|
MessageFromChatGPT: "ChatGPTからのメッセージ",
|
||||||
|
},
|
||||||
|
Memory: {
|
||||||
|
Title: "履歴メモリ",
|
||||||
|
EmptyContent: "まだ記憶されていません",
|
||||||
|
Send: "メモリを送信",
|
||||||
|
Copy: "メモリをコピー",
|
||||||
|
Reset: "チャットをリセット",
|
||||||
|
ResetConfirm:
|
||||||
|
"リセット後、現在のチャット履歴と過去のメモリがクリアされます。リセットしてもよろしいですか?",
|
||||||
|
},
|
||||||
|
Home: {
|
||||||
|
NewChat: "新しいチャット",
|
||||||
|
DeleteChat: "選択したチャットを削除してもよろしいですか?",
|
||||||
|
DeleteToast: "チャットが削除されました",
|
||||||
|
Revert: "元に戻す",
|
||||||
|
},
|
||||||
|
Settings: {
|
||||||
|
Title: "設定",
|
||||||
|
SubTitle: "設定オプション",
|
||||||
|
Actions: {
|
||||||
|
ClearAll: "すべてのデータをクリア",
|
||||||
|
ResetAll: "すべてのオプションをリセット",
|
||||||
|
Close: "閉じる",
|
||||||
|
ConfirmResetAll: {
|
||||||
|
Confirm: "すべての設定をリセットしてもよろしいですか?",
|
||||||
|
},
|
||||||
|
ConfirmClearAll: {
|
||||||
|
Confirm: "すべてのチャットをリセットしてもよろしいですか?",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Lang: {
|
||||||
|
Name: "Language",
|
||||||
|
Options: {
|
||||||
|
cn: "简体中文",
|
||||||
|
en: "English",
|
||||||
|
tw: "繁體中文",
|
||||||
|
es: "Español",
|
||||||
|
it: "Italiano",
|
||||||
|
tr: "Türkçe",
|
||||||
|
jp: "日本語",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Avatar: "アバター",
|
||||||
|
FontSize: {
|
||||||
|
Title: "フォントサイズ",
|
||||||
|
SubTitle: "チャット内容のフォントサイズ",
|
||||||
|
},
|
||||||
|
|
||||||
|
Update: {
|
||||||
|
Version: (x: string) => `現在のバージョン:${x}`,
|
||||||
|
IsLatest: "最新バージョンです",
|
||||||
|
CheckUpdate: "アップデートを確認",
|
||||||
|
IsChecking: "アップデートを確認しています...",
|
||||||
|
FoundUpdate: (x: string) => `新しいバージョンが見つかりました:${x}`,
|
||||||
|
GoToUpdate: "更新する",
|
||||||
|
},
|
||||||
|
SendKey: "送信キー",
|
||||||
|
Theme: "テーマ",
|
||||||
|
TightBorder: "ボーダーレスモード",
|
||||||
|
SendPreviewBubble: "プレビューバブルの送信",
|
||||||
|
Prompt: {
|
||||||
|
Disable: {
|
||||||
|
Title: "プロンプトの自動補完を無効にする",
|
||||||
|
SubTitle:
|
||||||
|
"入力フィールドの先頭に / を入力すると、自動補完がトリガーされます。",
|
||||||
|
},
|
||||||
|
List: "カスタムプロンプトリスト",
|
||||||
|
ListCount: (builtin: number, custom: number) =>
|
||||||
|
`組み込み ${builtin} 件、ユーザー定義 ${custom} 件`,
|
||||||
|
Edit: "編集",
|
||||||
|
},
|
||||||
|
HistoryCount: {
|
||||||
|
Title: "履歴メッセージ数を添付",
|
||||||
|
SubTitle: "リクエストごとに添付する履歴メッセージ数",
|
||||||
|
},
|
||||||
|
CompressThreshold: {
|
||||||
|
Title: "履歴メッセージの長さ圧縮しきい値",
|
||||||
|
SubTitle:
|
||||||
|
"圧縮されていない履歴メッセージがこの値を超えた場合、圧縮が行われます。",
|
||||||
|
},
|
||||||
|
Token: {
|
||||||
|
Title: "APIキー",
|
||||||
|
SubTitle: "自分のキーを使用してパスワードアクセス制限を迂回する",
|
||||||
|
Placeholder: "OpenAI APIキー",
|
||||||
|
},
|
||||||
|
Usage: {
|
||||||
|
Title: "残高照会",
|
||||||
|
SubTitle(used: any, total: any) {
|
||||||
|
return `今月は $${used} を使用しました。総額は $${total} です。`;
|
||||||
|
},
|
||||||
|
IsChecking: "確認中...",
|
||||||
|
Check: "再確認",
|
||||||
|
NoAccess: "APIキーまたはアクセスパスワードを入力して残高を表示",
|
||||||
|
},
|
||||||
|
AccessCode: {
|
||||||
|
Title: "アクセスパスワード",
|
||||||
|
SubTitle: "暗号化アクセスが有効になっています",
|
||||||
|
Placeholder: "アクセスパスワードを入力してください",
|
||||||
|
},
|
||||||
|
Model: "モデル (model)",
|
||||||
|
Temperature: {
|
||||||
|
Title: "ランダム性 (temperature)",
|
||||||
|
SubTitle:
|
||||||
|
"値が大きいほど、回答がランダムになります。1以上の値には文字化けが含まれる可能性があります。",
|
||||||
|
},
|
||||||
|
MaxTokens: {
|
||||||
|
Title: "シングルレスポンス制限 (max_tokens)",
|
||||||
|
SubTitle: "1回のインタラクションで使用される最大トークン数",
|
||||||
|
},
|
||||||
|
PresencePenlty: {
|
||||||
|
Title: "トピックの新鮮度 (presence_penalty)",
|
||||||
|
SubTitle: "値が大きいほど、新しいトピックへの展開が可能になります。",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Store: {
|
||||||
|
DefaultTopic: "新しいチャット",
|
||||||
|
BotHello: "何かお手伝いできることはありますか",
|
||||||
|
Error: "エラーが発生しました。しばらくしてからやり直してください。",
|
||||||
|
Prompt: {
|
||||||
|
History: (content: string) =>
|
||||||
|
"これは、AI とユーザの過去のチャットを要約した前提となるストーリーです:" +
|
||||||
|
content,
|
||||||
|
Topic:
|
||||||
|
"4~5文字でこの文章の簡潔な主題を返してください。説明、句読点、感嘆詞、余分なテキストは無しで。もし主題がない場合は、「おしゃべり」を返してください",
|
||||||
|
Summarize:
|
||||||
|
"あなたとユーザの会話を簡潔にまとめて、後続のコンテキストプロンプトとして使ってください。200字以内に抑えてください。",
|
||||||
|
},
|
||||||
|
ConfirmClearAll:
|
||||||
|
"すべてのチャット、設定データをクリアしてもよろしいですか?",
|
||||||
|
},
|
||||||
|
Copy: {
|
||||||
|
Success: "クリップボードに書き込みました",
|
||||||
|
Failed: "コピーに失敗しました。クリップボード許可を与えてください。",
|
||||||
|
},
|
||||||
|
Context: {
|
||||||
|
Toast: (x: any) => `前置コンテキストが ${x} 件設定されました`,
|
||||||
|
Edit: "前置コンテキストと履歴メモリ",
|
||||||
|
Add: "新規追加",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export type LocaleType = typeof jp;
|
||||||
|
|
||||||
|
export default jp;
|
@ -76,6 +76,7 @@ const tr: LocaleType = {
|
|||||||
es: "Español",
|
es: "Español",
|
||||||
it: "Italiano",
|
it: "Italiano",
|
||||||
tr: "Türkçe",
|
tr: "Türkçe",
|
||||||
|
jp: "日本語",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Avatar: "Avatar",
|
Avatar: "Avatar",
|
||||||
@ -136,11 +137,13 @@ const tr: LocaleType = {
|
|||||||
Model: "Model",
|
Model: "Model",
|
||||||
Temperature: {
|
Temperature: {
|
||||||
Title: "Gerçeklik",
|
Title: "Gerçeklik",
|
||||||
SubTitle: "Daha büyük bir değer girildiğinde gerçeklik oranı düşer ve daha rastgele çıktılar üretir",
|
SubTitle:
|
||||||
|
"Daha büyük bir değer girildiğinde gerçeklik oranı düşer ve daha rastgele çıktılar üretir",
|
||||||
},
|
},
|
||||||
MaxTokens: {
|
MaxTokens: {
|
||||||
Title: "Maksimum Belirteç",
|
Title: "Maksimum Belirteç",
|
||||||
SubTitle: "Girdi belirteçlerinin ve oluşturulan belirteçlerin maksimum uzunluğu",
|
SubTitle:
|
||||||
|
"Girdi belirteçlerinin ve oluşturulan belirteçlerin maksimum uzunluğu",
|
||||||
},
|
},
|
||||||
PresencePenlty: {
|
PresencePenlty: {
|
||||||
Title: "Varlık Cezası",
|
Title: "Varlık Cezası",
|
||||||
@ -161,7 +164,8 @@ const tr: LocaleType = {
|
|||||||
Summarize:
|
Summarize:
|
||||||
"Gelecekteki bağlam için bir bilgi istemi olarak kullanmak üzere tartışmamızı en fazla 200 kelimeyle özetleyin.",
|
"Gelecekteki bağlam için bir bilgi istemi olarak kullanmak üzere tartışmamızı en fazla 200 kelimeyle özetleyin.",
|
||||||
},
|
},
|
||||||
ConfirmClearAll: "Tüm sohbet ve ayar verilerini temizlemeyi onaylıyor musunuz?",
|
ConfirmClearAll:
|
||||||
|
"Tüm sohbet ve ayar verilerini temizlemeyi onaylıyor musunuz?",
|
||||||
},
|
},
|
||||||
Copy: {
|
Copy: {
|
||||||
Success: "Panoya kopyalandı",
|
Success: "Panoya kopyalandı",
|
||||||
|
@ -74,6 +74,7 @@ const tw: LocaleType = {
|
|||||||
es: "Español",
|
es: "Español",
|
||||||
it: "Italiano",
|
it: "Italiano",
|
||||||
tr: "Türkçe",
|
tr: "Türkçe",
|
||||||
|
jp: "日本語",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Avatar: "大頭貼",
|
Avatar: "大頭貼",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { ChatRequest, ChatReponse } from "./api/openai/typing";
|
import type { ChatRequest, ChatResponse } from "./api/openai/typing";
|
||||||
import { Message, ModelConfig, useAccessStore, useChatStore } from "./store";
|
import { Message, ModelConfig, useAccessStore, useChatStore } from "./store";
|
||||||
import { showToast } from "./components/ui-lib";
|
import { showToast } from "./components/ui-lib";
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ export async function requestChat(messages: Message[]) {
|
|||||||
const res = await requestOpenaiClient("v1/chat/completions")(req);
|
const res = await requestOpenaiClient("v1/chat/completions")(req);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = (await res.json()) as ChatReponse;
|
const response = (await res.json()) as ChatResponse;
|
||||||
return response;
|
return response;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("[Request Chat] ", error, res.body);
|
console.error("[Request Chat] ", error, res.body);
|
||||||
|
Loading…
Reference in New Issue
Block a user