| | |
| | | |
| | | <script> |
| | | import ClipboardJS from 'clipboard'; |
| | | // import {sendKbMsg} from "@/api/chat"; |
| | | import {Message} from "element-ui"; |
| | | const markdownIt = require('markdown-it')(); |
| | | |
| | |
| | | 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, |
| | |
| | | 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', |