上傳檔案,處理後以文章形式加入知識庫。
上傳 PDF
Section titled “上傳 PDF”POST https://app.quickchat.ai/v1/api/knowledge_base/file_upload_api/pdf
上傳 PDF 檔案。系統會擷取內容並新增為文章。
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()回應 200 OK
{ "status": "success", "message": "File processed successfully.", "article": { "id": 1234, "title": "document.pdf" }}| 欄位 | 說明 |
|---|---|
status 字串 | 處理狀態 |
message 字串 | 易於閱讀的結果訊息 |
article 物件 | 建立的文章 |
POST https://app.quickchat.ai/v1/api/knowledge_base/file_upload_api/
上傳支援的檔案(PDF、DOCX)。系統會擷取內容並新增為文章。
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()回應 200 OK:結構與上傳 PDF 相同。