跳轉到主要內容
POST
/
v1
/
projects
/
{projectId}
/
knowledgebases
/
{knowledgebaseId}
/
datasets
建立資料集
curl --request POST \
  --url https://api.pathors.com/v1/projects/{projectId}/knowledgebases/{knowledgebaseId}/datasets \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>' \
  --data '{}'
上傳檔案作為新的資料集。上傳後檔案會以非同步方式切割成區塊並嵌入 — 請輪詢 列出資料集 並觀察 isParsed,以得知何時可供查詢。

請求

POST https://api.pathors.com/v1/projects/{projectId}/knowledgebases/{knowledgebaseId}/datasets

路徑參數

projectId
string
必填
專案 ID
knowledgebaseId
string
必填
要上傳至的知識庫

標頭

Authorization
string
必填
使用您的 Developer Key 進行 Bearer 令牌認證
Content-Type
string
必填
必須為 multipart/form-data

請求主體

dataset
file
必填
要上傳的檔案。支援格式:PDF、TXT、DOCX 及其他以文字為基礎的格式。

回應

{
  "message": "Dataset Uploaded successfully, currently embedding in the background",
  "success": true
}

範例

curl -X POST https://api.pathors.com/v1/projects/{projectId}/knowledgebases/kb_abc123/datasets \
  -H "Authorization: Bearer dk_your_key" \
  -F "dataset=@/path/to/your/file.pdf"