Create file api don't work as intended #17848

Closed
opened 2026-02-21 19:40:30 -05:00 by yindo · 0 comments
Owner

Originally created by @jason-Genesis-101 on GitHub (Sep 21, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.7.1

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

Hi, I have encountered issue with "Create a Document from a File" api. I was trying to upload a file thru this api, and my message body is

data = '''{
"original_document_id": "1234",
"indexing_technique": "high_quality",
"doc_form": "hierarchical_model",
"doc_language": "Chinese",
"process_rule": {
"mode": "custom",
"rules": {
"pre_processing_rules": [
{"id": "remove_extra_spaces", "enabled": true},
{"id": "remove_urls_emails", "enabled": false}
],
"segmentation": {
"separator": "\n",
"max_tokens": 10000
},
"parent_mode": "full-doc",
"subchunk_segmentation":{
"separator":"\n",
"max_tokens":4000
}
}
},
"retrieval_model": {
"search_method": "hybrid_search",
"reranking_enable": true,
"reranking_model": {
"reranking_provider_name": "TONGYI",
"reranking_model_name": "gte-rerank-v2"
},
"top_k": 3,
"score_threshold_enabled": false
},
"embedding_model": "text-embedding-v4",
"embedding_model_provider": "TONGYI"
}'''

with open(r"file.xlsx", "rb") as file:
    files = {
        "data": (None, data, "text/plain"),
        "file": file
    }

This api should be able to create a parent-child structure with full-doc in parent. However, I only got a one chunk structure. Please help, thanks

✔️ Expected Behavior

parent-child chunk with full-doc in parent chunk

Actual Behavior

One chunk structure

Originally created by @jason-Genesis-101 on GitHub (Sep 21, 2025). ### 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] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [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] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.7.1 ### Cloud or Self Hosted Self Hosted (Source) ### Steps to reproduce Hi, I have encountered issue with "Create a Document from a File" api. I was trying to upload a file thru this api, and my message body is data = '''{ "original_document_id": "1234", "indexing_technique": "high_quality", "doc_form": "hierarchical_model", "doc_language": "Chinese", "process_rule": { "mode": "custom", "rules": { "pre_processing_rules": [ {"id": "remove_extra_spaces", "enabled": true}, {"id": "remove_urls_emails", "enabled": false} ], "segmentation": { "separator": "\\n", "max_tokens": 10000 }, "parent_mode": "full-doc", "subchunk_segmentation":{ "separator":"\\n", "max_tokens":4000 } } }, "retrieval_model": { "search_method": "hybrid_search", "reranking_enable": true, "reranking_model": { "reranking_provider_name": "TONGYI", "reranking_model_name": "gte-rerank-v2" }, "top_k": 3, "score_threshold_enabled": false }, "embedding_model": "text-embedding-v4", "embedding_model_provider": "TONGYI" }''' with open(r"file.xlsx", "rb") as file: files = { "data": (None, data, "text/plain"), "file": file } This api should be able to create a parent-child structure with full-doc in parent. However, I only got a one chunk structure. Please help, thanks ### ✔️ Expected Behavior parent-child chunk with full-doc in parent chunk ### ❌ Actual Behavior One chunk structure
yindo added the 🐞 bug label 2026-02-21 19:40:30 -05:00
yindo closed this issue 2026-02-21 19:40:30 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#17848