Skip to content

feat: support DeepSeek Vision for PDF resume import - #377

Draft
gziyin wants to merge 1 commit into
JOYCEQL:mainfrom
gziyin:feat-deepseek-resume-import
Draft

feat: support DeepSeek Vision for PDF resume import#377
gziyin wants to merge 1 commit into
JOYCEQL:mainfrom
gziyin:feat-deepseek-resume-import

Conversation

@gziyin

@gziyin gziyin commented Aug 24, 2026

Copy link
Copy Markdown

Summary

  • Add DeepSeek Vision support to PDF resume import using the official experimental deepseek-v4-flash-vision-exp model.
  • Route PDF imports through DeepSeek when it is the selected AI provider, while preserving Gemini as the backward-compatible default.
  • Share proxy initialization between Gemini and DeepSeek and map network/upstream failures to safe client responses.
  • Add 20 focused tests for provider normalization, payload construction, JSON parsing, proxy initialization, and DeepSeek error handling.

Problem

PDF resume import was hard-wired to Gemini. Users who selected and configured DeepSeek for AI features still had to configure a Gemini key before importing a PDF, so the import behavior did not match their provider selection.

Implementation

  • Extend /api/resume-import with an optional modelType discriminator. Missing values still select Gemini for existing callers; unsupported values return HTTP 400.
  • Send PDF page images as OpenAI-compatible image_url data URLs to DeepSeek's Chat Completions endpoint using deepseek-v4-flash-vision-exp and JSON output mode.
  • Reuse one resume schema prompt and one tolerant JSON-object parser across both providers.
  • Keep the successful response contract unchanged as { resume }.
  • Move the existing Gemini proxy setup into a shared server module and initialize it before either provider makes an outbound request.
  • Return fixed public messages for DeepSeek failures while retaining upstream details only on the server-side error object.
  • Update Chinese and English import guidance to refer to the selected AI provider.

DeepSeek Vision request shape and limits follow the official documentation:
https://api-docs.deepseek.com/guides/vision/

Compatibility

  • Requests without modelType continue to use Gemini.
  • Existing PDF rendering and resume persistence flows are unchanged.
  • Selecting DeepSeek uses the DeepSeek API key; other providers retain the existing Gemini PDF-import fallback.
  • API keys, proxy URLs, and raw upstream response bodies are not returned to the client.

Verification

  • pnpm test:resume-import: 20/20 passed
  • pnpm build: client and SSR builds passed
  • pnpm exec tsc --noEmit: the repository still reports 41 pre-existing diagnostics; changed files report 0 diagnostics
  • Chinese and English locale JSON parsed successfully
  • git diff --check passed
  • Changed-file secret and local-path scan returned no matches

The existing DEFAULT_TEMPLATES circular chunk warnings and large bundle warnings are unchanged.

Manual validation still required

  • Import a real multi-page PDF with a valid DeepSeek API key and verify the generated resume fields.
  • Repeat the same browser flow with Gemini to confirm backward compatibility.

This PR is opened as a draft until those credential-dependent checks are completed.

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.

1 participant