Knowledge
API Authorization
NOTE
- To obtain the AUTH_TOKEN, please refer to the Authorization section and find the AUTH_TOKEN section.
- Please make sure that all API requests include the AUTH_TOKEN in the request header, as shown below:
SDK Authorization
NOTE
- Before integrating the SDK, please make sure that you have obtained the APP_ID and APP_KEY.
- To obtain the APP_ID and APP_KEY, please refer to the Authorization section and find the Obtain APP_ID & APP_KEY section.
Knowledge Base
API Request
- Example
- Field description
Parameter Name | Type | Required | Description |
---|---|---|---|
page | Integer | N | Page number, starting from 0. |
size | Integer | N | Number of records to return per page. |
keyword | String | N | Keyword to search for. |
API Response
- Example
- Field description
Parameter Name | Type | Required | Description |
---|---|---|---|
pageNum | Integer | Y | Page number, starting from 0. |
pageSize | Integer | Y | Number of records to return per page. |
total | Integer | Y | Total number of records. |
pages | Integer | Y | Total number of pages. |
currentPageTotal | Integer | Y | Number of records returned in the current page. |
content | Array<Object> | Y | Content of the knowledge base list. |
content.id | Integer | Y | Unique identifier for the knowledge base. |
content.name | String | Y | Name of the knowledge base. |
content.description | String | Y | Description of the knowledge base. |
content.status | String | Y | Status of the knowledge base. ENABLED/DISABLED |
content.totalDoc | Integer | Y | Total number of documents in the knowledge base. |
content.totalRecord | Integer | Y | Total number of records in the knowledge base. |
content.createDatetime | Timestamp | Y | Creation time of the knowledge base. |
content.updateDatetime | Timestamp | Y | Update time of the knowledge base. |
Knowledge Doc
API Request
- Example
- Field description
Parameter Name | Type | Required | Description |
---|---|---|---|
page | Integer | N | Page number, starting from 0. |
size | Integer | N | Number of records to return per page. |
keyword | String | N | Keyword to search for. |
knowledgeBaseId | Integer | Y | Unique identifier for knowledge base. |
API Response
- Example
- Field description
Parameter Name | Type | Required | Description |
---|---|---|---|
pageNum | Integer | Y | Page number, starting from 0. |
pageSize | Integer | Y | Number of records to return per page. |
total | Integer | Y | Total number of records. |
pages | Integer | Y | Total number of pages. |
currentPageTotal | Integer | Y | Number of records returned in the current page. |
content | Array<Object> | Y | Content of the knowledge base documents |
content.id | Integer | Y | Unique identifier for the knowledge base document. |
content.name | String | Y | Name of the knowledge base document. |
content.type | String | Y | Type of the knowledge base document. TEXT_PLAIN/MARKDOWN/ APPLICATION_PDF/DOCX |
content.source | String | Y | Source of the knowledge base document. LOCAL/ONLINE |
content.status | String | Y | Status of the knowledge base document. UN_PROCESS/PROCESSING/ PROCESSING_FAILED/PROCESSED |
content.totalRecord | Integer | Y | Total number of records in the knowledge base document. |
content.createDatetime | Timestamp | Y | Creation time of the knowledge base document. |
content.updateDatetime | Timestamp | Y | Update time of the knowledge base document. |
Knowledge Doc Upload
API Request
- Example
- Field description
Parameter Name | Type | Required | Description |
---|---|---|---|
knowledgeBaseId | Integer | Y | Unique identifier for knowledge base. |
document | File | Y | Document to be uploaded. |
API Response
- Example
- Field description
Parameter Name | Type | Required | Description |
---|---|---|---|
id | String | Y | Temporary ID of the uploaded document. |
Knowledge Doc Extract
Process Trigger
API Request
- Example
- Field description
Parameter Name | Type | Required | Description |
---|---|---|---|
id | Integer | Y | Temporary ID of the uploaded document. |
knowledgeBaseId | Integer | Y | Unique identifier for knowledge repository. |
source | String | Y | Source of the document. |
ragStatus | String | N | Whether to enable Search Enhancement (RAG). ENABLED/DISABLED |
segmentIdentifier | String | N | Segment identifier. LINE_BREAK/LINE_BREAK_2 |
segmentSize | Integer | N | Segment size limit (0-2000) |
API Response
- Example
- Field description
Parameter Name | Type | Required | Description |
---|---|---|---|
taskId | Integer | Y | ID of the task. |
status | String | Y | Status of the task. CREATED/IN_PROCESS/FAILED/FINISHED |
totalNum | Integer | Y | Total number of items in the task. |
successNum | Integer | Y | Number of items successfully processed in the task. |
failureNum | Integer | Y | Number of items that failed to be processed in the task. |
Process Detail
API Request
- Example
- Field description
Parameter Name | Type | Required | Description |
---|---|---|---|
id | Integer | Y | ID of the task. |
API Response
- Example
- Field description
Parameter Name | Type | Required | Description |
---|---|---|---|
taskId | Integer | Y | ID of the task. |
status | String | Y | Status of the task. CREATED/IN_PROCESS/FAILED/FINISHED |
totalNum | Integer | Y | Total number of items in the task. |
successNum | Integer | Y | Number of items successfully processed in the task. |
failureNum | Integer | Y | Number of items that failed to be processed in the task. |
data | Object | Y | Progress of the task and additional information. |
Knowledge Doc Preview
API Request
- Example
- Field description
参数名称 | 类型 | 是否必填 | 描述 |
---|---|---|---|
page | Integer | N | 页码(起始值为0) |
size | Integer | N | 单页返回记录数 |
knowledgeBaseId | Integer | Y | 知识库唯一标识 |
knowledgeDocId | Integer | Y | 知识库文档唯一标识 |
API Response
- Example
- Field description
Parameter Name | Type | Required | Description |
---|---|---|---|
id | Integer | Y | Unique identifier of the document. |
hasMore | Boolean | Y | Indicates whether there are more segmented contents. |
segments | Array<Object> | Y | List of segmented contents. |
segments.number | Integer | Y | Number of the document segment (starting from 0). |
segments.tokens | Integer | Y | Token estimate for the document segment. |
segments.raw | String | Y | Raw data for the document segment. |