核工业西南物理研究院知识库AI客户端
xiangpei
2025-04-18 7789aeaad9032763805da324d743bc664bddd2e8
src/components/AiChat.vue
@@ -77,7 +77,6 @@
<script>
import ClipboardJS from 'clipboard';
// import {sendKbMsg} from "@/api/chat";
import {Message} from "element-ui";
const markdownIt = require('markdown-it')();
@@ -85,24 +84,25 @@
  name: 'AiChat',
  data() {
    return {
      chatId: null,
      messages: [], // 用于页面展示的对话列表
      netSearchEnable: false,
      inputMessage: '',
      sendMsgForm: {
        query: "",
        mode: "local_kb",
        kb_name: "SouthWest_Neclear_Develepment_KB",
        top_k: 3,
        score_threshold: 2,
        kbName: "SouthWest_Neclear_Develepment_KB",
        topK: 3,
        scoreThreshold: 2,
        history: [
        ],
        stream: true,
        model: "Qwen25-32B-Instruct",
        temperature: 1.15,
        max_tokens: 512,
        prompt_name: "default",
        return_direct: false
        maxTokens: 512,
        promptName: "default",
        returnDirect: false
      },
      msgIndex: null,
      msgRole: null,
@@ -179,7 +179,7 @@
      this.inputMessage = '';
      const assistantIndex = this.messages.length - 1;
      try {
        const response = await fetch('/api/chat/kb_chat', {
        const response = await fetch('/api/chat/send/msg', {
          method: 'POST',
          headers: {
            'Content-Type': 'application/json',