Tongyi Deep Search applications can connect to both Alibaba Cloud Model Studio knowledge bases and your own custom knowledge bases. This document describes the API specifications for connecting to a custom knowledge base.
Request description
API
Protocol: HTTP POST
API: Custom
Description: This API allows Tongyi Deep Search applications to perform complex text queries, sorting, and paging operations on your provided endpoint.
Request headers
Parameter | Type | Description | Required |
|---|---|---|---|
Authorization | string | Authentication information | Yes |
Content-Type | string | Static value: application/json | Yes |
Request body
Parameter | Type | Description | Required |
|---|---|---|---|
rid | string | Request ID | Yes |
query | string | Query text | Yes |
num | int | Number of items to retrieve. The value must be between 1 and 100. | Yes |
page | int | Page number. The value must be between 1 and 100. | No |
debug | bool | Debug mode. The default value is false. | No |
Request example
Response description
Response parameters
Parameter | Type | Description | Required |
|---|---|---|---|
rid | string | Request ID | Yes |
status | int | Status code. 0 indicates success. | Yes |
message | string | Status message | Yes |
data | object | Response data | Yes |
data.total | int | Total Retrievals | No |
data.docs | array<object> | List of retrieved data. The fields are extensible. | Yes |
data.docs.[].id | string | Page ID | Yes |
data.docs.[].title | string | Title | Yes |
data.docs.[].url | string | Webpage URL | Yes |
data.docs.[].snippet | string | Summary | Yes |
data.docs.[].content | string | Original webpage content | No |
data.docs.[].timestamp_format | string | Webpage publication time | No |
data.docs.[].timestamp | long | Webpage publication timestamp | No |
data.docs.[].hostname | string | Website name | No |
data.docs.[].hostlogo | string | Website logo | No |
debug | object | Debug data | No |