跳转到内容

知识库管理

  • Base URL: https://stardust.ticos.cn
  • 提交: POST /knowledge
  • 删除: DELETE /knowledge/{id}
  • 认证: Authorization: Bearer <token>

1. 提交知识库内容(POST /knowledge)

Section titled “1. 提交知识库内容(POST /knowledge)”

支持 application/jsonmultipart/form-data

  • id(可选):知识库条目唯一标识
  • title(可选):标题
  • content(必填):正文内容
{
"id": "knowledge_idxxx",
"title": "纸鹤与咖啡",
"content": "故事概括:一个工作日的早晨..."
}
curl --location --request POST 'https://stardust.ticos.cn/knowledge' \
--header 'Authorization: Bearer <API_KEY>' \
--form 'id="knowledge_idxxx"' \
--form 'title="纸鹤与咖啡"' \
--form 'content="故事概括:一个工作日的早晨..."'

2. 删除知识库内容(DELETE /knowledge/{id}

Section titled “2. 删除知识库内容(DELETE /knowledge/{id})”
curl --location --request DELETE 'https://stardust.ticos.cn/knowledge/knowledge_idxxx' \
--header 'Authorization: Bearer <API_KEY>'
  • 200 OK:成功
  • 400 Bad Request:请求参数错误
  • 401 Unauthorized:鉴权失败
  • 404 Not Found:指定 ID 不存在
  • 500 Internal Server Error:服务器错误