From 75c164de69caf6044e49c18a828e2bfd5c4cbd94 Mon Sep 17 00:00:00 2001 From: TITC Date: Wed, 12 Feb 2025 14:04:02 +0800 Subject: [PATCH] Fix incorrect usage of insert_file API --- examples/lightrag_api_ollama_demo.py | 2 +- examples/lightrag_api_openai_compatible_demo.py | 2 +- examples/lightrag_api_oracle_demo.py | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/lightrag_api_ollama_demo.py b/examples/lightrag_api_ollama_demo.py index 634264d3..079e9935 100644 --- a/examples/lightrag_api_ollama_demo.py +++ b/examples/lightrag_api_ollama_demo.py @@ -158,7 +158,7 @@ if __name__ == "__main__": # curl -X POST "http://127.0.0.1:8020/insert" -H "Content-Type: application/json" -d '{"text": "your text here"}' # 3. Insert file: -# curl -X POST "http://127.0.0.1:8020/insert_file" -H "Content-Type: application/json" -d '{"file_path": "path/to/your/file.txt"}' +# curl -X POST "http://127.0.0.1:8020/insert_file" -H "Content-Type: multipart/form-data" -F "file=@path/to/your/file.txt" # 4. Health check: # curl -X GET "http://127.0.0.1:8020/health" diff --git a/examples/lightrag_api_openai_compatible_demo.py b/examples/lightrag_api_openai_compatible_demo.py index e2d63e41..68ccfe95 100644 --- a/examples/lightrag_api_openai_compatible_demo.py +++ b/examples/lightrag_api_openai_compatible_demo.py @@ -176,7 +176,7 @@ if __name__ == "__main__": # curl -X POST "http://127.0.0.1:8020/insert" -H "Content-Type: application/json" -d '{"text": "your text here"}' # 3. Insert file: -# curl -X POST "http://127.0.0.1:8020/insert_file" -H "Content-Type: application/json" -d '{"file_path": "path/to/your/file.txt"}' +# curl -X POST "http://127.0.0.1:8020/insert_file" -H "Content-Type: multipart/form-data" -F "file=@path/to/your/file.txt" # 4. Health check: # curl -X GET "http://127.0.0.1:8020/health" diff --git a/examples/lightrag_api_oracle_demo.py b/examples/lightrag_api_oracle_demo.py index 602ca900..6162a300 100644 --- a/examples/lightrag_api_oracle_demo.py +++ b/examples/lightrag_api_oracle_demo.py @@ -269,7 +269,8 @@ if __name__ == "__main__": # curl -X POST "http://127.0.0.1:8020/insert" -H "Content-Type: application/json" -d '{"text": "your text here"}' # 3. Insert file: -# curl -X POST "http://127.0.0.1:8020/insert_file" -H "Content-Type: application/json" -d '{"file_path": "path/to/your/file.txt"}' +# curl -X POST "http://127.0.0.1:8020/insert_file" -H "Content-Type: multipart/form-data" -F "file=@path/to/your/file.txt" + # 4. Health check: # curl -X GET "http://127.0.0.1:8020/health"