Support ODT/OpenDocument Text document extraction
💪 enhancement
### Self Checks
- [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542).
- [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones.
- [x] I confirm that I am using English to submit this report, otherwise it will be closed.
- [x] Please do not modify this template :) and fill in all the required fields.
### 1. Is this request related to a challenge you're experiencing? Tell me about your story.
Dify currently supports many document formats for knowledge ingestion and workflow document extraction, but OpenDocument Text files (`.odt`) are not included in the document extension allowlist. This makes it impossible to upload or route `.odt` files through the same extraction path as other office document formats, even though `.odt` is a common open standard format used by LibreOffice, OpenOffice, and other document editors.
The upstream `langgenius/graphon` package already added OpenDocument Text extraction support in `langgenius/graphon#203`, and that support is available in Graphon `v0.7.0`. Dify `main` is already pinned to `graphon==0.7.0`, so the remaining Dify-side work is to expose `.odt` in the document extension allowlist and cover the document extractor routing behavior.
Proposed behavior:
- Allow `.odt` in Dify document extension allowlists for both SelfHosted and Unstructured ETL modes.
- Route `.odt` files to the Graphon OpenDocument Text extractor.
- Route `application/vnd.oasis.opendocument.text` MIME type to the same extractor path.
- Add regression tests for constants and document extractor routing.
I opened an initial implementation PR at https://github.com/langgenius/dify/pull/39973, but it was closed because this feature request had not been discussed in an associated issue first. Opening this issue to discuss the change before reopening or recreating the PR.
### 2. Additional context or comments
Relevant upstream and implementation references:
- Graphon ODT support PR: https://github.com/langgenius/graphon/pull/203
- Graphon release containing ODT support: https://github.com/langgenius/graphon/releases/tag/v0.7.0
- Initial Dify implementation PR: https://github.com/langgenius/dify/pull/39973
The initial PR included:
- adding `odt` to Dify document extension lists
- tests for SelfHosted and Unstructured ETL document extensions
- tests for `.odt` extension and `application/vnd.oasis.opendocument.text` MIME routing through the document extractor
Local validation from the initial PR:
- targeted ODT tests passed
- `make lint` passed
- targeted type-check for changed files passed
- `TZ=UTC make test` passed
### 3. Can you help us with this feature?
- [x] I am interested in contributing to this feature.
0 条评论