When following the provided documentation for uploading a file to the /insert_file endpoint, I encountered an error. The documentation suggests using a JSON body with a file_path field, but this results in a 422 Unprocessable Entity error. After some investigation, I found that the correct way to upload a file is by using the -F option in curl to specify the file directly.
Steps to Reproduce:
Follow the provided documentation to upload a file:
Update the documentation to reflect the correct usage of the /insert_file endpoint. Specifically, change the example curl command to use the -F option for file upload.
Description:
When following the provided documentation for uploading a file to the
/insert_file
endpoint, I encountered an error. The documentation suggests using a JSON body with afile_path
field, but this results in a422 Unprocessable Entity
error. After some investigation, I found that the correct way to upload a file is by using the-F
option incurl
to specify the file directly.Steps to Reproduce:
Follow the provided documentation to upload a file:
Observe the following errors:
Correct Usage:
To correctly upload a file to the
/insert_file
endpoint, use the followingcurl
command:Expected Behavior:
The server should accept the file and return a success response, such as:
Additional Information:
Endpoint Source Code:
lightrag_api_openai_compatible_demo.py , line 120
Environment:
Suggested Fix:
Update the documentation to reflect the correct usage of the
/insert_file
endpoint. Specifically, change the examplecurl
command to use the-F
option for file upload.Thank you for your attention to this issue.