wujingjing
2024-08-19 4bb81cc9f52eedf94a17a6318f57b785b0e02005
src/components/chat/Chat.vue
@@ -50,13 +50,13 @@
                                    v-if="item.role === RoleEnum.assistant && item.content.origin?.ext_call_list"
                                    class="flex font-bold items-center mt-6"
                                 >
                                    <div class="flex-0 mr-1.5">关联功能:</div>
                                    <div class="flex-0 space-x-5 flex">
                                    <div class="flex-0 mb-auto -mr-4">关联功能:</div>
                                    <div class="space-x-5 flex flex-wrap">
                                       <div
                                          v-for="callItem in item.content.origin?.ext_call_list"
                                          :key="callItem.call_ext_id"
                                          @click="relativeQueryClick(callItem)"
                                          class="flex-0 cursor-pointer hover:underline"
                                          class="cursor-pointer hover:underline first-of-type:ml-5"
                                       >
                                          {{ callItem.question }}
                                       </div>
@@ -257,11 +257,25 @@
      ElMessage.warning('发送失败,未确定应用场景!');
   }
   processId.value = uuidv4();
   const judgeParams = !preQuestion.value
      ? {}
      : {
            prev_question: preQuestion.value,
        };
   let judgeParams = null;
   if (!preQuestion.value) {
      const userContent = computedMessageList.value.filter((item) => item.role === RoleEnum.user);
      const lastQuestion = userContent[userContent.length - 2]?.content?.values;
      judgeParams = lastQuestion
         ? {
               prev_question: lastQuestion,
           }
         : {};
   } else {
      judgeParams = {
         prev_question: preQuestion.value,
      };
   }
   // const judgeParams = !preQuestion.value
   //    ? {}
   //    : {
   //          prev_question: preQuestion.value,
   //      };
   const params = {
      process_id: processId.value,
      question: text,
@@ -339,7 +353,6 @@
         const extRes = await extCallQuery(isCallExtParams);
         questionRes = extRes;
         resMsgContent = parseContent(extRes);
      } else {
         resMsgContent = await questionAi(content.values);
      }