Create a data-side empty knowledge base¶
Create a knowledge base without data sources. After successful creation, upload and add files or data tables.
POST https://moi.matrixorigin.cn/newmoi/semantic-models/create-empty
Preparation before calling¶
Prepare a personal access token and workspace ID that has permission to create a knowledge base for the target workspace. Examples use $AI_STUDIO_API_KEY and $WORKSPACE_ID.
Request example¶
curl -X POST "https://moi.matrixorigin.cn/newmoi/semantic-models/create-empty" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"name": "product_docs",
"description": "产品资料",
"image_index_enabled": false
}'
Request body¶
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
The name of the knowledge base. |
|
string |
No |
Knowledge base description. |
|
boolean |
No |
Whether to enable image indexing; when not uploaded, it is |
Successful response¶
Returns 201 on success. Save data.model.id and use it as model_id in subsequent interfaces.
{
"code": "OK",
"msg": "OK",
"data": {
"model": {
"id": 401,
"name": "product_docs",
"tables": []
},
"data_domain": {
"model_id": 401,
"ensure_status": "ready"
}
}
}
Field |
Type |
Description |
|---|---|---|
|
object |
New knowledge base. |
|
integer |
Knowledge base ID. |
|
object |
The data domain information of this knowledge base. |
|
string |
Data field preparation status. |
Common mistakes¶
HTTP Status Codes |
Error Codes |
Common Causes |
Recommended Actions |
|---|---|---|---|
|
|
|
Provide a non-empty name and check the JSON. |
|
|
The API Key is invalid or has expired. |
Check API Key. |
|
|
No workspace creation permission. |
Check workspace authorization. |
Follow-up operations¶
Use data.model.id to upload the local file or add data source].