增加非流式响应提示

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