# Commit知識版本

![](https://privstation-docs.apmic.ai/img/notion/98a7e27ed56a.png)

此 API 用於將指定的 Fileset 提交為一個可查詢的知識版本。一旦執行 Commit，系統會：

1. 針對 Fileset 中所有檔案根據**解析模式**進行內容解析與切段

1. 將每段內容進行語意向量化（embedding）處理

1. 提交後的版本具有穩定性與可追溯性，可在後續的 RAG 查詢中指定使用。

**備註：已 Commit 的 Fileset 內容不可再修改，若需更新，請建立新的 Fileset 並重新 Commit。**

```javascript
curl -X 'POST' \
  'http://127.0.0.1:8000/v1/filesets/{fileset_id}/commit' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <your-api-key>'
```

#### Request Headers

| **Key** | **Value** |
| --- | --- |
| Request Method | POST |
| accept | application/json |
| Authorization | Bearer &lt;your-api-key> |
| Content-Type | application/json |

#### Query Parameters

| **Field** | **Type** | **Note** | **Required** |
| --- | --- | --- | --- |
| fileset_id | string | uuid | true |

#### Request Payload

```javascript
{
  "embedding_model": "llama-3.2-nv-embedqa-1b-v2",
  "parsing_mode": "HQ"
}
```

**Field Explanation**

| **Field** | **Type** | **Detail** | **Required** |
| --- | --- | --- | --- |
| embedding_model | string | 指定轉換成向量資料庫的模型 | true |
| parsing_mode | string | 指定轉換的解析模式，包含 HQ、LQ、STD | false |

#### Response Body

```javascript
{
  "detail": "Commit fileset with ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
```
