|
|
@@ -214,8 +214,9 @@ export function SessionConfigModel(props: { onClose: () => void }) {
|
|
|
const CallWord = (props: {
|
|
|
setUserInput: (value: string) => void,
|
|
|
doSubmit: (userInput: string) => void,
|
|
|
+ questionList: string[]
|
|
|
}) => {
|
|
|
- const { setUserInput, doSubmit } = props
|
|
|
+ const { setUserInput, doSubmit,questionList } = props
|
|
|
const list = [
|
|
|
{
|
|
|
title: '信息公布',
|
|
|
@@ -257,7 +258,7 @@ const CallWord = (props: {
|
|
|
return (
|
|
|
<>
|
|
|
{
|
|
|
- list.map((item, index) => {
|
|
|
+ questionList.map((item, index) => {
|
|
|
return <span
|
|
|
key={index}
|
|
|
style={{
|
|
|
@@ -271,16 +272,16 @@ const CallWord = (props: {
|
|
|
}}
|
|
|
onClick={() => {
|
|
|
const plan: string = '2';
|
|
|
- if (plan === '1') {
|
|
|
+ // if (plan === '1') {
|
|
|
// 方案1.点击后出现在输入框内,用户自己点击发送
|
|
|
- setUserInput(item.text);
|
|
|
- } else {
|
|
|
+ setUserInput(item);
|
|
|
+ // } else {
|
|
|
// 方案2.点击后直接发送
|
|
|
- doSubmit(item.text)
|
|
|
- }
|
|
|
+ doSubmit(item)
|
|
|
+ // }
|
|
|
}}
|
|
|
>
|
|
|
- {item.title}
|
|
|
+ {item}
|
|
|
</span>
|
|
|
})
|
|
|
}
|
|
|
@@ -554,6 +555,7 @@ export function ChatActions(props: {
|
|
|
showPromptHints: () => void;
|
|
|
hitBottom: boolean;
|
|
|
uploading: boolean;
|
|
|
+ questionList: string[];
|
|
|
}) {
|
|
|
const config = useAppConfig();
|
|
|
const navigate = useNavigate();
|
|
|
@@ -788,7 +790,7 @@ export function ChatActions(props: {
|
|
|
icon={<StopIcon />}
|
|
|
/>
|
|
|
)} */}
|
|
|
-
|
|
|
+ {/* 最下面按钮 回到最下面 */}
|
|
|
{!props.hitBottom && (
|
|
|
<ChatAction
|
|
|
onClick={props.scrollToBottom}
|
|
|
@@ -828,11 +830,12 @@ export function ChatActions(props: {
|
|
|
</>
|
|
|
}
|
|
|
/> */}
|
|
|
-
|
|
|
- {/* <CallWord */}
|
|
|
- {/* setUserInput={props.setUserInput} */}
|
|
|
- {/* doSubmit={props.doSubmit} */}
|
|
|
- {/* /> */}
|
|
|
+ {/* 提示词展示 */}
|
|
|
+ {!props.sendStatus&&<CallWord
|
|
|
+ questionList={props.questionList}
|
|
|
+ setUserInput={props.setUserInput}
|
|
|
+ doSubmit={props.doSubmit}
|
|
|
+ />}
|
|
|
|
|
|
{/* <ChatAction
|
|
|
onClick={props.showPromptHints}
|
|
|
@@ -1098,6 +1101,8 @@ function _Chat() {
|
|
|
|
|
|
const [selectedFruit, setSelectedFruit] = React.useState(chatStore.chatMode);
|
|
|
|
|
|
+
|
|
|
+
|
|
|
// 获取应用列表
|
|
|
const fetchApplicationList = async (chatMode?: string) => {
|
|
|
let mode = chatMode || selectedFruit;
|
|
|
@@ -1138,7 +1143,7 @@ function _Chat() {
|
|
|
try {
|
|
|
let url = null;
|
|
|
if (selectedFruit === 'LOCAL') {
|
|
|
- url = '/deepseek/api/free//presets';
|
|
|
+ url = '/deepseek/api/free/presets';
|
|
|
}
|
|
|
// else {
|
|
|
// url = '/bigmodel/api/presets';
|
|
|
@@ -1332,7 +1337,7 @@ function _Chat() {
|
|
|
e.preventDefault();
|
|
|
}
|
|
|
};
|
|
|
-
|
|
|
+ // 历史对话消息
|
|
|
const onRightClick = (e: any, message: ChatMessage) => {
|
|
|
// copy to clipboard
|
|
|
if (selectOrCopy(e.currentTarget, getMessageTextContent(message))) {
|
|
|
@@ -1423,12 +1428,11 @@ function _Chat() {
|
|
|
},
|
|
|
});
|
|
|
};
|
|
|
-
|
|
|
+ // 默认添加一条数据- start
|
|
|
const context: RenderMessage[] = useMemo(() => {
|
|
|
return session.mask.hideContext ? [] : session.mask.context.slice();
|
|
|
}, [session.mask.context, session.mask.hideContext]);
|
|
|
const accessStore = useAccessStore();
|
|
|
-
|
|
|
if (
|
|
|
context.length === 0 &&
|
|
|
session.messages.at(0)?.content !== BOT_HELLO.content
|
|
|
@@ -1439,6 +1443,7 @@ function _Chat() {
|
|
|
}
|
|
|
context.push(copiedHello);
|
|
|
}
|
|
|
+ // 默认添加一条数据- end
|
|
|
|
|
|
// preview messages
|
|
|
const renderMessages = useMemo(() => {
|
|
|
@@ -1979,7 +1984,7 @@ function _Chat() {
|
|
|
>
|
|
|
{/* 这里是具体的聊天框 */}
|
|
|
{
|
|
|
- messages.length > 1 ?
|
|
|
+ // messages.length > 1 ?
|
|
|
<>
|
|
|
{messages.map((message, i) => {
|
|
|
const isUser = message.role === "user";
|
|
|
@@ -2217,53 +2222,52 @@ function _Chat() {
|
|
|
);
|
|
|
})}
|
|
|
</>
|
|
|
- :
|
|
|
- <>
|
|
|
- <div style={{ padding: '0 20px' }}>
|
|
|
- <div style={{ display: 'flex', justifyContent: 'center' }}>
|
|
|
- <img style={{ width: 80, height: 80 }} src={avatarSrc.src} />
|
|
|
- </div>
|
|
|
- <h1 style={{ textAlign: 'center' }}>
|
|
|
- {getAppName()}
|
|
|
- </h1>
|
|
|
- <p style={{ textAlign: 'center' }}>
|
|
|
- {getDesc()}
|
|
|
- </p>
|
|
|
- <div style={{ background: '#fff', padding: 10, borderRadius: 10, boxShadow: '0 2px 8px rgba(0,0,0,.1)' }}>
|
|
|
- <p>我猜您可能想问:</p>
|
|
|
- {
|
|
|
- questionList.map((item, index) => {
|
|
|
- return (
|
|
|
- <div
|
|
|
- style={{
|
|
|
- padding: '10px',
|
|
|
- marginBottom: '10px',
|
|
|
- border: '1px solid #e6e8f1',
|
|
|
- borderRadius: '10px',
|
|
|
- fontSize: '16px',
|
|
|
- display: 'flex',
|
|
|
- justifyContent: 'space-between',
|
|
|
- alignItems: 'center',
|
|
|
- cursor: 'pointer'
|
|
|
- }}
|
|
|
- onClick={() => {
|
|
|
- setUserInput(item)
|
|
|
- doSubmit(item)
|
|
|
- }}
|
|
|
- key={index}
|
|
|
- >
|
|
|
- <div>
|
|
|
- {item}
|
|
|
- </div>
|
|
|
- <RightOutlined />
|
|
|
- </div>
|
|
|
- )
|
|
|
- })
|
|
|
- }
|
|
|
- </div>
|
|
|
-
|
|
|
- </div>
|
|
|
- </>
|
|
|
+ // :
|
|
|
+ // <>
|
|
|
+ // <div style={{ padding: '0 20px' }}>
|
|
|
+ // <div style={{ display: 'flex', justifyContent: 'center' }}>
|
|
|
+ // <img style={{ width: 80, height: 80 }} src={avatarSrc.src} />
|
|
|
+ // </div>
|
|
|
+ // <h1 style={{ textAlign: 'center' }}>
|
|
|
+ // {getAppName()}
|
|
|
+ // </h1>
|
|
|
+ // <p style={{ textAlign: 'center' }}>
|
|
|
+ // {getDesc()}
|
|
|
+ // </p>
|
|
|
+ // <div style={{ background: '#fff', padding: 10, borderRadius: 10, boxShadow: '0 2px 8px rgba(0,0,0,.1)' }}>
|
|
|
+ // <p>我猜您可能想问:</p>
|
|
|
+ // {
|
|
|
+ // questionList.map((item, index) => {
|
|
|
+ // return (
|
|
|
+ // <div
|
|
|
+ // style={{
|
|
|
+ // padding: '10px',
|
|
|
+ // marginBottom: '10px',
|
|
|
+ // border: '1px solid #e6e8f1',
|
|
|
+ // borderRadius: '10px',
|
|
|
+ // fontSize: '16px',
|
|
|
+ // display: 'flex',
|
|
|
+ // justifyContent: 'space-between',
|
|
|
+ // alignItems: 'center',
|
|
|
+ // cursor: 'pointer'
|
|
|
+ // }}
|
|
|
+ // onClick={() => {
|
|
|
+ // setUserInput(item)
|
|
|
+ // doSubmit(item)
|
|
|
+ // }}
|
|
|
+ // key={index}
|
|
|
+ // >
|
|
|
+ // <div>
|
|
|
+ // {item}
|
|
|
+ // </div>
|
|
|
+ // <RightOutlined />
|
|
|
+ // </div>
|
|
|
+ // )
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // </div>
|
|
|
+ // </div>
|
|
|
+ // </>
|
|
|
}
|
|
|
</div>
|
|
|
<div className={styles["chat-input-panel"]}>
|
|
|
@@ -2281,6 +2285,7 @@ function _Chat() {
|
|
|
scrollToBottom={scrollToBottom}
|
|
|
hitBottom={hitBottom}
|
|
|
uploading={uploading}
|
|
|
+ questionList={questionList}
|
|
|
showPromptHints={() => {
|
|
|
// Click again to close
|
|
|
if (promptHints.length > 0) {
|