Query knowledge base details

Query the knowledge base definition and source quantity by knowledge base ID. You should use this interface to confirm the current status before updating or deleting.

HTTP
GET $CLOUDSIGMA_API_BASE/semantic-models/{model_id}

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. First query the knowledge base list to obtain the knowledge base ID. Prepare a personal access token and target workspace ID that can access the target workspace.

Request parameters

Shell
curl "$CLOUDSIGMA_API_BASE/semantic-models/$MODEL_ID" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"

Path parameters

Field

Type

Required

Description

model_id

integer

Yes

knowledge base ID.

Successful response

JSON
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "id": 401,
    "name": "product_docs",
    "description": "产品文档",
    "tables": [],
    "files": [],
    "source_counts": {
      "files": 2,
      "tables": 1,
      "total": 3
    },
    "created_at": 1735632000,
    "updated_at": 1735718400
  }
}

Field

Type

Description

code

string

OK on success.

msg

string

OK on success.

data

object

response data.

data.id

integer

knowledge base ID.

data.name

string

knowledge base name.

data.description

string

knowledge base description. May be omitted if not set.

data.tables

array of object

Compatible legacy table source definitions.

data.files

object

Compatible legacy file source definitions. May be omitted if not set.

data.source_counts

object

Current source quantity.

data.created_at

integer

Unix timestamp.

data.updated_at

integer

Unix timestamp.

data.tables[].db_name

string

The name of the database where the table comes from.

data.tables[].table_names

array of string

The name of the table included in the knowledge base in this database.

data.files.file_ids

array of string

File ID.

data.files.parents

array of string

The parent path of the file source.

data.files.volume_ids

array of string

The volume ID from which the file originated.

data.files.volumes

array of object

File source volume and path.

data.files.vector_table

string

Vector table name.

data.files.embedding_model

string

Embedding model identifier.

data.files.tags

array of string

File source tag.

data.files.volumes[].volume_id

string

Volume ID.

data.files.volumes[].parents

array of string

The parent path of the volume source.

data.files.volumes[].path

array of string

File path within the volume.

data.source_counts.files

integer

Number of file sources.

data.source_counts.tables

integer

Table source number.

data.source_counts.total

integer

Total number of sources.

Error response

JSON
{
  "code": "ErrNotFound",
  "msg": "resource not found",
  "data": null
}

Field

Type

Description

code

string

error code.

msg

string

Error description.

data

null

null on error.

Last updated on