|
|
@@ -20,6 +20,7 @@ import CancelIcon from "../icons/cancel.svg";
|
|
|
import SizeIcon from "../icons/size.svg";
|
|
|
import avatar from "../icons/aiIcon.png";
|
|
|
import sdsk from "../icons/sdsk.png";
|
|
|
+import sdsk_selected from "../icons/sdsk_selected.png";
|
|
|
import hlw from "../icons/hlw.png";
|
|
|
|
|
|
import {
|
|
|
@@ -882,7 +883,6 @@ function _Chat() {
|
|
|
setUserInput("");
|
|
|
setPromptHints([]);
|
|
|
if (!isMobileScreen) inputRef.current?.focus();
|
|
|
- setFileList([]);
|
|
|
setAutoScroll(true);
|
|
|
};
|
|
|
|
|
|
@@ -1346,6 +1346,16 @@ function _Chat() {
|
|
|
return icon;
|
|
|
}
|
|
|
|
|
|
+ const [isDeepThink, setIsDeepThink] = useState<boolean>(chatStore.isDeepThink);
|
|
|
+
|
|
|
+ // 切换聊天窗口后清理上传文件信息
|
|
|
+ useEffect(() => {
|
|
|
+ setFileList([])
|
|
|
+ }, [chatStore.currentSession()])
|
|
|
+
|
|
|
+ const couldStop = ChatControllerPool.hasPending();
|
|
|
+ const stopAll = () => ChatControllerPool.stopAll();
|
|
|
+
|
|
|
return (
|
|
|
<div className={styles.chat} key={session.id}>
|
|
|
{
|
|
|
@@ -1472,7 +1482,6 @@ function _Chat() {
|
|
|
})}
|
|
|
</>
|
|
|
</div>
|
|
|
-
|
|
|
<div className={styles["chat-input-panel"]}>
|
|
|
<ChatActions
|
|
|
setUserInput={setUserInput}
|
|
|
@@ -1489,7 +1498,6 @@ function _Chat() {
|
|
|
setPromptHints([]);
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
inputRef.current?.focus();
|
|
|
setUserInput("/");
|
|
|
onSearch("");
|
|
|
@@ -1558,9 +1566,25 @@ function _Chat() {
|
|
|
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginTop: 10 }}>
|
|
|
<div style={{ display: 'flex', alignItems: 'center' }}>
|
|
|
<div
|
|
|
- style={{ padding: '0 10px', height: 30, borderRadius: 30, fontSize: 12, background: '#f3f4f6', display: 'flex', justifyContent: 'center', alignItems: 'center', marginRight: 20 }}
|
|
|
+ style={{
|
|
|
+ padding: '0 10px',
|
|
|
+ height: 30,
|
|
|
+ borderRadius: 30,
|
|
|
+ fontSize: 12,
|
|
|
+ display: 'flex',
|
|
|
+ justifyContent: 'center',
|
|
|
+ alignItems: 'center',
|
|
|
+ marginRight: 20,
|
|
|
+ cursor: 'pointer',
|
|
|
+ background: isDeepThink ? '#dee9fc' : '#f3f4f6',
|
|
|
+ color: isDeepThink ? '#3875f6' : '#000000',
|
|
|
+ }}
|
|
|
+ onClick={() => {
|
|
|
+ setIsDeepThink(!isDeepThink);
|
|
|
+ chatStore.setIsDeepThink(!isDeepThink);
|
|
|
+ }}
|
|
|
>
|
|
|
- <img src={sdsk.src} style={{ height: 23 }} />
|
|
|
+ <img src={isDeepThink ? sdsk_selected.src : sdsk.src} style={{ height: 23 }} />
|
|
|
<div style={{ marginLeft: 5 }}>
|
|
|
深度思考(R1)
|
|
|
</div>
|
|
|
@@ -1613,12 +1637,32 @@ function _Chat() {
|
|
|
</div>
|
|
|
<div
|
|
|
style={{
|
|
|
- width: 35, height: 35, borderRadius: '50%', background: '#4357d2', display: 'flex', justifyContent: 'center', alignItems: 'center', cursor: 'pointer'
|
|
|
+ width: 35,
|
|
|
+ height: 35,
|
|
|
+ borderRadius: '50%',
|
|
|
+ background: '#4357d2',
|
|
|
+ display: 'flex',
|
|
|
+ justifyContent: 'center',
|
|
|
+ alignItems: 'center',
|
|
|
+ cursor: 'pointer',
|
|
|
+ }}
|
|
|
+ onClick={() => {
|
|
|
+ if (couldStop) {
|
|
|
+ stopAll();
|
|
|
+ } else {
|
|
|
+ doSubmit(userInput);
|
|
|
+ }
|
|
|
}}
|
|
|
- onClick={() => doSubmit(userInput)}
|
|
|
>
|
|
|
- <div style={{ transform: 'rotate(-45deg)', padding: '0px 0px 3px 5px' }}>
|
|
|
- <SendOutlined style={{ color: '#FFFFFF' }} />
|
|
|
+ {
|
|
|
+ couldStop ?
|
|
|
+ <div style={{ width: 13, height: 13, background: '#FFFFFF', borderRadius: 2 }}></div>
|
|
|
+ :
|
|
|
+ <div style={{ transform: 'rotate(-45deg)', padding: '0px 0px 3px 5px' }}>
|
|
|
+ <SendOutlined style={{ color: '#FFFFFF' }} />
|
|
|
+ </div>
|
|
|
+ }
|
|
|
+ <div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -1641,7 +1685,7 @@ function _Chat() {
|
|
|
/>
|
|
|
)
|
|
|
}
|
|
|
- </div >
|
|
|
+ </div>
|
|
|
);
|
|
|
}
|
|
|
|