feat: add model config to settings

This commit is contained in:
Yifei Zhang
2023-03-21 16:20:32 +00:00
parent 4af8c26d02
commit 2f112ecc54
7 changed files with 517 additions and 258 deletions

View File

@@ -1,72 +1,93 @@
const cn = {
ChatItem: {
ChatItemCount: (count: number) => `${count} 条对话`,
ChatItem: {
ChatItemCount: (count: number) => `${count} 条对话`,
},
Chat: {
SubTitle: (count: number) => `与 ChatGPT 的 ${count} 条对话`,
Actions: {
ChatList: "查看消息列表",
CompressedHistory: "查看压缩后的历史 Prompt",
Export: "导出聊天记录",
},
Chat: {
SubTitle: (count: number) => `与 ChatGPT 的 ${count} 条对话`,
Actions: {
ChatList: '查看消息列表',
CompressedHistory: '查看压缩后的历史 Prompt',
Export: '导出聊天记录',
},
Typing: '正在输入…',
Input: (submitKey: string) => `输入消息,${submitKey} 发送`,
Send: '发送',
Typing: "正在输入…",
Input: (submitKey: string) => `输入消息,${submitKey} 发送`,
Send: "发送",
},
Export: {
Title: "导出聊天记录为 Markdown",
Copy: "全部复制",
Download: "下载文件",
},
Memory: {
Title: "上下文记忆 Prompt",
EmptyContent: "尚未记忆",
Copy: "全部复制",
},
Home: {
NewChat: "新的聊天",
DeleteChat: "确认删除选中的对话?",
},
Settings: {
Title: "设置",
SubTitle: "设置选项",
Actions: {
ClearAll: "清除所有数据",
ResetAll: "重置所有选项",
Close: "关闭",
},
Export: {
Title: '导出聊天记录为 Markdown',
Copy: '全部复制',
Download: '下载文件',
Lang: {
Name: "Language",
Options: {
cn: "中文",
en: "English",
},
},
Memory: {
Title: '上下文记忆 Prompt',
EmptyContent: '尚未记忆',
Copy: '全部复制',
Avatar: "头像",
SendKey: "发送键",
Theme: "主题",
TightBorder: "紧凑边框",
HistoryCount: {
Title: "附带历史消息数",
SubTitle: "每次请求携带的历史消息数",
},
Home: {
NewChat: '新的聊天',
DeleteChat: '确认删除选中的对话?',
CompressThreshold: {
Title: "历史消息长度压缩阈值",
SubTitle: "当未压缩的历史消息超过该值时,将进行压缩",
},
Settings: {
Title: '设置',
SubTitle: '设置选项',
Actions: {
ClearAll: '清除所有数据',
ResetAll: '重置所有选项',
Close: '关闭',
},
Lang: {
Name: 'Language',
Options: {
cn: '中文',
en: 'English'
}
},
Avatar: '头像',
SendKey: '发送键',
Theme: '主题',
TightBorder: '紧凑边框',
HistoryCount: '附带历史消息数',
CompressThreshold: '历史消息长度压缩阈值',
Model: "模型 (model)",
Temperature: {
Title: "随机性 (temperature)",
SubTitle: "值越大,回复越随机",
},
Store: {
DefaultTopic: '新的聊天',
BotHello: '有什么可以帮你的吗',
Error: '出错了,稍后重试吧',
Prompt: {
History: (content: string) => '这是 ai 和用户的历史聊天总结作为前情提要:' + content,
Topic: "直接返回这句话的简要主题,不要解释,如果没有主题,请直接返回“闲聊”",
Summarize: '简要总结一下你和用户的对话,用作后续的上下文提示 prompt控制在 50 字以内',
},
ConfirmClearAll: '确认清除所有聊天、设置数据?',
MaxTokens: {
Title: "单次回复限制 (max_tokens)",
SubTitle: "单次交互所用的最大 Token 数",
},
Copy: {
Success: '已写入剪切板',
Failed: '复制失败,请赋予剪切板权限',
}
}
PresencePenlty: {
Title: "话题新鲜度 (presence_penalty)",
SubTitle: "值越大,越有可能扩展到新话题",
},
},
Store: {
DefaultTopic: "新的聊天",
BotHello: "有什么可以帮你的吗",
Error: "出错了,稍后重试吧",
Prompt: {
History: (content: string) =>
"这是 ai 和用户的历史聊天总结作为前情提要:" + content,
Topic:
"直接返回这句话的简要主题,不要解释,如果没有主题,请直接返回“闲聊”",
Summarize:
"简要总结一下你和用户的对话,用作后续的上下文提示 prompt控制在 50 字以内",
},
ConfirmClearAll: "确认清除所有聊天、设置数据?",
},
Copy: {
Success: "已写入剪切板",
Failed: "复制失败,请赋予剪切板权限",
},
};
export type LocaleType = typeof cn;
export default cn;
export default cn;

View File

@@ -1,71 +1,97 @@
import type { LocaleType } from './index'
import type { LocaleType } from "./index";
const en: LocaleType = {
ChatItem: {
ChatItemCount: (count: number) => `${count} messages`,
ChatItem: {
ChatItemCount: (count: number) => `${count} messages`,
},
Chat: {
SubTitle: (count: number) => `${count} messages with ChatGPT`,
Actions: {
ChatList: "Go To Chat List",
CompressedHistory: "Compressed History Memory Prompt",
Export: "Export All Messages as Markdown",
},
Chat: {
SubTitle: (count: number) => `${count} messages with ChatGPT`,
Actions: {
ChatList: 'Go To Chat List',
CompressedHistory: 'Compressed History Memory Prompt',
Export: 'Export All Messages as Markdown',
},
Typing: 'Typing…',
Input: (submitKey: string) => `Type something and press ${submitKey} to send`,
Send: 'Send',
Typing: "Typing…",
Input: (submitKey: string) =>
`Type something and press ${submitKey} to send`,
Send: "Send",
},
Export: {
Title: "All Messages",
Copy: "Copy All",
Download: "Download",
},
Memory: {
Title: "Memory Prompt",
EmptyContent: "Nothing yet.",
Copy: "Copy All",
},
Home: {
NewChat: "New Chat",
DeleteChat: "Confirm to delete the selected conversation?",
},
Settings: {
Title: "Settings",
SubTitle: "All Settings",
Actions: {
ClearAll: "Clear All Data",
ResetAll: "Reset All Settings",
Close: "Close",
},
Export: {
Title: 'All Messages',
Copy: 'Copy All',
Download: 'Download',
Lang: {
Name: "语言",
Options: {
cn: "中文",
en: "English",
},
},
Memory: {
Title: 'Memory Prompt',
EmptyContent: 'Nothing yet.',
Copy: 'Copy All',
Avatar: "Avatar",
SendKey: "Send Key",
Theme: "Theme",
TightBorder: "Tight Border",
HistoryCount: {
Title: "Attached Messages Count",
SubTitle: "Number of sent messages attached per request",
},
Home: {
NewChat: 'New Chat',
DeleteChat: 'Confirm to delete the selected conversation?',
CompressThreshold: {
Title: "History Compression Threshold",
SubTitle:
"Will compress if uncompressed messages length exceeds the value",
},
Settings: {
Title: 'Settings',
SubTitle: 'All Settings',
Actions: {
ClearAll: 'Clear All Data',
ResetAll: 'Reset All Settings',
Close: 'Close',
},
Lang: {
Name: '语言',
Options: {
cn: '中文',
en: 'English'
}
},
Avatar: 'Avatar',
SendKey: 'Send Key',
Theme: 'Theme',
TightBorder: 'Tight Border',
HistoryCount: 'History Message Count',
CompressThreshold: 'Message Compression Threshold',
Model: "Model",
Temperature: {
Title: "Temperature",
SubTitle: "A larger value makes the more random output",
},
Store: {
DefaultTopic: 'New Conversation',
BotHello: 'Hello! How can I assist you today?',
Error: 'Something went wrong, please try again later.',
Prompt: {
History: (content: string) => 'This is a summary of the chat history between the AI and the user as a recap: ' + content,
Topic: "Provide a brief topic of the sentence without explanation. If there is no topic, return 'Chitchat'.",
Summarize: 'Summarize our discussion briefly in 50 characters or less to use as a prompt for future context.',
},
ConfirmClearAll: 'Confirm to clear all chat and setting data?',
MaxTokens: {
Title: "Max Tokens",
SubTitle: "Maximum length of input tokens and generated tokens",
},
Copy: {
Success: 'Copied to clipboard',
Failed: 'Copy failed, please grant permission to access clipboard',
}
}
PresencePenlty: {
Title: "Presence Penalty",
SubTitle:
"A larger value increases the likelihood to talk about new topics",
},
},
Store: {
DefaultTopic: "New Conversation",
BotHello: "Hello! How can I assist you today?",
Error: "Something went wrong, please try again later.",
Prompt: {
History: (content: string) =>
"This is a summary of the chat history between the AI and the user as a recap: " +
content,
Topic:
"Provide a brief topic of the sentence without explanation. If there is no topic, return 'Chitchat'.",
Summarize:
"Summarize our discussion briefly in 50 characters or less to use as a prompt for future context.",
},
ConfirmClearAll: "Confirm to clear all chat and setting data?",
},
Copy: {
Success: "Copied to clipboard",
Failed: "Copy failed, please grant permission to access clipboard",
},
};
export default en;
export default en;