Open LeShan666 opened 3 weeks ago
@LeShan666 Hello there! 👋 I'm here to help you out with any bugs, questions, or contributions you have. I'm Dosu, a bot designed to assist you while you wait for a human maintainer.
To resolve the "Could not resolve host: POST" and "Invalid_param" errors, ensure the curl
command syntax is correct. Here is the corrected command:
curl --location --request POST 'https://api.dify.ai/v1/datasets/{dataset_id}/document/create_by_file' \
--header 'Authorization: Bearer {api_key}' \
--form 'data={
"name": "Dify",
"indexing_technique": "high_quality",
"process_rule": {
"rules": {
"pre_processing_rules": [{
"id": "remove_extra_spaces",
"enabled": true
}, {
"id": "remove_urls_emails",
"enabled": true
}],
"segmentation": {
"separator": "###",
"max_tokens": 500
}
},
"mode": "custom"
}
};type=application/json' \
--form 'file=@"/data/leshan/file_upload_dify.txt"'
Replace {dataset_id}
with your actual dataset ID and {api_key}
with your actual API key. Ensure the file path "/data/leshan/file_upload_dify.txt"
points to the correct file you want to upload. Note that the data
form field should be correctly formatted as JSON and the type
should be set to application/json
[1][2][3][4][5].
To continue talking to Dosu, mention @dosu.
Feel free to open a pr for this.
I encountered the same issue today and found this issue while searching. If it's alright with you, I'd be willing to create a PR. How does that sound?
Self Checks
Provide a description of requested docs changes
Could not resolve host: POST and invalid_param
When using the official documentation's instruction for creating documents by file, you might encounter two errors: "Could not resolve host" which means the system was unable to find the host address, and "Invalid_param" which indicates that an invalid parameter was provided.
solutions: curl --location -X POST 'https://api.dify.ai/v1/datasets/{dataset_id}/document/create_by_file' \ --header 'Authorization: Bearer {api_key}' \ --form 'data={ "name": "Dify", "indexing_technique": "high_quality", "process_rule": { "rules": { "pre_processing_rules": [{ "id": "remove_extra_spaces", "enabled": true }, { "id": "remove_urls_emails", "enabled": true }], "segmentation": { "separator": "###", "max_tokens": 500 } }, "mode": "custom" } }' \ --form 'file=@"/data/leshan/file_upload_dify.txt"'