| | |
| | | import { GetHistoryAnswer, QueryHistoryDetail, QuestionAi, SetHistoryAnswerState, getQuestionProcess } from '/@/api/ai/chat'; |
| | | import PlayBar from '/@/components/chat/components/playBar/PlayBar.vue'; |
| | | import router from '/@/router'; |
| | | import { activeChatRoom, activeLLMId, activeRoomId, activeSampleId, activeSectionAId } from '/@/stores/chatRoom'; |
| | | import { activeChatRoom, activeLLMId, activeRoomId, activeSampleId, activeSectionAId, roomConfig } from '/@/stores/chatRoom'; |
| | | import { v4 as uuidv4 } from 'uuid'; |
| | | |
| | | let isTalking = ref(false); |
| | |
| | | // FIXME: 暂时这样 |
| | | section_a_id: currentSectionId, |
| | | history_group_id: currentRouteId, |
| | | raw_mode: roomConfig.value?.[currentRouteId]?.isAnswerByLLM ?? false, |
| | | } as any; |
| | | |
| | | if (currentSampleId) { |
| | |
| | | let currentSampleId = null; |
| | | |
| | | let currentLLMId = null; |
| | | |
| | | const getAnswerById = async (historyId: string) => { |
| | | return await GetHistoryAnswer({ |
| | | history_id: historyId, |
| | | }); |
| | | }; |
| | | |
| | | const sendChatMessage = async (content: ChatContent = messageContent.value) => { |
| | | if (!messageContent.value?.values) return; |
| | | if (messageList.value.length===0) { |
| | | if (messageList.value.length === 0) { |
| | | if (activeSampleId.value) { |
| | | currentSampleId = activeSampleId.value; |
| | | } |
| | |
| | | messageList.value.at(-1).content = content; |
| | | } |
| | | }; |
| | | |
| | | |
| | | onMounted(async () => { |
| | | const res = await QueryHistoryDetail({ |
| | |
| | | } |
| | | ); |
| | | |
| | | onActivated(()=>{ |
| | | onActivated(() => { |
| | | if (forbidScroll) return; |
| | | nextTick(() => scrollToBottom()); |
| | | }) |
| | | }); |
| | | |
| | | //#region ====================== 聊天内容操作 ====================== |
| | | |