diff --git a/frontend/src/_locales/zh-hans/main.json b/frontend/src/_locales/zh-hans/main.json index 0e0bb40..01f17f8 100644 --- a/frontend/src/_locales/zh-hans/main.json +++ b/frontend/src/_locales/zh-hans/main.json @@ -68,5 +68,7 @@ "Send": "发送", "Type your message here": "在此输入消息", "Copy": "复制", - "Read Aloud": "朗读" + "Read Aloud": "朗读", + "Hello! I'm RWKV, an open-source and commercially available large language model.": "你好! 我是RWKV, 一个开源可商用的大语言模型.", + "This tool’s API is compatible with OpenAI API. It can be used with any ChatGPT tool you like. Go to the settings of some ChatGPT tool, replace the 'https://api.openai.com' part in the API address with '": "本工具的API与OpenAI API兼容. 因此可以配合任意你喜欢的ChatGPT工具使用. 打开某个ChatGPT工具的设置, 将API地址中的'https://api.openai.com'部分替换为'" } \ No newline at end of file diff --git a/frontend/src/pages/Chat.tsx b/frontend/src/pages/Chat.tsx index 0dea717..f5485fc 100644 --- a/frontend/src/pages/Chat.tsx +++ b/frontend/src/pages/Chat.tsx @@ -47,8 +47,19 @@ type Conversations = { const ChatPanel: FC = observer(() => { const {t} = useTranslation(); const [message, setMessage] = useState(''); - const [conversations, setConversations] = useState({}); - const [conversationsOrder, setConversationsOrder] = useState([]); + const [conversations, setConversations] = useState({ + 'welcome': { + sender: botName, + type: MessageType.Normal, + color: 'colorful', + avatarImg: logo, + time: new Date().toISOString(), + content: t('Hello! I\'m RWKV, an open-source and commercially available large language model.'), + side: 'left', + done: true + } + }); + const [conversationsOrder, setConversationsOrder] = useState(['welcome']); const bodyRef = useRef(null); const inputRef = useRef(null); const port = commonStore.getCurrentModelConfig().apiParameters.apiPort; @@ -284,6 +295,7 @@ const badgeStatus: { [modelStatus: number]: PresenceBadgeStatus } = { export const Chat: FC = observer(() => { const {t} = useTranslation(); + const port = commonStore.getCurrentModelConfig().apiParameters.apiPort; return (
@@ -297,6 +309,9 @@ export const Chat: FC = observer(() => {
+ + {t('This tool’s API is compatible with OpenAI API. It can be used with any ChatGPT tool you like. Go to the settings of some ChatGPT tool, replace the \'https://api.openai.com\' part in the API address with \'') + `http://127.0.0.1:${port}` + '\'.'} +