Skip to content

feat: add file upload with model probe for simple chatbot#6397

Open
DurantChan1 wants to merge 1 commit into
1Panel-dev:v2from
DurantChan1:durantchan1/add_uploading_for_normal
Open

feat: add file upload with model probe for simple chatbot#6397
DurantChan1 wants to merge 1 commit into
1Panel-dev:v2from
DurantChan1:durantchan1/add_uploading_for_normal

Conversation

@DurantChan1

@DurantChan1 DurantChan1 commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it?

为对话型应用(简单模式)添加文件上传功能。用户可以在应用设置中通过模型探针自动检测模型的多模态能力(图片、视频、音频等),配置允许上传的文件类型,并在对话中上传文件供 LLM 处理。

Summary of your change

后端:

  • 新增探针 API POST /workspace/{workspace_id}/model/{model_id}/probe,向 LLM 发送探针消息检测其支持的文件后缀,结果缓存到 model.meta.file_capabilities
  • chat_simple 方法支持文件列表提取与处理,拆分为 _process_documents_process_images_process_videos_process_audio 四个模块级函数
  • BaseGenerateHumanMessageStep 支持多模态 HumanMessage(图片/视频/音频以 base64 格式嵌入,文档文本注入 {data} 占位符)

前端:

  • 三个 model API 模块新增 probeModelCapability() 方法
  • ApplicationSetting.vue 增加文件上传开关 + FileUploadSettingDialog 集成,模型切换时自动触发探针
  • FileUploadSettingDialog 接受 modelCapabilities prop,根据探针结果自动勾选/禁用文件类型
  • chat-input-operate 上传前根据 model_capabilities 检测文件类型是否受模型支持

Please indicate you've done the following:

  • Made changes to the UI (应用设置页 + 聊天输入组件)
  • Checked for breaking changes (无破坏性变更)
  • Tested the changes (前端构建通过,后端 Python 语法验证通过)

Examples

  1. 文档识别
image 2. 图片识别 image 3. 视频识别 image
  1. 文件上传设置
image

Please indicate you've done the following:

  • [ x] Made sure tests are passing and test coverage is added if needed.
  • [x ] Made sure commit message follow the rule of Conventional Commits specification.
  • [ x] Considered the docs impact and opened a new docs issue or PR with docs changes if needed.

@DurantChan1 DurantChan1 force-pushed the durantchan1/add_uploading_for_normal branch 2 times, most recently from d82c6a8 to 51bd6a2 Compare July 12, 2026 09:24
@DurantChan1 DurantChan1 force-pushed the durantchan1/add_uploading_for_normal branch from 51bd6a2 to 6a93781 Compare July 12, 2026 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants