Use the UpdateKnowledgeBase API to update the description, tags, or retrieval configuration of a knowledge base. At least one of description, tags, or retrievalConfiguration must be specified; otherwise, an error is returned.
Prerequisites
-
An AgentStorage instance has been created and is in the
normalstate, and the instance endpoint and instance name have been obtained. -
An API Key has been created.
-
The knowledge base to be updated must already exist.
Request parameters
|
Parameter |
Type |
Description |
|
|
string |
The name of the knowledge base. (Required) |
|
|
string |
The updated description. Maximum size: 4 KB. |
|
|
list<string> |
The updated tags. |
|
|
object |
The updated default retrieval configuration. |
Request example
When you use API Key authentication, pass the instance name and API Key in the x-ots-instancename and x-ots-apikey request headers.
curl -X POST https://<endpoint>/UpdateKnowledgeBase \
-H "x-ots-instancename: <instance-name>" \
-H "x-ots-apikey: <your-api-key>" \
-H "Content-Type: application/json" \
-d '{
"knowledgeBaseName": "product_docs_kb",
"description": "Updated description",
"tags": ["launched"]
}'
Response
{"code":"SUCCESS","data":{},"message":"succeed"}