Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 2, 2025

Uploading docx files failed with DSSeekConfig.__init__() got an unexpected keyword argument 'default_mode'. The DSSeekConfig dataclass was missing the default_mode field that api/insert.py passes when creating the DeepSeek-OCR client with tenant configuration.

Changes

  • Added default_mode field to DSSeekConfig in src/deepseek_ocr_client.py
# OCR 模式配置
default_mode: str = field(default_factory=lambda: config.ds_ocr.default_mode)

Note on TXT file URL issue

The reported TXT file URL issue is a configuration problem, not a code bug. TXT files are read directly and don't use remote parsing services. Users experiencing URL issues should verify their FILE_SERVICE_BASE_URL environment variable.

Original prompt

This section details on the original issue you should resolve

<issue_title>api</issue_title>
<issue_description>first i tried to upload docx,died because
Unexpected error: DSSeekConfig.init() got an unexpected keyword argument 'default_mode';
second i tried to upload txt,seems like it dosent get a right url ,its my env file.

.env.txt</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

The DSSeekConfig class was missing the default_mode field, which caused the error:
'DSSeekConfig.__init__() got an unexpected keyword argument 'default_mode''

This field is needed because api/insert.py passes default_mode when creating
the DeepSeek-OCR client with tenant configuration.

Co-authored-by: BukeLy <19304666+BukeLy@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix file upload errors for docx and txt formats fix: Add missing default_mode field to DSSeekConfig dataclass Dec 2, 2025
Copilot AI requested a review from BukeLy December 2, 2025 06:26
@BukeLy BukeLy marked this pull request as ready for review December 2, 2025 06:28
@BukeLy
Copy link
Owner

BukeLy commented Dec 2, 2025

@copilot review

@BukeLy BukeLy merged commit e34d705 into main Dec 2, 2025
4 checks passed
@BukeLy BukeLy deleted the copilot/fix-file-upload-errors branch December 2, 2025 06:32
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.

api

2 participants