Commit 64cb7700 authored by nick zheng's avatar nick zheng

Merge branch 'beta' into 'master'

fix: 应用提问追问生成异常处理

See merge request !124
parents 4722af92 401f9204
......@@ -40,6 +40,8 @@ const currentPlayMessageItem = ref<ConversationMessageItem | null>(null)
const currentPlayAudioFragmentSerialNo = ref(0)
const currentSoundCtl = shallowRef<Howl | null>(null)
const isSoundCtlCreated = ref(false)
const isAnswerResponseLoading = ref(false)
const createContinueQuestionsException = ref(false)
const isEnLanguage = computed(() => {
return systemLanguageStore.currentLanguageInfo.key === 'en'
......@@ -107,12 +109,18 @@ function handleClearAllMessage() {
}
async function handleCreateContinueQuestions(replyTextContent: string) {
const res = await fetchCreateContinueQuestions<string[]>({ input: replyTextContent })
createContinueQuestionsException.value = false
if (res.code === 0) {
continuousQuestionList.value = res.data
handleUpdatePageScroll()
}
fetchCreateContinueQuestions<string[]>({ input: replyTextContent })
.then((res) => {
if (res.code === 0) {
continuousQuestionList.value = res.data
handleUpdatePageScroll()
}
})
.catch(() => {
createContinueQuestionsException.value = true
})
}
function handleUpdateContinueQuestionStatus(status: 'default' | 'close') {
......@@ -316,6 +324,8 @@ function handleAudioPause(isClearMessageList = false) {
:message-list="messageList"
:continuous-question-status="continuousQuestionStatus"
:continuous-question-list="continuousQuestionList"
:is-answer-response-loading="isAnswerResponseLoading"
:create-continue-questions-exception="createContinueQuestionsException"
@audio-play="handleAudioPlay"
@audio-pause="handleAudioPause"
/>
......@@ -324,6 +334,7 @@ function handleAudioPause(isClearMessageList = false) {
<FooterInput
ref="footerInputRef"
v-model:is-answer-response-loading="isAnswerResponseLoading"
:continuous-question-status="continuousQuestionStatus"
:message-list="messageList"
:answer-audio-auto-play="answerAudioAutoPlay"
......
......@@ -42,6 +42,7 @@ const userStore = useUserStore()
const { uploadFileList, handleLimitUpload, handleUpload, handleRemoveFile } = useDialogueFile()
const messageTipModalRef = useTemplateRef<InstanceType<typeof OverwriteMessageTipModal>>('messageTipModalRef')
const isAnswerResponseLoading = defineModel<boolean>('isAnswerResponseLoading', { required: true })
const emitter = inject<Emitter<MittEvents>>('emitter')
......@@ -184,6 +185,7 @@ function handleMessageSend() {
})
})
isAnswerResponseLoading.value = true
inputMessageContent.value = ''
isAnswerResponseWait.value = true
......@@ -263,6 +265,7 @@ function handleMessageSend() {
},
onFinally: () => {
controller = null
isAnswerResponseLoading.value = false
userStore.fetchUpdateEquityInfo()
},
})
......
......@@ -8,6 +8,8 @@ interface Props {
messageList: Map<string, ConversationMessageItem>
continuousQuestionStatus: 'default' | 'close'
continuousQuestionList: string[]
isAnswerResponseLoading: boolean
createContinueQuestionsException: boolean
}
const props = defineProps<Props>()
......@@ -23,7 +25,8 @@ const isShowContinueQuestion = computed(() => {
return (
props.continuousQuestionStatus === 'default' &&
props.messageList.size > 1 &&
!Array.from(props.messageList.entries()).pop()?.[1].isAnswerResponseLoading
!props.isAnswerResponseLoading &&
!props.createContinueQuestionsException
)
})
......
......@@ -50,6 +50,8 @@ const userStore = useUserStore()
const { uploadFileList, handleLimitUpload, handleUpload, handleRemoveFile } = useDialogueFile()
const isAnswerResponseLoading = defineModel<boolean>('isAnswerResponseLoading', { required: true })
const emitter = inject<Emitter<MittEvents>>('emitter')
const inputMessageContent = ref('')
......@@ -175,6 +177,7 @@ function handleMessageSend() {
const input = inputMessageContent.value
let replyTextContent = ''
isAnswerResponseLoading.value = true
isAnswerResponseWait.value = true
inputMessageContent.value = ''
currentReplyContentSentenceExtractIndex.value = 0
......@@ -239,6 +242,7 @@ function handleMessageSend() {
},
onFinally: () => {
controller = null
isAnswerResponseLoading.value = false
userStore.fetchUpdateEquityInfo()
},
})
......
......@@ -10,6 +10,8 @@ interface Props {
agentApplicationConfig: PersonalAppConfigState
continuousQuestionStatus: 'default' | 'close'
continuousQuestionList: string[]
isAnswerResponseLoading: boolean
createContinueQuestionsException: boolean
}
const props = defineProps<Props>()
......@@ -25,7 +27,8 @@ const isShowContinueQuestion = computed(() => {
return (
props.continuousQuestionStatus === 'default' &&
props.messageList.size > 1 &&
!Array.from(props.messageList.entries()).pop()?.[1].isAnswerResponseLoading
!props.isAnswerResponseLoading &&
!props.createContinueQuestionsException
)
})
......
......@@ -48,6 +48,8 @@ const currentPlayMessageItem = ref<ConversationMessageItem | null>(null)
const currentPlayAudioFragmentSerialNo = ref(0)
const currentSoundCtl = shallowRef<Howl | null>(null)
const isSoundCtlCreated = ref(false)
const isAnswerResponseLoading = ref(false)
const createContinueQuestionsException = ref(false)
const isEnableDocumentParse = computed(() => {
return agentApplicationConfig.value.knowledgeConfig.isDocumentParsing === 'Y'
......@@ -184,12 +186,18 @@ function handleClearAllMessage() {
}
async function handleCreateContinueQuestions(replyTextContent: string) {
const res = await fetchCreateContinueQuestions<string[]>({ input: replyTextContent })
createContinueQuestionsException.value = false
if (res.code === 0) {
continueQuestionList.value = res.data
handleUpdatePageScroll()
}
fetchCreateContinueQuestions<string[]>({ input: replyTextContent })
.then((res) => {
if (res.code === 0) {
continueQuestionList.value = res.data
handleUpdatePageScroll()
}
})
.catch(() => {
createContinueQuestionsException.value = true
})
}
function handleResetContinueQuestionList() {
......@@ -316,6 +324,8 @@ function handleAudioPause(isClearMessageList = false) {
:message-list="messageList"
:continuous-question-status="continuousQuestionStatus"
:continuous-question-list="continueQuestionList"
:is-answer-response-loading="isAnswerResponseLoading"
:create-continue-questions-exception="createContinueQuestionsException"
@audio-play="handleAudioPlay"
@audio-pause="handleAudioPause"
/>
......@@ -325,6 +335,7 @@ function handleAudioPause(isClearMessageList = false) {
<div class="footer-operation px-4">
<FooterInput
ref="footerInputRef"
v-model:is-answer-response-loading="isAnswerResponseLoading"
:message-list="messageList"
:dialogs-id="dialogsId"
:agent-id="agentApplicationConfig.baseInfo.agentId"
......
......@@ -51,6 +51,8 @@ const currentPlayMessageItem = ref<ConversationMessageItem | null>(null)
const currentPlayAudioFragmentSerialNo = ref(0)
const currentSoundCtl = shallowRef<Howl | null>(null)
const isSoundCtlCreated = ref(false)
const isAnswerResponseLoading = ref(false)
const createContinueQuestionsException = ref(false)
const isEnableDocumentParse = computed(() => {
return agentApplicationConfig.value.knowledgeConfig.isDocumentParsing === 'Y'
......@@ -205,12 +207,18 @@ function handleClearAllMessage() {
}
async function handleCreateContinueQuestions(replyTextContent: string) {
const res = await fetchCreateContinueQuestions<string[]>({ input: replyTextContent })
createContinueQuestionsException.value = false
if (res.code === 0) {
continueQuestionList.value = res.data
handleUpdatePageScroll()
}
fetchCreateContinueQuestions<string[]>({ input: replyTextContent })
.then((res) => {
if (res.code === 0) {
continueQuestionList.value = res.data
handleUpdatePageScroll()
}
})
.catch(() => {
createContinueQuestionsException.value = true
})
}
function handleResetContinueQuestionList() {
......@@ -339,6 +347,8 @@ function handleAudioPause(isClearMessageList = false) {
:message-list="messageList"
:continuous-question-status="continuousQuestionStatus"
:continuous-question-list="continueQuestionList"
:is-answer-response-loading="isAnswerResponseLoading"
:create-continue-questions-exception="createContinueQuestionsException"
@audio-play="handleAudioPlay"
@audio-pause="handleAudioPause"
/>
......@@ -348,6 +358,7 @@ function handleAudioPause(isClearMessageList = false) {
<div class="px-5">
<FooterInput
ref="footerInputRef"
v-model:is-answer-response-loading="isAnswerResponseLoading"
:message-list="messageList"
:dialogs-id="dialogsId"
:agent-id="agentApplicationConfig.baseInfo.agentId"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment