Эх сурвалжийг харах

feat: 实现预定义问题

zhouyuhao 6 сар өмнө
parent
commit
8a6ac7d451

+ 4 - 2
src/views/AIRobotChat/src/AIRobotChat.vue

@@ -128,8 +128,8 @@ const aiChat = (question, isPresetQuestion) => {
     .aiChat({
       serial_no: serial_no.value,
       prompt: sessionStorage.getItem('prompt'),
-      // question_type: isPresetQuestion || !is_FixedAnswer ? 'Predefined Question' : 'Free Question',
-      question_type: 'Free Question',
+      question_type: isPresetQuestion || !is_FixedAnswer ? 'Predefined Question' : 'Free Question',
+      // question_type: 'Free Question',
       question_content: question,
       fixed_faq: !is_FixedAnswer ? messages.value[messages.value.length - 2].content : ''
     })
@@ -139,6 +139,8 @@ const aiChat = (question, isPresetQuestion) => {
       }
       if (res.code === 200) {
         clearInterval(progressInterval.value)
+
+        is_FixedAnswer.value = res.data.is_fixedAnswer_end || false
         const { data } = res.data
         messages.value[messages.value.length - 1] = {
           id: serial_no.value,