feat(video): update ASR terminology and file type labels for improved clarity
- Changed 'Audio Processing' to 'Audio & Video' in English, Korean, Russian, and Chinese translations to reflect expanded functionality. - Updated ASR configuration titles and descriptions to include video processing capabilities, enhancing user understanding of the feature. - Renamed file type labels from 'Audio Files' to 'Audio & Video' across multiple languages for consistency and clarity. - Enhanced document upload handling in the KnowledgeBase to filter unsupported file types, providing user feedback for filtered images, videos, and audio files. This update improves the internationalization of the application and clarifies the capabilities of the ASR feature.
This commit is contained in:
@@ -1030,11 +1030,38 @@ const handleDocumentUpload = async (event: Event) => {
|
||||
return;
|
||||
}
|
||||
|
||||
const vlmEnabled = kbInfo.value?.vlm_config?.enabled || false;
|
||||
const asrEnabled = kbInfo.value?.asr_config?.enabled || false;
|
||||
const dynamicTypes = supportedFileTypes.value.size > 0 ? supportedFileTypes.value : undefined
|
||||
const validFiles: File[] = [];
|
||||
let skippedCount = 0;
|
||||
let imageFilteredCount = 0;
|
||||
let videoFilteredCount = 0;
|
||||
let audioFilteredCount = 0;
|
||||
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
const file = files[i];
|
||||
const fileExt = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
|
||||
const imageTypes = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp'];
|
||||
const videoTypes = ['mp4', 'mov', 'avi', 'mkv', 'webm', 'wmv', 'flv'];
|
||||
const audioTypes = ['mp3', 'wav', 'm4a', 'flac', 'ogg'];
|
||||
|
||||
if (!vlmEnabled) {
|
||||
if (imageTypes.includes(fileExt)) {
|
||||
imageFilteredCount++;
|
||||
continue;
|
||||
}
|
||||
if (videoTypes.includes(fileExt)) {
|
||||
videoFilteredCount++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (!asrEnabled && audioTypes.includes(fileExt)) {
|
||||
audioFilteredCount++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!kbFileTypeVerification(file, files.length > 1, dynamicTypes)) {
|
||||
validFiles.push(file);
|
||||
} else {
|
||||
@@ -1042,6 +1069,16 @@ const handleDocumentUpload = async (event: Event) => {
|
||||
}
|
||||
}
|
||||
|
||||
if (imageFilteredCount > 0) {
|
||||
MessagePlugin.warning(t('knowledgeBase.imagesFilteredNoVLM', { count: imageFilteredCount }));
|
||||
}
|
||||
if (videoFilteredCount > 0) {
|
||||
MessagePlugin.warning(t('knowledgeBase.videosFilteredNoVLM', { count: videoFilteredCount }));
|
||||
}
|
||||
if (audioFilteredCount > 0) {
|
||||
MessagePlugin.warning(t('knowledgeBase.audiosFilteredNoASR', { count: audioFilteredCount }));
|
||||
}
|
||||
|
||||
if (validFiles.length === 0) {
|
||||
if (skippedCount > 0) {
|
||||
MessagePlugin.warning(t('knowledgeBase.allFilesSkippedNoEngine'));
|
||||
@@ -1176,6 +1213,16 @@ const handleFolderUpload = async (event: Event) => {
|
||||
}
|
||||
}
|
||||
|
||||
if (imageFilteredCount > 0) {
|
||||
MessagePlugin.warning(t('knowledgeBase.imagesFilteredNoVLM', { count: imageFilteredCount }));
|
||||
}
|
||||
if (videoFilteredCount > 0) {
|
||||
MessagePlugin.warning(t('knowledgeBase.videosFilteredNoVLM', { count: videoFilteredCount }));
|
||||
}
|
||||
if (audioFilteredCount > 0) {
|
||||
MessagePlugin.warning(t('knowledgeBase.audiosFilteredNoASR', { count: audioFilteredCount }));
|
||||
}
|
||||
|
||||
if (validFiles.length === 0) {
|
||||
MessagePlugin.warning(t('knowledgeBase.noValidFilesInFolder', { total: files.length }));
|
||||
if (input) input.value = '';
|
||||
|
||||
Reference in New Issue
Block a user