diff --git a/ui/src/components/ai-chat/component/chat-input-operate/index.vue b/ui/src/components/ai-chat/component/chat-input-operate/index.vue
index 004748175dc..3670b85379c 100644
--- a/ui/src/components/ai-chat/component/chat-input-operate/index.vue
+++ b/ui/src/components/ai-chat/component/chat-input-operate/index.vue
@@ -6,7 +6,7 @@
@@ -53,6 +53,27 @@
/>
+
+
+
+
+
+
+
![]()
+
+ {{ item && item?.name }}
+
+
+
+
@@ -200,7 +221,7 @@ const localLoading = computed({
const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp']
const documentExtensions = ['pdf', 'docx', 'txt', 'xls', 'xlsx', 'md', 'html', 'csv']
const videoExtensions = ['mp4', 'avi', 'mov', 'mkv', 'flv']
-const audioExtensions = ['mp3', 'wav', 'aac', 'flac']
+const audioExtensions = ['mp3']
const getAcceptList = () => {
const { image, document, audio, video } = props.applicationDetails.file_upload_setting
@@ -227,14 +248,14 @@ const getAcceptList = () => {
const checkMaxFilesLimit = () => {
return (
props.applicationDetails.file_upload_setting.maxFiles <=
- uploadImageList.value.length + uploadDocumentList.value.length
+ uploadImageList.value.length + uploadDocumentList.value.length + uploadAudioList.value.length + uploadVideoList.value.length
)
}
const uploadFile = async (file: any, fileList: any) => {
const { maxFiles, fileLimit } = props.applicationDetails.file_upload_setting
// 单次上传文件数量限制
- const file_limit_once = uploadImageList.value.length + uploadDocumentList.value.length
+ const file_limit_once = uploadImageList.value.length + uploadDocumentList.value.length + uploadAudioList.value.length + uploadVideoList.value.length
if (file_limit_once >= maxFiles) {
MsgWarning('最多上传' + maxFiles + '个文件')
fileList.splice(0, fileList.length)
@@ -257,9 +278,9 @@ const uploadFile = async (file: any, fileList: any) => {
} else if (documentExtensions.includes(extension)) {
uploadDocumentList.value.push(file)
} else if (videoExtensions.includes(extension)) {
- // videos.push(file)
+ uploadVideoList.value.push(file)
} else if (audioExtensions.includes(extension)) {
- // audios.push(file)
+ uploadAudioList.value.push(file)
}
@@ -297,7 +318,20 @@ const uploadFile = async (file: any, fileList: any) => {
file.file_id = f[0].file_id
}
})
- console.log(uploadDocumentList.value, uploadImageList.value)
+ uploadAudioList.value.forEach((file: any) => {
+ const f = response.data.filter((f: any) => f.name === file.name)
+ if (f.length > 0) {
+ file.url = f[0].url
+ file.file_id = f[0].file_id
+ }
+ })
+ uploadVideoList.value.forEach((file: any) => {
+ const f = response.data.filter((f: any) => f.name === file.name)
+ if (f.length > 0) {
+ file.url = f[0].url
+ file.file_id = f[0].file_id
+ }
+ })
})
}
const recorderTime = ref(0)
@@ -306,6 +340,8 @@ const recorderLoading = ref(false)
const inputValue = ref('')
const uploadImageList = ref>([])
const uploadDocumentList = ref>([])
+const uploadVideoList = ref>([])
+const uploadAudioList = ref>([])
const mediaRecorderStatus = ref(true)
const showDelete = ref('')
@@ -433,11 +469,15 @@ function sendChatHandle(event: any) {
if (inputValue.value.trim()) {
props.sendMessage(inputValue.value, {
image_list: uploadImageList.value,
- document_list: uploadDocumentList.value
+ document_list: uploadDocumentList.value,
+ audio_list: uploadAudioList.value,
+ video_list: uploadVideoList.value,
})
inputValue.value = ''
uploadImageList.value = []
uploadDocumentList.value = []
+ uploadAudioList.value = []
+ uploadVideoList.value = []
quickInputRef.value.textareaStyle.height = '45px'
}
}
@@ -452,6 +492,10 @@ function deleteFile(index: number, val: string) {
uploadImageList.value.splice(index, 1)
} else if (val === 'document') {
uploadDocumentList.value.splice(index, 1)
+ } else if (val === 'video') {
+ uploadVideoList.value.splice(index, 1)
+ } else if (val === 'audio') {
+ uploadAudioList.value.splice(index, 1)
}
}
function mouseenter(row: any) {
diff --git a/ui/src/workflow/nodes/base-node/component/FileUploadSettingDialog.vue b/ui/src/workflow/nodes/base-node/component/FileUploadSettingDialog.vue
index 461b6e81d8a..05c67b9f8c0 100644
--- a/ui/src/workflow/nodes/base-node/component/FileUploadSettingDialog.vue
+++ b/ui/src/workflow/nodes/base-node/component/FileUploadSettingDialog.vue
@@ -68,6 +68,23 @@
+
+
+
+

+
+
音频(MP3)
+
所选模型支持接收音频或与语音转文本节点配合使用
+
+
+
+
+
diff --git a/ui/src/workflow/nodes/start-node/index.vue b/ui/src/workflow/nodes/start-node/index.vue
index 6da9f3e907b..8bec6ce39eb 100644
--- a/ui/src/workflow/nodes/start-node/index.vue
+++ b/ui/src/workflow/nodes/start-node/index.vue
@@ -82,6 +82,12 @@ const refreshFileUploadConfig = () => {
if (form_data[0].image) {
fileUploadFields.push({ label: '图片', value: 'image' })
}
+ if (form_data[0].audio) {
+ fileUploadFields.push({ label: '音频', value: 'audio' })
+ }
+ if (form_data[0].video) {
+ fileUploadFields.push({ label: '视频', value: 'video' })
+ }
set(props.nodeModel.properties.config, 'fields', [...fields, ...fileUploadFields])
}