Browse Source

feat:语音转写文字 + 已上传的附件(图片/视频)一起发送

zhangwl 1 month ago
parent
commit
ce6d38206c
1 changed files with 4 additions and 1 deletions
  1. 4 1
      chat-ai-ui-main/src/components/ChatInput.vue

+ 4 - 1
chat-ai-ui-main/src/components/ChatInput.vue

@@ -337,7 +337,10 @@ const sendVoice = async (audioBlob: Blob) => {
     );
 
     if (data.text && data.text.trim()) {
-      emit('send', data.text, stream.value, undefined);
+      // 语音转写文字 + 已上传的附件(图片/视频)一起发送
+      const files = attachments.value.map(({ file_id, filename, media_type, size }) => ({ file_id, filename, media_type, size }));
+      emit('send', data.text, stream.value, files.length > 0 ? files : undefined);
+      attachments.value = [];
     } else {
       alert('未能识别语音内容,请重试');
     }