| | |
| | | const scrollToBottom = () => { |
| | | containerRef.value?.scrollToBottom(); |
| | | }; |
| | | const { loadReplyData, parseContent, parseExtraContent, convertProcessItem, convertProcessToStep, formatShowTimeYear } = useLoadData(); |
| | | const { loadReplyData, parseContent, parseExtraContent, convertProcessItem, convertProcessToStep, formatShowTimeYear, getStepGroupList } = useLoadData(); |
| | | const voicePageIsShow = ref(false); |
| | | let isTalking = ref(false); |
| | | const chatWidth = computed(() => containerRef.value?.chatWidth); |
| | |
| | | }); |
| | | lastIsResult = false; |
| | | } |
| | | const lastGroup = computedMessageList.value.at(-1).stepGroup[0]; |
| | | const lastGroup = getLastGroup(); |
| | | const stepList = lastGroup?.value ?? []; |
| | | const currentTimeStamp = new Date().getTime(); |
| | | if (chunkRes.mode === 'finish') { |
| | |
| | | const ms = toMyFixed(currentTimeStamp - lastTimestamp, 2) + ' ms'; |
| | | |
| | | stepList.at(-1).ms = ms; |
| | | } else { |
| | | const stepGroup = computedMessageList.value.at(-1).stepGroup; |
| | | if (stepGroup.length > 1) { |
| | | const lastStepList = stepGroup.at(-2).value; |
| | | const ms = toMyFixed(currentTimeStamp - lastTimestamp, 2) + ' ms'; |
| | | |
| | | lastStepList.at(-1).ms = ms; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (!streamOutputIsStart) { |
| | | lastTimestamp = currentTimeStamp; |
| | |
| | | historyId: msgValue.history_id, |
| | | role: RoleEnum.assistant, |
| | | content: parseContent(msgValue), |
| | | stepGroup: (msgValue?.reports ?? []).map((item) => ({ |
| | | value: convertProcessToStep(item?.exec_process), |
| | | isShow: false, |
| | | })), |
| | | stepGroup: getStepGroupList(msgValue?.reports ?? []), |
| | | |
| | | isStopMsg: false, |
| | | |
| | | conclusion: msgValue.conclusion ?? [], |