Create knowledge base¶
Create the knowledge base of the resource center to support compatibility with old source configuration through tables and files parameters. Data sources and semantic entries can be added individually after creation.
POST $CLOUDSIGMA_API_BASE/semantic-models
Before you call¶
Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. Prepare a personal access token and target workspace ID that has access rights to the target workspace and permission to create knowledge base.
Request body¶
curl -X POST "$CLOUDSIGMA_API_BASE/semantic-models" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"name": "<KNOWLEDGE_BASE_NAME>",
"description": "<DESCRIPTION>",
"tables": []
}'
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
The knowledge base name must be non-empty and contain at most 255 Unicode characters. It cannot contain leading or trailing spaces. See below for character rules. |
|
string |
No |
Coverage and instructions for use. |
|
array of object |
No |
Compatible legacy table source definitions. For new access sources, please use the add data source interface. |
|
object |
No |
Compatible legacy file source configuration. For new access sources, please use the add data source interface. |
|
string |
Conditional |
The name of the database where the table comes from. |
|
array of string |
Conditional |
The name of the table in the database to be included in the knowledge base. |
|
array of string |
No |
File ID. The server does not retain this field when creating the knowledge base. You should use the add data source interface instead. |
|
array of string |
No |
The parent path of the file source. |
|
array of string |
No |
The volume ID from which the file originated. |
|
array of object |
No |
File source volume and path. |
|
string |
No |
Vector table name. The server can complete the default value. |
|
string |
No |
Embedding model identifier. The server can complete the default value. |
|
array of string |
No |
File source tag. |
|
string |
Conditional |
Volume ID. |
|
array of string |
No |
The parent path of the volume source. |
|
array of string |
No |
File path within the volume. |
The name follows Catalog naming rules. The first character supports lowercase letters, numbers, underscores or Chinese characters. Subsequent characters also support hyphen (-) and dot (.). For example product_docs, 产品资料. Capital letters, spaces, or slashes cannot be used (/). The name cannot be modified after it is created.
Successful response¶
{
"code": "OK",
"msg": "OK",
"data": {
"id": 401,
"name": "product_docs",
"description": "产品文档",
"tables": [],
"source_counts": {
"files": 0,
"tables": 0,
"total": 0
},
"created_at": 1735632000,
"updated_at": 1735632000
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
object |
response data. |
|
integer |
New knowledge base ID. |
|
string |
The name of the created knowledge base. |
|
string |
Saved description. May be omitted if not set. |
|
array of object |
Compatible legacy table source definitions. |
|
object |
Compatible legacy file source definitions. |
|
object |
Create source count in snapshot. The empty knowledge base items are |
|
integer |
Unix timestamp. |
|
integer |
Unix timestamp. |
|
string |
The name of the database where the table comes from. |
|
array of string |
The name of the table included in the knowledge base in this database. |
|
array of string |
File ID. |
|
array of string |
The parent path of the file source. |
|
array of string |
The volume ID from which the file originated. |
|
array of object |
File source volume and path. |
|
string |
Vector table name. |
|
string |
Embedding model identifier. |
|
array of string |
File source tag. |
|
string |
Volume ID. |
|
array of string |
The parent path of the volume source. |
|
array of string |
File path within the volume. |
|
integer |
Number of file sources. |
|
integer |
Table source number. |
|
integer |
Total number of sources. |
Error response¶
{
"code": "ErrParamInvalid",
"msg": "name is required",
"data": null
}
Field |
Type |
Description |
|---|---|---|
|
string |
error code. |
|
string |
Error description. |
|
null |
|