增加非流式响应提示

This commit is contained in:
sijinhui 2024-10-06 11:46:29 +08:00
parent 2feb0e96d0
commit cf340a15bf
3 changed files with 8 additions and 1 deletions

View File

@ -1547,6 +1547,7 @@ function _Chat() {
} }
// 加载状态结束获取token // 加载状态结束获取token
const [loadingChange, setLoadingChange] = useState(false); const [loadingChange, setLoadingChange] = useState(false);
const currentModel = chatStore.currentSession().mask.modelConfig.model;
useEffect(() => { useEffect(() => {
if (!isLoading && loadingChange) { if (!isLoading && loadingChange) {
try { try {
@ -1568,10 +1569,14 @@ function _Chat() {
}); });
} catch {} } catch {}
} }
// 插入判断,展示非流式响应的提示
if (currentModel.startsWith("o1") && isLoading) {
showToast(Locale.StreamTIp, undefined, 5000);
}
return () => { return () => {
setLoadingChange(isLoading); setLoadingChange(isLoading);
}; };
}, [isLoading, loadingChange]); }, [currentModel, isLoading, loadingChange]);
// 快捷键 shortcut keys // 快捷键 shortcut keys
const [showShortcutKeyModal, setShowShortcutKeyModal] = useState(false); const [showShortcutKeyModal, setShowShortcutKeyModal] = useState(false);

View File

@ -6,6 +6,7 @@ const isApp = !!getClientConfig()?.isApp;
const cn = { const cn = {
WIP: "该功能仍在开发中……", WIP: "该功能仍在开发中……",
StreamTIp: "当前非流式响应,请稍候……",
Error: { Error: {
Unauthorized: isApp Unauthorized: isApp
? `😆 对话遇到了一些问题,不用慌: ? `😆 对话遇到了一些问题,不用慌:

View File

@ -7,6 +7,7 @@ import { SAAS_CHAT_UTM_URL } from "@/app/constant";
const isApp = !!getClientConfig()?.isApp; const isApp = !!getClientConfig()?.isApp;
const en: LocaleType = { const en: LocaleType = {
WIP: "Coming Soon...", WIP: "Coming Soon...",
StreamTIp: "Currently generating a non-streaming response, please wait...",
Error: { Error: {
Unauthorized: isApp Unauthorized: isApp
? `😆 Oops, there's an issue. No worries: ? `😆 Oops, there's an issue. No worries: