api proxy

This commit is contained in:
Rafi
2023-04-05 23:17:14 +08:00
parent 21dc2b9236
commit fb9e8b8c7d
11 changed files with 431 additions and 439 deletions

View File

@@ -25,8 +25,6 @@ const processMessageQueue = () => {
}
isProcessingQueue = true
const nextMessage = messageQueue.shift()
console.log(runtimeConfig.public.typewriter)
// console.log(process.env.NUXT_PUBLIC_TYPEWRITER)
if (runtimeConfig.public.typewriter) {
let wordIndex = 0;
const intervalId = setInterval(() => {
@@ -111,7 +109,7 @@ const fetchReply = async (message) => {
if (event === 'done') {
abortFetch()
props.conversation.messages[props.conversation.messages.length - 1].id = data.messageId
if (!props.conversation.topic || props.conversation.topic === '') {
if (!props.conversation.id) {
props.conversation.id = data.conversationId
genTitle(props.conversation.id)
}
@@ -139,12 +137,6 @@ const scrollChatWindow = () => {
grab.value.scrollIntoView({behavior: 'smooth'})
}
const checkOrAddConversation = () => {
if (props.conversation.messages.length === 0) {
props.conversation.messages.push({id: null, is_bot: true, message: ''})
}
}
const send = (message) => {
fetchingResponse.value = true
if (props.conversation.messages.length === 0) {