|
|
|
@ -109,7 +109,7 @@ async function onConversation() {
|
|
|
|
|
try {
|
|
|
|
|
let lastText = ''
|
|
|
|
|
const fetchChatAPIOnce = async () => {
|
|
|
|
|
const { data } = await fetchChatAPIProcess<Chat.ConversationResponse>({
|
|
|
|
|
await fetchChatAPIProcess<Chat.ConversationResponse>({
|
|
|
|
|
prompt: message,
|
|
|
|
|
options,
|
|
|
|
|
signal: controller.signal,
|
|
|
|
@ -147,23 +147,11 @@ async function onConversation() {
|
|
|
|
|
scrollToBottomIfAtBottom()
|
|
|
|
|
}
|
|
|
|
|
catch (error) {
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
updateChat(
|
|
|
|
|
+uuid,
|
|
|
|
|
dataSources.value.length - 1,
|
|
|
|
|
{
|
|
|
|
|
dateTime: new Date().toLocaleString(),
|
|
|
|
|
text: lastText + data.text ?? '',
|
|
|
|
|
inversion: false,
|
|
|
|
|
error: false,
|
|
|
|
|
loading: false,
|
|
|
|
|
conversationOptions: { conversationId: data.conversationId, parentMessageId: data.id },
|
|
|
|
|
requestOptions: { prompt: message, options: { ...options } },
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
updateChatSome(+uuid, dataSources.value.length - 1, { loading: false })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await fetchChatAPIOnce()
|
|
|
|
@ -252,7 +240,7 @@ async function onRegenerate(index: number) {
|
|
|
|
|
try {
|
|
|
|
|
let lastText = ''
|
|
|
|
|
const fetchChatAPIOnce = async () => {
|
|
|
|
|
const { data } = await fetchChatAPIProcess<Chat.ConversationResponse>({
|
|
|
|
|
await fetchChatAPIProcess<Chat.ConversationResponse>({
|
|
|
|
|
prompt: message,
|
|
|
|
|
options,
|
|
|
|
|
signal: controller.signal,
|
|
|
|
@ -292,19 +280,7 @@ async function onRegenerate(index: number) {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
updateChat(
|
|
|
|
|
+uuid,
|
|
|
|
|
index,
|
|
|
|
|
{
|
|
|
|
|
dateTime: new Date().toLocaleString(),
|
|
|
|
|
text: lastText + data.text ?? '',
|
|
|
|
|
inversion: false,
|
|
|
|
|
error: false,
|
|
|
|
|
loading: false,
|
|
|
|
|
conversationOptions: { conversationId: data.conversationId, parentMessageId: data.id },
|
|
|
|
|
requestOptions: { prompt: message, ...options },
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
updateChatSome(+uuid, index, { loading: false })
|
|
|
|
|
}
|
|
|
|
|
await fetchChatAPIOnce()
|
|
|
|
|
}
|
|
|
|
@ -499,11 +475,7 @@ onUnmounted(() => {
|
|
|
|
|
@toggle-using-context="toggleUsingContext"
|
|
|
|
|
/>
|
|
|
|
|
<main class="flex-1 overflow-hidden">
|
|
|
|
|
<div
|
|
|
|
|
id="scrollRef"
|
|
|
|
|
ref="scrollRef"
|
|
|
|
|
class="h-full overflow-hidden overflow-y-auto"
|
|
|
|
|
>
|
|
|
|
|
<div id="scrollRef" ref="scrollRef" class="h-full overflow-hidden overflow-y-auto">
|
|
|
|
|
<div
|
|
|
|
|
id="image-wrapper"
|
|
|
|
|
class="w-full max-w-screen-xl m-auto dark:bg-[#101014]"
|
|
|
|
|