跳至主要内容
版本:PrivStation 2.4.0
Markdown 原文

新增知識版本

此 API 用於建立一個新的 Fileset,作為後續知識組織與查詢的單位。

開發者可以指定該 Fileset 的 Metadata 以及要包含的檔案 ID 清單(file_ids)。

curl -X 'POST' \
'http://127.0.0.1:8000/v1/filesets' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <your-api-key>' \
-H 'Content-Type: application/json' \
-d '{
"file_ids": [
"3fa85f64-5717-4562-b3fc-2c963f66afa6"
],
"metadata": {
"from": "swagger"
},
"name": "Company Policy Files v1.0"
}'

Request Headers​

KeyValue
Request MethodPOST
acceptapplication/json
AuthorizationBearer <your-api-key>
Content-Typeapplication/json

Request Payload​

{
"file_ids": [
"3fa85f64-5717-4562-b3fc-2c963f66afa6"
],
"metadata": {
"tag": ["policy", "operation"]
},
"name": "Company Policy Files v1.0"
}

Field Explanation

FieldTypeDetailRequired
file_idsarrayFile ID 列表true
metadatastringobject,使用者自訂的描述資訊false
namestringFileset 的名稱,若沒指定系統會自動產生,格式為 fileset_YYYYMMDD_hh:mmfalse

Response Body​

{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "Company Policy Files v1.0",
"object": "fileset",
"metadata": {
"parsing_mode": "HQ",
"embedding_model": "apmic-embedding-v1",
"fail_reason": null,
"fail_detail": {},
"tag": ["policy", "operation"]
},
"state": "draft",
"created_at": "2025-01-01T00:00:00.000Z",
"committed_at": null,
"updated_at": "2025-01-01T00:00:00.000Z",
"file_counts": {
"draft": 1,
"queued": 0,
"processing": 0,
"completed": 0,
"failed": 0,
"total": 1
}
}

Field Explanation

回傳 「知識版本物件」章節列表內容。