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

更新知識版本

此 API 用於更新指定 Fileset 所包含的檔案清單(file_ids)。

你可以透過此操作,完全取代原有 Fileset 中的檔案以及 Metadata。

備註:

  • 僅可更新尚未 Commit 的 Fileset

  • 一旦該 Fileset 已提交為知識版本(Committed),其內容即無法再修改,如需變更,請建立新的 Fileset 並重新 Commit

curl -X 'PUT' \
'http://127.0.0.1:8000/v1/filesets/{fileset_id}' \
-H 'accept: application/json' \
-H 'Authorization: Bearer a7d54e9171b5d1095f9fb59e' \
-H 'Content-Type: application/json' \
-d '{
"file_ids": [
"3fa85f64-5717-4562-b3fc-2c963f66afa6",
"8871d153-e495-41a0-a862-289095802781"
],
"metadata": {
"tag": ["policy", "operation", "draft"]
},
"name": "Company Policy Files v2.0"
}'

Request Headers​

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

Query Parameters​

FieldTypeNoteRequired
fileset_idstringuuidtrue

Request Payload​

{
"file_ids": [
"3fa85f64-5717-4562-b3fc-2c963f66afa6",
"8871d153-e495-41a0-a862-289095802781"
],
"metadata": {
"tag": ["policy", "operation", "draft"]
},
"name": "Company Policy Files v2.0"
}

Field Explanation

FieldTypeDetailRequired
file_idsarrayFile ID 列表true
metadatastringobject,使用者自訂的描述資訊true
namestringFileset 的名稱true

Response Body​

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

Field Explanation

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