Tải tệp lên để xử lý và thêm vào Cơ sở kiến thức dưới dạng bài viết.
Tải PDF lên
Phần tiêu đề “Tải PDF lên”POST https://app.quickchat.ai/v1/api/knowledge_base/file_upload_api/pdf
Tải tệp PDF lên. Nội dung được trích xuất và thêm thành bài viết.
curl -X POST https://app.quickchat.ai/v1/api/knowledge_base/file_upload_api/pdf \ -H 'Authorization: Bearer <API_TOKEN>' \ -F 'pdf_file=@document.pdf'import requests
with open("document.pdf", "rb") as f: response = requests.post( url="https://app.quickchat.ai/v1/api/knowledge_base/file_upload_api/pdf", headers={"Authorization": "Bearer <API_TOKEN>"}, files={"pdf_file": f}, )data = response.json()Phản hồi 200 OK
{ "status": "success", "message": "File processed successfully.", "article": { "id": 1234, "title": "document.pdf" }}| Trường | Mô tả |
|---|---|
status chuỗi | Trạng thái xử lý |
message chuỗi | Thông báo kết quả dễ đọc |
article đối tượng | Bài viết được tạo |
Tải tệp lên
Phần tiêu đề “Tải tệp lên”POST https://app.quickchat.ai/v1/api/knowledge_base/file_upload_api/
Tải tệp được hỗ trợ (PDF, DOCX). Nội dung được trích xuất và thêm thành bài viết.
curl -X POST https://app.quickchat.ai/v1/api/knowledge_base/file_upload_api/ \ -H 'Authorization: Bearer <API_TOKEN>' \ -F 'file=@document.docx'import requests
with open("document.docx", "rb") as f: response = requests.post( url="https://app.quickchat.ai/v1/api/knowledge_base/file_upload_api/", headers={"Authorization": "Bearer <API_TOKEN>"}, files={"file": f}, )data = response.json()Phản hồi 200 OK: cùng cấu trúc với Tải PDF lên.