Query the knowledge base list

Paging lists the knowledge base (semantic model) that can be read by the current workspace. First find the knowledge base ID through this interface, and then query the details or add a data source.

HTTP
GET $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 can access the target workspace.

Request parameters

Shell
curl "$CLOUDSIGMA_API_BASE/semantic-models?page_size=20&search=product&tags=product" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"

Query parameters

The interface supports server-side paging. Continue to use the next_page_token returned in the response and do not infer the last page based on the current page entry count.

Field

Type

Required

Description

page_size

integer

No

The number of items on a single page, ranging from 1 to 100. When not transmitted, it is 20.

page_token

string

No

next_page_token from the previous page response.

search

string

No

Search criteria for name or description.

tags

array of string

No

Tag filters. Pass parameters repeatedly, such as tags=product&tags=support.

Successful response

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

Field

Type

Description

code

string

OK on success.

msg

string

OK on success.

data

object

response data.

data.items

array of object

The knowledge base of the current page.

data.total

integer

The total number of matches that match the current filter criteria.

data.next_page_token

string

The token passed in unchanged when reading the next page.

data.items[].id

integer

Knowledge base ID, which can be used as model_id for subsequent interfaces.

data.items[].name

string

knowledge base name.

data.items[].description

string

knowledge base description. May be omitted if not set.

data.items[].tables

array of object

Compatible legacy table source definitions.

data.items[].files

object

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

data.items[].source_counts

object

The number of sources that the list or detail path supplements.

data.items[].created_at

integer

Unix timestamp of creation time.

data.items[].updated_at

integer

Unix timestamp of the time of update.

data.items[].tables[].db_name

string

The name of the database where the table comes from.

data.items[].tables[].table_names

array of string

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

data.items[].files.file_ids

array of string

File ID.

data.items[].files.parents

array of string

The parent path of the file source.

data.items[].files.volume_ids

array of string

The volume ID from which the file originated.

data.items[].files.volumes

array of object

File source volume and path.

data.items[].files.vector_table

string

Vector table name.

data.items[].files.embedding_model

string

Embedding model identifier.

data.items[].files.tags

array of string

File source tag.

data.items[].files.volumes[].volume_id

string

Volume ID.

data.items[].files.volumes[].parents

array of string

The parent path of the volume source.

data.items[].files.volumes[].path

array of string

File path within the volume.

data.items[].source_counts.files

integer

Number of file sources.

data.items[].source_counts.tables

integer

Table source number.

data.items[].source_counts.total

integer

Total number of sources.

When data.next_page_token is not empty, pass it as page_token to the next request until an empty token is returned.

Error response

The same response format is returned when the request fails, where data is null.

JSON
{
  "code": "ErrParamInvalid",
  "msg": "page_size is invalid",
  "data": null
}

Field

Type

Description

code

string

error code.

msg

string

Error description.

data

null

null on error.

Last updated on