|
@@ -440,6 +440,7 @@ const onSendHandle = (status = true) => {
|
|
|
message.error('请输入问题');
|
|
|
return;
|
|
|
}
|
|
|
+ const isFllow = historys.value.length > 0
|
|
|
if (!status) {
|
|
|
historys.value[historyIndex].currentResponse.loading = false;
|
|
|
stopAI();
|
|
@@ -462,7 +463,7 @@ const onSendHandle = (status = true) => {
|
|
|
docs: []
|
|
|
}
|
|
|
})
|
|
|
- ask(decodeURIComponent(cQuestion.value));
|
|
|
+ ask(decodeURIComponent(cQuestion.value), isFllow);
|
|
|
cQuestion.value = '';
|
|
|
const timer = setTimeout(() => {
|
|
|
scrollToBottom()
|
|
@@ -535,8 +536,6 @@ const streamToAnswer = () => {
|
|
|
}
|
|
|
|
|
|
activeIndex.value = 5;
|
|
|
-
|
|
|
- console.log('mock 结束');
|
|
|
}
|
|
|
}, 50);
|
|
|
};
|
|
@@ -639,7 +638,6 @@ let scb = null;
|
|
|
const quest = async (isFllow) => {
|
|
|
startTime.value = Date.now();
|
|
|
window.scroll({ top: 0, behavior: 'smooth' });
|
|
|
- question.value = (isFllow ? '追问: ' : '') + question.value;
|
|
|
evaluate.value = null;
|
|
|
activeIndex.value = 0;
|
|
|
|
|
@@ -726,6 +724,13 @@ const quest = async (isFllow) => {
|
|
|
if (activeTab.value === 'knowledge' && isFllow) {
|
|
|
if (questHistories.value.length > 0) {
|
|
|
body.history_keyword = questHistories.value[questHistories.value.length - 1].keywords;
|
|
|
+ const arrs = historys.value.map((history) => {
|
|
|
+ return {
|
|
|
+ "role": "user",
|
|
|
+ "content": history.question
|
|
|
+ }
|
|
|
+ })
|
|
|
+ body.history = arrs
|
|
|
}
|
|
|
}
|
|
|
if (activeTab.value !== 'net' && answerType.value !== '0') {
|