This commit is contained in:
parent
9fe237d859
commit
1487ddb1ef
|
@ -169,7 +169,7 @@ async function onConversation() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let lastText = ''
|
let lastText = ''
|
||||||
let mp3: any = []
|
const mp3: any = []
|
||||||
console.log('发送消息', message)
|
console.log('发送消息', message)
|
||||||
|
|
||||||
const fetchChatAPIOnce = async () => {
|
const fetchChatAPIOnce = async () => {
|
||||||
|
@ -188,18 +188,19 @@ async function onConversation() {
|
||||||
const msg = JSON.parse(event.data)
|
const msg = JSON.parse(event.data)
|
||||||
// console.log(`收到消息: `, msg.payload.choices.text[0].content);
|
// console.log(`收到消息: `, msg.payload.choices.text[0].content);
|
||||||
// console.log(`当前消息: `, dataSources.value[dataSources.value.length - 1].text);
|
// console.log(`当前消息: `, dataSources.value[dataSources.value.length - 1].text);
|
||||||
lastText += msg.payload.choices.text[0].content;
|
lastText += msg.payload.choices.text[0].content
|
||||||
mp3.push(msg.payload.choices.mp3)
|
mp3.push(msg.payload.choices.mp3)
|
||||||
|
const loading = true
|
||||||
updateChat(
|
updateChat(
|
||||||
+uuid,
|
+uuid,
|
||||||
dataSources.value.length - 1,
|
dataSources.value.length - 1,
|
||||||
{
|
{
|
||||||
dateTime: new Date().toLocaleString(),
|
dateTime: new Date().toLocaleString(),
|
||||||
text: lastText,
|
text: lastText,
|
||||||
mp3: mp3,
|
mp3,
|
||||||
inversion: false,
|
inversion: false,
|
||||||
error: false,
|
error: false,
|
||||||
loading: true,
|
loading,
|
||||||
conversationOptions: { conversationId: msg.header.sid, parentMessageId: msg.header.sid },
|
conversationOptions: { conversationId: msg.header.sid, parentMessageId: msg.header.sid },
|
||||||
requestOptions: { prompt: message, options: { ...options } },
|
requestOptions: { prompt: message, options: { ...options } },
|
||||||
},
|
},
|
||||||
|
@ -686,7 +687,6 @@ const click = () => {
|
||||||
>
|
>
|
||||||
<template #default="{ handleInput, handleBlur, handleFocus }">
|
<template #default="{ handleInput, handleBlur, handleFocus }">
|
||||||
<NInput
|
<NInput
|
||||||
ref="inputRef"
|
|
||||||
v-model:value="prompt"
|
v-model:value="prompt"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
|
|
Loading…
Reference in New Issue