|
|
|
@ -107,7 +107,6 @@ const onSendMessage = async () => {
|
|
|
|
|
contentEl?.scrollToBottom()
|
|
|
|
|
ignoreAutoScroll = false
|
|
|
|
|
|
|
|
|
|
state.personaLoaded = true
|
|
|
|
|
state.conversationLoading = true
|
|
|
|
|
try {
|
|
|
|
|
let question = state.formMessage
|
|
|
|
@ -196,6 +195,7 @@ const onSendMessage = async () => {
|
|
|
|
|
id: startRes.conversation_id,
|
|
|
|
|
module: MODULE_NAME,
|
|
|
|
|
title: '未命名对话',
|
|
|
|
|
page_title: pageStore.title,
|
|
|
|
|
pinned: false,
|
|
|
|
|
description: description,
|
|
|
|
|
updated_at: Math.floor(Date.now() / 1000),
|
|
|
|
@ -224,6 +224,7 @@ const onSendMessage = async () => {
|
|
|
|
|
conversationStore.updateById(startRes.conversation_id, {
|
|
|
|
|
title: chatCompleteRes.delta_data.title
|
|
|
|
|
})
|
|
|
|
|
setPageTitle(chatCompleteRes.delta_data.title)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
state.conversationLoading = false
|
|
|
|
@ -339,7 +340,6 @@ const loadConversation = async () => {
|
|
|
|
|
state.botId = route.query.botId as string ?? 'default'
|
|
|
|
|
await loadBotPersona()
|
|
|
|
|
} else {
|
|
|
|
|
state.personaLoaded = true
|
|
|
|
|
state.messageChunkList = []
|
|
|
|
|
state.errorMessage = null
|
|
|
|
|
state.formMessage = ''
|
|
|
|
@ -359,7 +359,7 @@ const loadConversation = async () => {
|
|
|
|
|
|
|
|
|
|
state.conversationTitle = conversationInfo.title ?? '未命名对话'
|
|
|
|
|
state.pinned = conversationInfo.pinned
|
|
|
|
|
state.botId = conversationInfo.extra.bot_id ?? 'default'
|
|
|
|
|
state.botId = conversationInfo.extra.bot_id || 'default'
|
|
|
|
|
|
|
|
|
|
await loadBotPersona()
|
|
|
|
|
|
|
|
|
@ -428,7 +428,7 @@ const loadBotPersona = async () => {
|
|
|
|
|
state.formMessage = personaInfo.default_question ?? ''
|
|
|
|
|
}
|
|
|
|
|
state.botName = personaInfo.bot_name
|
|
|
|
|
state.botAvatar = personaInfo.bot_avatar ?? DEFAULT_BOT_AVATAR
|
|
|
|
|
state.botAvatar = personaInfo.bot_avatar || DEFAULT_BOT_AVATAR
|
|
|
|
|
} catch (err: any) {
|
|
|
|
|
console.error(err)
|
|
|
|
|
}
|
|
|
|
@ -830,7 +830,7 @@ watch(() => conversationInfo.value, (currentConversation) => {
|
|
|
|
|
<ion-label color="medium" v-show="!state.pointCostLoading">{{ state.pointCost }}</ion-label>
|
|
|
|
|
<ion-spinner v-show="state.pointCostLoading" color="medium" name="dots"></ion-spinner>
|
|
|
|
|
</ion-chip>
|
|
|
|
|
<ion-textarea class="message-input" aria-label="输入问题" :rows="1" :maxlength="768" placeholder="在这里输入问题..."
|
|
|
|
|
<ion-textarea class="message-input" aria-label="输入问题" :rows="1" :maxlength="768" placeholder="输入问题"
|
|
|
|
|
auto-grow v-model="state.formMessage" @keydown="onMessageInputKeyDown" @ion-input="onInput"
|
|
|
|
|
@compositionstart="onCompositionStart" @compositionend="onCompositionEnd"
|
|
|
|
|
:disabled="state.conversationLoading"></ion-textarea>
|
|
|
|
|