cURL
Supports document search (document), data query (table), and image Q&A (image) knowledge bases; does not support audio/video search (multimedia). Data query and image Q&A knowledge bases only support the spreadsheet connector (Excel) data source. This API is idempotent. Frequent calls will be rate-limited; do not exceed 10 calls per second.
Authorizations
string
header
required
DashScope API Key, obtained from the API Key page in the console.
Body
application/jsonstring
required
Knowledge base ID, returned as data.id from the createIndex API.
object
required
Chunk content as key-value pairs. Structure varies by knowledge base type, see details below.
Document search (document) uses fixed keys:
content(String, required): Chunk body text, max length 6000title(String, optional): Chunk title, max length 50image_urls(Array, optional): Image URLs included in the chunk, max 10
Data query (table), Image Q&A (image) keys are not fixed, determined by the KB's spreadsheet data source. Keys are Excel column headers, values are the corresponding cell values. Fields used for retrieval or reply are required. Value type requirements:
- String: max length 6000
- Time: 13-digit timestamp (milliseconds)
- Long: integer, max 2147483647
- Double: supports decimals
- image_url: max 5 images, multiple values comma-separated as a single string