DeepSeek-Reasonix icon indicating copy to clipboard operation
DeepSeek-Reasonix copied to clipboard

[Feature]: 上传视频/图片进行多模态分析的支持

Open vienhieu727-ship-it opened this issue 5 months ago • 2 comments

Version line

v2 — Go rewrite (1.x), main-v2 (active development)

What problem does this solve?

描述 当前 Reasonix 不支持将图片或视频直接发送给多模态模型进行视觉理解。

当用户上传视频(或图片)时,即使选择了支持视觉的模型(如 GPT-4V、未来的 DeepSeek 多模态版本等),消息内容仍然以纯文本字符串形式发送,不会将图片/视频以 image_url 或 data:image 格式嵌入到请求中。

复现步骤 在 reasonix chat 或 code 模式中上传一个视频/图片文件 选择一个支持多模态的模型 要求模型分析视频/图片内容 模型无法直接"看到"文件,只能尝试用 bash(ffprobe 等)或 read_file 等工具来处理 预期行为 对于支持的模型(例如 OpenAI 兼容的视觉模型),应当能够将图片以 content: [{ type: "image_url", image_url: { url: "data:image/...;base64,..." } }] 的格式直接发送给模型进行视觉理解。

对于视频,如果模型不支持直接视频输入,可以将其解码为关键帧图片序列后再发送。

实际行为 消息体始终是:

{"role": "user", "content": "请分析这个视频"} 没有任何图片/视频数据被嵌入请求中。

根因 在 internal/provider/openai/openai.go 中,chatMessage 结构体的 Content 字段是 *string 类型,而非 []contentPart 数组,因此无法承载多模态内容。

建议方案 internal/provider/provider.go — Message 结构体增加 ImageURLs 或等效的多模态字段 internal/provider/openai/openai.go — buildRequest() 中,当消息含图片时,将 Content 从 *string 切换为 []chatContentPart 格式 前端 CLI/TUI — 支持文件拖入/粘贴时自动将图片转为 base64 data URI 注意缓存影响 — base64 图片嵌入会改变 prompt 字节,影响 prefix-cache 稳定性,建议只在显式使用多模态模型时启用

Proposed solution

No response

vienhieu727-ship-it avatar Jun 12 '26 08:06 vienhieu727-ship-it

进度同步:图片部分已经由 #4204 合入 main-v2,支持把已附加的图片发送给标记为 vision 的 OpenAI-compatible / Anthropic 模型;#4210 进一步补了发送前降采样和 detail 配置,避免大图直接按原图成本发送。

这条我先不关闭,因为原需求还包含“视频 → 关键帧”的路径,而 #4204 明确把视频/keyframe decoding 留作后续工作。当前状态可以理解为:图片直传已落地,视频分析仍待实现。

SivanCola avatar Jun 13 '26 14:06 SivanCola

当用qwen3.6 的时候,貌似一定要在图片前加上@

比如 “看看这图片里是什么 @/home/blah/blah png" Agent 会看图,但是看完直接卡住,需要再次prompt "你为什么卡住了,图看没” Agent 回答 "这图里是xxxxx"

不知道我理解对不对,貌似一共有两个问题 1:agent 看图会终止对话 2:agent 没法自主看图,必须用户加@图片路径

yundddd avatar Jun 21 '26 17:06 yundddd

Half of this is built, and the other half is a much larger problem — so closing this one and inviting a narrower issue for the remainder.

Images: implemented. They are embedded in the provider request rather than described in text, gated per model so a text-only model never receives one. MiMo's official vision models work with no configuration; any custom provider can declare vision = true. DeepSeek's own API does not accept image input yet — when it does, that is one line of config, no release needed.

Video: not built, and not a variation of the same feature. A model cannot be handed a video the way it is handed an image. It needs frame extraction, a sampling policy, and a decision about what those frames do to conversation history — a few keyframes at realistic resolutions can outweigh the entire text of a session, which then has to survive compaction. That is a design question, not a missing image_url branch.

Closing because the request as written reads as unbuilt when the image path has been working for a while. If video analysis is what you actually need, a fresh issue describing the workflow — what the video is, what you want the model to tell you about it — would be far more actionable than this one, because the sampling policy depends entirely on that.

esengine avatar Aug 03 '26 10:08 esengine