feat: implement image upload and multimodal support
- Added functionality for image uploads in chat, allowing users to attach images for multimodal Q&A. - Enhanced the input field to handle image selection via drag-and-drop and paste, with validation for file types and sizes. - Updated the backend to process images alongside text queries, including support for image analysis. - Introduced new UI components for image previews and management, improving user interaction with uploaded content. - Added localization strings for image upload features and error messages, enhancing accessibility for users in multiple languages. These changes significantly improve the chat experience by enabling users to incorporate images into their queries, facilitating richer interactions and responses.
This commit is contained in:
@@ -279,6 +279,7 @@ export default {
|
||||
|
||||
agent: {
|
||||
taskLabel: 'Task:',
|
||||
think: 'Thinking',
|
||||
copy: 'Copy',
|
||||
addToKnowledgeBase: 'Add to Knowledge Base',
|
||||
updatePlan: 'Update Plan',
|
||||
@@ -1291,6 +1292,7 @@ export default {
|
||||
cannotRemoveAgentKb: 'Cannot remove knowledge base configured by agent',
|
||||
agentConfiguredKb: 'Configured by agent, cannot be removed',
|
||||
modelLockedByAgent: 'Model selection is locked by the current agent',
|
||||
imageUploadDisabledByAgent: 'Image upload is not enabled for this agent',
|
||||
goToAgentSettings: 'Go to agent settings'
|
||||
},
|
||||
createChat: {
|
||||
@@ -1778,6 +1780,9 @@ export default {
|
||||
noAnswerContent: '(No answer content)',
|
||||
noMatchFound: 'No matching content found',
|
||||
deleteSessionFailed: 'Delete failed, please try again later!',
|
||||
imageTooMany: 'Maximum 5 images allowed',
|
||||
imageTypeSizeError: 'Only JPG/PNG/GIF/WEBP under 10MB supported',
|
||||
imageUploadTooltip: 'Upload image (paste/drop supported)',
|
||||
},
|
||||
tenant: {
|
||||
title: 'Tenant Information',
|
||||
@@ -2025,6 +2030,8 @@ export default {
|
||||
dimensionDetected: 'Detection succeeded. Vector dimension: {value}',
|
||||
dimensionFailed: 'Detection failed, please enter the dimension manually',
|
||||
remoteDimensionDetected: 'Detected vector dimension: {value}',
|
||||
supportsVisionLabel: 'Supports Vision / Multimodal',
|
||||
supportsVisionDesc: 'Whether the model accepts image and multimodal input',
|
||||
dimensionHint: 'Model selected. Click "Detect Dimension" to fetch the vector dimension automatically.',
|
||||
loadModelListFailed: 'Failed to load model list',
|
||||
listRefreshed: 'List refreshed',
|
||||
@@ -3106,6 +3113,7 @@ export default {
|
||||
todoWrite: 'Plan Management',
|
||||
knowledgeGraphExtract: 'Knowledge Graph Extraction',
|
||||
thinking: 'Thinking',
|
||||
imageAnalysis: 'Image Analysis',
|
||||
},
|
||||
summary: {
|
||||
searchKb: 'Searched knowledge base <strong>{count}</strong> time(s)',
|
||||
@@ -3153,6 +3161,9 @@ export default {
|
||||
thinkingFailed: 'Thinking failed',
|
||||
updateTodos: 'Updating task list',
|
||||
updateTodosFailed: 'Failed to update task list',
|
||||
imageAnalyzing: 'Viewing image content...',
|
||||
imageAnalysisDone: 'Image content viewed',
|
||||
imageAnalysisFailed: 'Image viewing failed',
|
||||
called: 'Called {name}',
|
||||
calledFailed: 'Failed to call {name}',
|
||||
},
|
||||
@@ -3240,6 +3251,20 @@ export default {
|
||||
selectDesc: 'Select MCP services to enable',
|
||||
selectPlaceholder: 'Select MCP services',
|
||||
},
|
||||
imageUpload: {
|
||||
label: 'Image Upload',
|
||||
desc: 'Allow users to upload images for multimodal Q&A in conversations',
|
||||
vlmModel: 'VLM Model',
|
||||
vlmModelDesc: 'Vision language model for image analysis',
|
||||
vlmModelPlaceholder: 'Select VLM model',
|
||||
vlmModelRequired: 'VLM model is required when image upload is enabled',
|
||||
storageProvider: 'Image Storage',
|
||||
storageProviderDesc: 'Storage engine for uploaded images. Leave empty to use system default',
|
||||
storageProviderPlaceholder: 'Select storage engine',
|
||||
storageDefault: 'System Default',
|
||||
notConfigured: 'Not Configured',
|
||||
goStorageSettings: 'Go to Storage Settings',
|
||||
},
|
||||
faq: {
|
||||
title: 'FAQ Priority Strategy',
|
||||
tooltip: 'When the knowledge base contains FAQ (Q&A pairs), enable this strategy to prioritize FAQ answers over regular documents',
|
||||
|
||||
@@ -387,6 +387,9 @@ export default {
|
||||
noAnswerContent: "(无回答内容)",
|
||||
noMatchFound: "未找到匹配的内容",
|
||||
deleteSessionFailed: "删除失败,请稍后再试!",
|
||||
imageTooMany: "最多上传5张图片",
|
||||
imageTypeSizeError: "仅支持 JPG/PNG/GIF/WEBP 格式,单张不超过 10MB",
|
||||
imageUploadTooltip: "上传图片(支持粘贴/拖拽)",
|
||||
},
|
||||
settings: {
|
||||
title: "设置",
|
||||
@@ -968,6 +971,7 @@ export default {
|
||||
},
|
||||
agent: {
|
||||
taskLabel: "任务:",
|
||||
think: "思考",
|
||||
copy: "复制",
|
||||
addToKnowledgeBase: "添加到知识库",
|
||||
updatePlan: "更新计划",
|
||||
@@ -1484,6 +1488,8 @@ export default {
|
||||
dimensionDetected: "检测成功,向量维度:{value}",
|
||||
dimensionFailed: "检测失败,请手动输入维度",
|
||||
remoteDimensionDetected: "检测到向量维度:{value}",
|
||||
supportsVisionLabel: "支持视觉/多模态",
|
||||
supportsVisionDesc: "模型是否支持图片等多模态输入",
|
||||
dimensionHint: '模型已选择,点击"检测维度"按钮自动获取向量维度',
|
||||
loadModelListFailed: "加载模型列表失败",
|
||||
listRefreshed: "列表已刷新",
|
||||
@@ -2194,6 +2200,7 @@ export default {
|
||||
cannotRemoveAgentKb: "智能体配置的知识库无法移除",
|
||||
agentConfiguredKb: "由智能体配置,不可删除",
|
||||
modelLockedByAgent: "当前智能体已锁定模型配置",
|
||||
imageUploadDisabledByAgent: "当前智能体未启用图片上传",
|
||||
goToAgentSettings: "去设置智能体",
|
||||
},
|
||||
agentSettings: {
|
||||
@@ -3104,6 +3111,7 @@ export default {
|
||||
todoWrite: "计划管理",
|
||||
knowledgeGraphExtract: "知识图谱抽取",
|
||||
thinking: "思考",
|
||||
imageAnalysis: "查看图片内容",
|
||||
},
|
||||
summary: {
|
||||
searchKb: "检索知识库 <strong>{count}</strong> 次",
|
||||
@@ -3151,6 +3159,9 @@ export default {
|
||||
thinkingFailed: "思考失败",
|
||||
updateTodos: "更新任务列表",
|
||||
updateTodosFailed: "更新任务列表失败",
|
||||
imageAnalyzing: "正在查看图片内容...",
|
||||
imageAnalysisDone: "已查看图片内容",
|
||||
imageAnalysisFailed: "图片内容查看失败",
|
||||
called: "调用 {name}",
|
||||
calledFailed: "调用 {name} 失败",
|
||||
},
|
||||
@@ -3238,6 +3249,20 @@ export default {
|
||||
selectDesc: "选择要启用的 MCP 服务",
|
||||
selectPlaceholder: "选择 MCP 服务",
|
||||
},
|
||||
imageUpload: {
|
||||
label: "图片上传",
|
||||
desc: "启用后用户可在对话中上传图片进行多模态问答",
|
||||
vlmModel: "VLM 模型",
|
||||
vlmModelDesc: "用于图片分析的视觉语言模型",
|
||||
vlmModelPlaceholder: "请选择 VLM 模型",
|
||||
vlmModelRequired: "启用图片上传时必须选择 VLM 模型",
|
||||
storageProvider: "图片存储",
|
||||
storageProviderDesc: "选择图片文件的存储引擎,留空则使用系统默认",
|
||||
storageProviderPlaceholder: "选择存储引擎",
|
||||
storageDefault: "系统默认",
|
||||
notConfigured: "未配置",
|
||||
goStorageSettings: "去存储设置中配置",
|
||||
},
|
||||
faq: {
|
||||
title: "FAQ 优先策略",
|
||||
tooltip: "当知识库中包含 FAQ(问答对)时,可以启用此策略让 FAQ 答案优先于普通文档",
|
||||
|
||||
Reference in New Issue
Block a user