feat(files-api): Support DeepSeek Files API - #250
Draft
dongbeiboy wants to merge 3 commits into
Draft
Conversation
支持将图片上传到 DeepSeek Files API,并在对话中通过 file_id 引用, 而非嵌入 base64 data URL,降低请求体积与 token 消耗。 - 通过 experimental.filesApi 开关启用,仅对 vision-exp 模型和官方端点生效 - 图片按内容寻址本地缓存并去重,有效期内复用同一 file_id - 新增定期清理机制与清空云端缓存命令,避免缓存无限增长
dongbeiboy
force-pushed
the
feature-filesAPI
branch
from
August 23, 2026 11:31
dcd2a77 to
d0ab831
Compare
- 删除 filesApi.ts 中未使用的 imageFound 变量(oxlint 报错) - 按 oxfmt 0.47 格式化 i18n.ts、request.ts、filesApi.ts、commands.ts - 消除 CI 的 lint 与 format:check 失败
- 清空云端缓存后同步清空本地 image-cache,避免复用已删除的 file_id 导致 400 - await withProgress 使 try/catch 能真正捕获清空失败 - 上传链路透传 CancellationToken,支持按 Esc 中断; 修正 listener 泄漏
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
我是小白,第一回用PR,而且还是deepseek写的代码,个人只是提供了一些思路,感觉代码质量应该不高,故只用了Draft PR
这个feature支持将图片上传到 DeepSeek Files API,并在对话中通过 file_id 引用,
而非嵌入 base64 data URL,降低请求体积与 token 消耗。
I'm a beginner, this is my first PR, and the code was written by deepseek. I only provided some ideas, so I'm not confident about the code quality — that's why I used a Draft PR.
This feature allows uploading images to the DeepSeek Files API and referencing them in conversations via file_id, instead of embedding base64 data URLs, which reduces request size and token consumption.
Enabled via the experimental.filesApi flag, effective only for vision-exp models and the official endpoint
Images are content-addressed, locally cached and deduplicated; the same file_id is reused within its validity period
Added a periodic cleanup mechanism and a command to clear the cloud cache, preventing the cache from growing indefinitely