[PR #11364] fix(document_extractor): pptx file type and missing metadata_filename UnstructuredIO #27187

Closed
opened 2026-02-21 20:41:02 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/11364

State: closed
Merged: Yes


Summary

The issue occurs when two environment variables for UnstructuredIO, UNSTRUCTURED_API_URL and UNSTRUCTURED_API_KEY, have been defined.

After uploading a PPTX file and processing it through the Doc Extractor (UnstructuredIO), an error message appears: "If file is specified in partition_via_api, metadata_filename must be specified as well."

I checked and noticed that the file type might not be correctly set for the partition_via_api method when handling .pptx files. Additionally, I added the metadata_filename, which was previously missing, to extract the value from the file name.

References from the unstructured package:
Line 54
Line 107

Screenshots

Before: After:
image image image image

Checklist

Important

Please review the checklist below before submitting your pull request.

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods
**Original Pull Request:** https://github.com/langgenius/dify/pull/11364 **State:** closed **Merged:** Yes --- # Summary The issue occurs when two environment variables for UnstructuredIO, `UNSTRUCTURED_API_URL` and `UNSTRUCTURED_API_KEY`, have been defined. After uploading a PPTX file and processing it through the Doc Extractor (UnstructuredIO), an error message appears: "If file is specified in partition_via_api, metadata_filename must be specified as well." I checked and noticed that the file type might not be correctly set for the `partition_via_api` method when handling .pptx files. Additionally, I added the `metadata_filename`, which was previously missing, to extract the value from the file name. References from the `unstructured` package: • [Line 54](https://github.com/Unstructured-IO/unstructured/blob/0fb814db6188813df61fd3aeb1905a9dae21771c/unstructured/partition/api.py#L54) • [Line 107](https://github.com/Unstructured-IO/unstructured/blob/0fb814db6188813df61fd3aeb1905a9dae21771c/unstructured/partition/api.py#L107) # Screenshots <table> <tr> <td>Before: </td> <td>After: </td> </tr> <tr> <td><img width="385" alt="image" src="https://github.com/user-attachments/assets/f6a928f0-eee0-45b7-bbcd-cd401e803c06"> <img width="353" alt="image" src="https://github.com/user-attachments/assets/2e9ce9ed-69b6-4053-9715-5bf99bc8ffc2"></td> <td><img width="630" alt="image" src="https://github.com/user-attachments/assets/a09a62d6-f4ac-4cb2-b5b8-6aaab55c6ada"> <img width="422" alt="image" src="https://github.com/user-attachments/assets/da10bf45-c193-454e-ba50-4cc79004c89b"></td> </tr> </table> # Checklist > [!IMPORTANT] > Please review the checklist below before submitting your pull request. - [ ] This change requires a documentation update, included: [Dify Document](https://github.com/langgenius/dify-docs) - [x] I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!) - [x] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change. - [x] I've updated the documentation accordingly. - [x] I ran `dev/reformat`(backend) and `cd web && npx lint-staged`(frontend) to appease the lint gods
yindo added the pull-request label 2026-02-21 20:41:02 -05:00
yindo closed this issue 2026-02-21 20:41:02 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#27187